EABase

What is EABase?

EABase is a small set of header files that define platform-independent data types and macros. As such it is similar to many projects that have a platform.h, system.h, defines.h, etc. file. The difference is that EABase is very comprehensive and is the annointed Electronic Arts worldwide standard for new projects.

With respect to the base types and definitions, many of these are already present in the most recent C language standard, though the C++ standard has yet to formally adopt them. EABase bridges the gap and defines these values if they aren't already defined. With respect to compiler and platform definitions, EABase provides a standard reliable means of identifying or specifying compilers, platforms, endian-ness, alignment attributes, etc.

Usage notes

You probably don't want to use float_t and double_t. They are there for C99 compatibility but are rarely what you want to use, since their size is variable.

Prid8, etc. are somewhat painful and ugly to use and you may find you don't like them. They too are for C99 compatibility.

intptr_t is not a pointer to an int; it's an int with the same size as a pointer, so you can safely store pointers in it.

EA::result_type is rarely used and exists for backwards compatibility.

What specifically does EABase define?

Here we list the things EABase defines, grouped by category. These defines are up to date as of the file modification date listed at the top of this file.

Base Types and Definitions

bool8_t, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, float_t, double_t, (EAStdC package implements int128_t)
intptr_t, uintptr_t, intmax_t, uintmax_t, ssize_t
char8_t, char16_t, char32_t
INT8_C(), UINT8_C(), etc.
INT8_MIN, INT8_MAX, UINT8_MAX, etc.
PRId8, PRId16, PRId32, etc, SCNd8, SCNd16, SCNd32, etc.

Result Types and Definitions

EA::result_type
EA::SUCCESS, EA::FAILURE
EA_SUCCEEDED(), EA_FAILED()

Compiler Definitions

EA_COMPILER_GNUC
EA_COMPILER_SN
EA_COMPILER_MSVC
EA_COMPILER_METROWERKS
EA_COMPILER_INTEL
EA_COMPILER_BORLANDC

EA_COMPILER_VERSION = <integer>
EA_COMPILER_NAME = <string>
EA_COMPILER_STRING = <string>

EA_COMPILER_NO_STATIC_CONSTANTS
EA_COMPILER_NO_TEMPLATE_SPECIALIZATION
EA_COMPILER_NO_TEMPLATE_PARTIAL_SPECIALIZATION
EA_COMPILER_NO_MEMBER_TEMPLATES
EA_COMPILER_NO_MEMBER_TEMPLATE_SPECIALIZATION
EA_COMPILER_NO_TEMPLATE_TEMPLATES
EA_COMPILER_NO_MEMBER_TEMPLATE_FRIENDS
EA_COMPILER_NO_VOID_RETURNS
EA_COMPILER_NO_COVARIANT_RETURN_TYPE
EA_COMPILER_NO_DEDUCED_TYPENAME
EA_COMPILER_NO_ARGUMENT_DEPENDENT_LOOKUP
EA_COMPILER_NO_EXCEPTION_STD_NAMESPACE
EA_COMPILER_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
EA_COMPILER_NO_EXCEPTIONS
EA_COMPILER_NO_UNWIND

EA_COMPILER_IS_ANSIC
EA_COMPILER_IS_C99
EA_COMPILER_HAS_C99_TYPES
EA_COMPILER_IS_CPLUSPLUS
EA_COMPILER_MANAGED_CPP

Utilities

EA_ALIGN_OF()
EA_PREFIX_ALIGN()
EA_POSTFIX_ALIGN()
EA_ALIGNED()
EA_PACKED()
EA_LIKELY()
EA_UNLIKELY()
EA_ASSUME()
EA_PURE
EA_WCHAR_T_NON_NATIVE
EA_WCHAR_SIZE
EA_RESTRICT
EA_DEPRECATED
EA_PREFIX_DEPRECATED
EA_POSTFIX_DEPRECATED
EA_FORCE_INLINE
EA_NO_INLINE
EA_PREFIX_NO_INLINE
EA_POSTFIX_NO_INLINE
EA_PASCAL
EA_PASCAL_FUNC()
EA_SSE = [0 | 1]
EA_IMPORT
EA_EXPORT
EA_OVERRIDE
EA_INIT_PRIORITY
EA_MAY_ALIAS

Platform Definitions


EA_PLATFORM_MAC
EA_PLATFORM_OSX
EA_PLATFORM_IPHONE
EA_PLATFORM_ANDROID
EA_PLATFORM_LINUX
EA_PLATFORM_WINDOWS
EA_PLATFORM_WIN32
EA_PLATFORM_WIN64
EA_PLATFORM_HPUX
EA_PLATFORM_SUN

EA_PLATFORM_NAME
EA_PLATFORM_DESCRIPTION
EA_PROCESSOR_POWERPC, EA_PROCESSOR_X86, EA_PROCESSOR_ARM, etc.
EA_SYSTEM_LITTLE_ENDIAN, EA_SYSTEM_BIG_ENDIAN
EA_ASM_STYLE_ATT, EA_ASM_STYLE_INTEL, EA_ASM_STYLE_MOTOROLA
EA_PLATFORM_PTR_SIZE
EA_PLATFORM_WORD_SIZE