Determines the build environment. More...
Defines | |
| #define | BURGER_API |
| Default parameter passing type for Burgerlib functions. | |
| #define | BURGER_ANSIAPI |
| Default parameter passing type for ANSI library functions. | |
| #define | BURGER_MAXINT 0x7FFFFFFF |
| Maximum value of a signed integer. | |
| #define | BURGER_ASM asm |
| "C" compiler keyword for inline assembly. | |
| #define | BURGER_DECLSPECNAKED __declspec(naked) |
| "C" compiler keyword for a pure assembly function. | |
| #define | BURGER_INLINE inline |
| Define to create inline code in ANSI C source files. | |
| #define | BURGER_ALIGN(x, s) (x) |
| Macro to force data alignment. | |
| #define | BURGER_PREALIGN(s) |
| First half of a macro to force data alignment. | |
| #define | BURGER_POSTALIGN(s) |
| Second half of a macro to force data alignment. | |
| #define | BURGER_BIGENDIAN |
| Define to flag code running on a big endian machine. | |
| #define | NULL 0 |
| Define of the number 0 for pointer invalidation. | |
| #define | TRUE 1 |
| Define of the number 1 for boolean operations. | |
| #define | FALSE 0 |
| Define of the number 0 for boolean operations. | |
| #define | _DEBUG |
| #define | NDEBUG |
| #define | BURGER_INTEL |
| Define to determine if code is being built for Intel processors. | |
| #define | BURGER_AMD64 |
| Define to determine if code is being built for AMD64 compatible processors. | |
| #define | BURGER_MIPS |
| Define to determine if code is being built for MIPS processors. | |
| #define | BURGER_POWERPC |
| Define to determine if code is being built for PowerPC processors. | |
| #define | BURGER_68K |
| Define to determine if code is being built for Motorola 680x0 processors. | |
| #define | BURGER_ARM |
| Define to determine if code is being built for Advanced RISC Machine processors. | |
| #define | BURGER_64BITCPU |
| Define to determine if the CPU has 64 bit integer registers. | |
| #define | BURGER_LITTLEENDIAN |
| Define to flag code running on a little endian machine. | |
| #define | BURGER_WIN32 |
| Define to determine if code is being built for Microsoft 32 bit Windows. | |
| #define | BURGER_WIN64 |
| Define to determine if code is being built for Microsoft 64 bit Windows. | |
| #define | BURGER_WINDOWS |
| Define to determine if code is being built for Microsoft 32 or 64 bit Windows. | |
| #define | BURGER_MSDOS |
| Define to determine if code is being built for Microsoft MS-DOS. | |
| #define | BURGER_MAC |
| Define to determine if code is being built for Apple Mac OS 8.6 through 9.2. | |
| #define | BURGER_MACOSX |
| Define to determine if code is being built exclusively for Apple Mac OS X. | |
| #define | BURGER_MACCARBON |
| Define to determine if code is being built for both Apple Mac OS9 and MacOS X. | |
| #define | BURGER_MACCLASSIC |
| Define to determine if code is being built exclusively for Apple Mac OS9. | |
| #define | BURGER_MACOS |
| Define to determine if code is being built for any Apple Mac OS platform. | |
| #define | BURGER_IPOD |
| Define to determine if code is being built for the Apple iPod. | |
| #define | BURGER_IPHONE |
| Define to determine if code is being built for the Apple iPhone. | |
| #define | BURGER_NGAGE |
| Define to determine if code is being built for the Nokia Ngage. | |
| #define | BURGER_SYMBIAN |
| Define to determine if code is being built for the Symbian OS. | |
| #define | BURGER_PS1 |
| Define to determine if code is being built for the Sony Playstation. | |
| #define | BURGER_PS2 |
| Define to determine if code is being built for the Emotion Engine CPU for a PS2. | |
| #define | BURGER_PS3 |
| Define to determine if code is being built for the PS3. | |
| #define | BURGER_PSP |
| Define to determine if code is being built for the Sony PSP. | |
| #define | BURGER_GAMECUBE |
| Define to determine if code is being built for the Nintendo GameCube. | |
| #define | BURGER_WII |
| Define to determine if code is being built for the Nintendo Wii. | |
| #define | BURGER_GBA |
| Define to determine if code is being built for the Nintendo Gameboy Advanced. | |
| #define | BURGER_DS |
| Define to determine if code is being built for the Nintendo DS. | |
| #define | BURGER_XBOX |
| Define to determine if code is being built for the Microsoft XBox. | |
| #define | BURGER_XBOX360 |
| Define to determine if code is being built for the Microsoft XBox 360. | |
| #define | BURGER_BEOS |
| Define to determine if code is being built for Be OS. | |
| #define | BURGER_FASTCALLENABLED |
| Flag for determining Intel assembly generation. | |
| #define | BURGER_STRUCT_ALIGN |
| Defined if the compiler uses Macintosh style data alignment commands. | |
| #define | BURGER_STRUCT_PACK |
| Defined if the compiler uses GNU style data alignment commands. | |
| #define | BURGER_STRUCT_PACKPUSH |
| Defined if the compiler uses Microsoft style data alignment commands. | |
| #define | BURGER_CFM |
| Define to determine if Mac OS 9 code is being built in Code Fragment Manger format. | |
| #define | __X32__ |
| Define to determine if MS-DOS code is being built with the X32 DOS extender. | |
| #define | __DOS4G__ |
| Define to determine if MS-DOS code is being built with the DOS4G DOS extender. | |
| #define | TARGET_API_MAC_CARBON 1 |
| Define to determine if Mac OS 9 code is being built with the Carbon libraries. | |
Typedefs | |
| typedef signed char | Int8 |
| 8 bit signed integer. | |
| typedef unsigned char | Word8 |
| 8 bit unsigned integer. | |
| typedef signed short | Int16 |
| 16 bit signed integer. | |
| typedef unsigned short | Word16 |
| 16bit unsigned integer. | |
| typedef signed long | Int32 |
| 32 bit signed integer. | |
| typedef unsigned long | Word32 |
| 32 bit unsigned integer. | |
| typedef signed BURGER_LONGW64 | Int64 |
| 64 bit signed integer. | |
| typedef unsigned BURGER_LONGW64 | Word64 |
| 64 bit unsigned integer. | |
| typedef float | BVector128 [4] |
| 128 bit vector intrinsic. | |
| typedef Word32 | WordPtr |
| Unsigned integer that matches in size to a void *. | |
| typedef Word8 | Bool |
| Unsigned 8 bit integer for boolean operations. | |
| typedef Int32 | Frac32 |
| Signed 32 bit integer for fixed point operations. | |
| typedef Int32 | Fixed32 |
| Signed 32 bit integer for fixed point operations. | |
| typedef unsigned int | Word |
| Unsigned integer. | |
| typedef signed int | Int |
| Signed integer. | |
Determines the build environment.
This header contains the base types used in all of Burgerlib. It will also try to determine via compiler defines exactly what features are supported in the compiler and what target OS you're building for.
| #define __DOS4G__ |
Define to determine if MS-DOS code is being built with the DOS4G DOS extender.
If this define exists, then you are creating code that runs under classic MS-DOS with the DOS4G DOS extender.
This define is declared by the project, not by Burgerlib. Either __DOS4G__ or __X32__ must be present.
| #define __X32__ |
Define to determine if MS-DOS code is being built with the X32 DOS extender.
If this define exists, then you are creating code that runs under classic MS-DOS with the X32 DOS extender.
This define is declared by the project, not by Burgerlib. Either __X32__ or __DOS4G__ must be present.
| #define _DEBUG |
| #define BURGER_64BITCPU |
Define to determine if the CPU has 64 bit integer registers.
On BURGER_AMD64, BURGER_PS3 and BURGER_XBOX360 platforms, the cpu has integer registers that are 64-bits wide. Using this define, code can be written that takes advantage of this. Mostly useful with Fixed32 and other high precision fixed point calculations.
| #define BURGER_68K |
Define to determine if code is being built for Motorola 680x0 processors.
If this define exists, then you are creating code that runs on the Motorola 680x0 line of processors. The classic Macintosh and certain PDAs will have this define present.
| #define BURGER_ALIGN | ( | x, | ||
| s | ||||
| ) | (x) |
Macro to force data alignment.
Some data needs to be aligned differently than native alignment. Use this macro to have a compiler agnostic way to ensure data is aligned in a method that is desired by the programmer.
extern int BURGER_ALIGN(foo,8); CoolClass BURGER_ALIGN(MyClass,1); int BURGER_ALIGN(DataArray[4],8) = {1,2,3,4};
| #define BURGER_AMD64 |
Define to determine if code is being built for AMD64 compatible processors.
If this define exists, then you are creating code that runs on the AMD 64 and other compatible processors. The Microsoft Win64 and Mac OSX 64 platforms which are running on Pentium and AMD CPUs in 64 bit mode will have this define present.
| #define BURGER_ANSIAPI |
Default parameter passing type for ANSI library functions.
On Intel platforms, there are several methods of passing parameters. ANSI uses the __cdecl keyword, so any ANSI function like qsort() or atexit() that needs a callback function should have this keyword before the user supplied callback. It will ensure that the linkage will be correct. This will evaluate to nothing on non-intel platforms.
static int BURGER_ANSIAPI Compare(const void *a,const void *b) { return strcmp((char *)a,(char *)b); } void SortData(void) { qsort(array,arraycount,sizeof(array[0]),Compare); }
| #define BURGER_API |
Default parameter passing type for Burgerlib functions.
On Intel platforms, there are several methods of passing parameters. Burgerlib uses the __fastcall method and this define will evaluate to __fastcall on compilers that support it. Otherwise, this will evaluate to nothing on non-intel platforms.
For non Intel platforms, this resolves into a blank #define.
| #define BURGER_ARM |
Define to determine if code is being built for Advanced RISC Machine processors.
If this define exists, then you are creating code that runs on the Advanced RISC Machines line of processors. The Gameboy Advanced, Nintendo DS, Nokia NGage, Apple iPod and certain cell phones will have this define present.
| #define BURGER_ASM asm |
"C" compiler keyword for inline assembly.
No one could agree on what would the keyword be to start a block of inline assembly. This will map to asm or _asm depending on the compiler.
It's preferred that this keyword is used for Intel assembly.
| #define BURGER_BEOS |
Define to determine if code is being built for Be OS.
If this define exists, then you are creating code that runs on Be OS for Intel or PowerPC.
| #define BURGER_BIGENDIAN |
Define to flag code running on a big endian machine.
This define or BURGER_LITTLEENDIAN will be present to allow the programmer to create code that can properly parse endian specific data. Only one macro will be defined.
If this macro is present, the machine the code is being built for is big endian.
| #define BURGER_CFM |
Define to determine if Mac OS 9 code is being built in Code Fragment Manger format.
If this define exists, then you are creating code in which the final binary is in PEF format for use with the Code Fragment Manager. All Power PC code for Classic or Carbon is in this format and 68k also can be compiled this way.
| #define BURGER_DECLSPECNAKED __declspec(naked) |
"C" compiler keyword for a pure assembly function.
No one could agree on what would the keyword be to declare a "C" function that is 100% assembly. This will map to asm or __declspec(naked) depending on the compiler.
It's preferred that this keyword is used for Intel assembly only.
BURGER_DECLSPECNAKED Word32 BURGER_API SwapEndian(Word32 Val) { BURGER_ASM { mov eax,ecx bswap eax ret } }
| #define BURGER_DS |
Define to determine if code is being built for the Nintendo DS.
If this define exists, then you are creating code that runs on the Nintendo DS.
| #define BURGER_FASTCALLENABLED |
Flag for determining Intel assembly generation.
This flag is defined only if the target platform is intel and the parameter passing is in the "__fastcall" format.
Some targets require parameters to be passed in the __cdecl format, so this will allow the selection of the proper assembly header and footer without having to create complicated #ifdefs
| #define BURGER_GAMECUBE |
Define to determine if code is being built for the Nintendo GameCube.
If this define exists, then you are creating code that runs on the Gekko processor for a Nintendo GameCube.
| #define BURGER_GBA |
Define to determine if code is being built for the Nintendo Gameboy Advanced.
If this define exists, then you are creating code that runs on the Nintendo Gameboy Advanced.
| #define BURGER_INLINE inline |
Define to create inline code in ANSI C source files.
Since pre-C++ compilers created different keywords to force inlining of a function, this define standardizes the keyword. Normally, it will evaluate to inline, but it can become __inline or __forceinline or some other token that is compiler specific.
In all cases, the behavior of the C++ inline keyword is what is expected.
| #define BURGER_INTEL |
Define to determine if code is being built for Intel processors.
If this define exists, then you are creating code that runs on the Intel, AMD and other compatible processors. The Microsoft XBox, Mac OSX Intel and Win32 platforms which are running on Pentium, 386, 486, and AMD CPUs will have this define present.
| #define BURGER_IPHONE |
Define to determine if code is being built for the Apple iPhone.
If this define exists, then you are creating code that runs on the Apple iPhone.
| #define BURGER_IPOD |
Define to determine if code is being built for the Apple iPod.
If this define exists, then you are creating code that runs on the Apple iPod.
| #define BURGER_LITTLEENDIAN |
Define to flag code running on a little endian machine.
This define or BURGER_BIGENDIAN will be present to allow the programmer to create code that can properly parse endian specific data. Only one macro will be defined.
If this macro is present, the machine the code is being built for is little endian.
| #define BURGER_MAC |
Define to determine if code is being built for Apple Mac OS 8.6 through 9.2.
If this define exists, then you are creating code that runs under Apple MacOS version 8.6 through 9.2. Since MacOS runs on the 680x0 or the PowerPC architectures, you may need to check BURGER_68K or BURGER_POWERPC for any CPU specific code or features. Also, on 680x0 platforms, you may be compiling under the Code Fragment Manager format, and to detect that, check for the presence of BURGER_CFM.
// Include this define in your CodeWarrior C/C++ Preprocessor preferences settings // to build for MacOS 9 Carbon. #define TARGET_API_MAC_CARBON 1
| #define BURGER_MACCARBON |
Define to determine if code is being built for both Apple Mac OS9 and MacOS X.
If this define exists, then you are creating code that runs under Apple MacOS 9 and for Apple MacOS X. Only the PowerPC is supported. Since MacOS Carbon support is enabled, accessing the low memory operating system variables is NOT allowed.
| #define BURGER_MACCLASSIC |
Define to determine if code is being built exclusively for Apple Mac OS9.
If this define exists, then you are creating code that runs under Apple MacOS 9 for either PowerPC or 68K. There is no support for MacOS X operating systems under this build target. The CPU can be either BURGER_POWERPC or BURGER_68K for this platform, so no CPU specific code should be written without checking for the CPU type. Since no MacOS Carbon support is enabled, accessing the low memory operating system variables is allowed.
| #define BURGER_MACOS |
Define to determine if code is being built for any Apple Mac OS platform.
If this define exists, then you are creating code that runs under Apple MacOS. Currently, 68K, PowerPC and Intel are supported. Since it's not known which version of MacOS is currently being targeted, accessing the low memory operating system variables is NOT allowed.
| #define BURGER_MACOSX |
Define to determine if code is being built exclusively for Apple Mac OS X.
If this define exists, then you are creating code that runs under Apple MacOS X using Mach-O. There is no support for pre-MacOS X operating systems under this build target. The CPU can be either BURGER_POWERPC or BURGER_INTEL for this platform, so no CPU specific code should be written without checking for the CPU type.
| #define BURGER_MAXINT 0x7FFFFFFF |
Maximum value of a signed integer.
This is a replacement for the ANSI macro MAX_INT. Normally, this is 0x7FFFFFFF, but it could be a 64 or 128 value on future processors.
| #define BURGER_MIPS |
Define to determine if code is being built for MIPS processors.
If this define exists, then you are creating code that runs on the MIPS line of processors. R5900 (PS2), R3300 (PS1) and R4400 (PSP) all will have this define present.
| #define BURGER_MSDOS |
Define to determine if code is being built for Microsoft MS-DOS.
If this define exists, then you are creating code that runs under classic MS-DOS.
Check for the define __X32__ or __DOS4G__ if you wish to determine which dos extender you are using.
| #define BURGER_NGAGE |
Define to determine if code is being built for the Nokia Ngage.
If this define exists, then you are creating code that runs on the Nokia NGage.
| #define BURGER_POSTALIGN | ( | s | ) |
Second half of a macro to force data alignment.
Some data needs to be aligned differently than native alignment. However, it's sometimes impractical to use the BURGER_ALIGN macro so this macro and its compliment are used to align complex objects like classes and structures. Use the code example below for proper use.
BURGER_PREALIGN(32) class foo { public: foo(); int m_Data; // This class is 32 byte aligned } BURGER_POSTALIGN(32);
| #define BURGER_POWERPC |
Define to determine if code is being built for PowerPC processors.
If this define exists, then you are creating code that runs on the PowerPC line of processors. The Nintendo GameCube, Power Macintosh, Nintendo Wii, Sony Playstation 3 and Microsoft XBox 360 all will have this define present.
| #define BURGER_PREALIGN | ( | s | ) |
First half of a macro to force data alignment.
Some data needs to be aligned differently than native alignment. However, it's sometimes impractical to use the BURGER_ALIGN macro so this macro and its compliment are used to align complex objects like classes and structures. Use the code example below for proper use.
BURGER_PREALIGN(32) class foo { public: foo(); int m_Data; // This class is 32 byte aligned } BURGER_POSTALIGN(32);
| #define BURGER_PS1 |
Define to determine if code is being built for the Sony Playstation.
If this define exists, then you are creating code that runs on the Sony Playstation.
| #define BURGER_PS2 |
Define to determine if code is being built for the Emotion Engine CPU for a PS2.
If this define exists, then you are creating code that runs on the main processor for a Sony Playstation 2.
| #define BURGER_PS3 |
Define to determine if code is being built for the PS3.
If this define exists, then you are creating code that runs on the main processor for a Sony Playstation 3.
| #define BURGER_PSP |
Define to determine if code is being built for the Sony PSP.
If this define exists, then you are creating code that runs on the Sony Playstation Portable (PSP).
| #define BURGER_STRUCT_ALIGN |
Defined if the compiler uses Macintosh style data alignment commands.
Compilers can be set to change the default alignment of data structures. If alignment for a specific header needs to be set, you will need to insert this code as a prefix and a postfix to make sure that the compiler settings are overridden.
This is useful for data structures that are mapped to the contents of a loaded file.
// Prefix for 4 byte alignment #if defined(BURGER_STRUCT_ALIGN) #pragma options align=power #elif defined(BURGER_STRUCT_PACKPUSH) #pragma pack(push,4) #elif defined(BURGER_STRUCT_PACK) #pragma pack(4) #endif // Postfix to restore compiler setting alignment #if defined(BURGER_STRUCT_ALIGN) #pragma options align=reset #elif defined(BURGER_STRUCT_PACKPUSH) #pragma pack(pop) #elif defined(BURGER_STRUCT_PACK) #pragma pack() #endif
| #define BURGER_STRUCT_PACK |
Defined if the compiler uses GNU style data alignment commands.
Compilers can be set to change the default alignment of data structures. If alignment for a specific header needs to be set, you will need to insert this code as a prefix and a postfix to make sure that the compiler settings are overridden.
This is useful for data structures that are mapped to the contents of a loaded file.
// Prefix for 4 byte alignment #if defined(BURGER_STRUCT_ALIGN) #pragma options align=power #elif defined(BURGER_STRUCT_PACKPUSH) #pragma pack(push,4) #elif defined(BURGER_STRUCT_PACK) #pragma pack(4) #endif // Postfix to restore compiler setting alignment #if defined(BURGER_STRUCT_ALIGN) #pragma options align=reset #elif defined(BURGER_STRUCT_PACKPUSH) #pragma pack(pop) #elif defined(BURGER_STRUCT_PACK) #pragma pack() #endif
| #define BURGER_STRUCT_PACKPUSH |
Defined if the compiler uses Microsoft style data alignment commands.
Compilers can be set to change the default alignment of data structures. If alignment for a specific header needs to be set, you will need to insert this code as a prefix and a postfix to make sure that the compiler settings are overridden.
This is useful for data structures that are mapped to the contents of a loaded file.
// Prefix for 4 byte alignment #if defined(BURGER_STRUCT_ALIGN) #pragma options align=power #elif defined(BURGER_STRUCT_PACKPUSH) #pragma pack(push,4) #elif defined(BURGER_STRUCT_PACK) #pragma pack(4) #endif // Postfix to restore compiler setting alignment #if defined(BURGER_STRUCT_ALIGN) #pragma options align=reset #elif defined(BURGER_STRUCT_PACKPUSH) #pragma pack(pop) #elif defined(BURGER_STRUCT_PACK) #pragma pack() #endif
| #define BURGER_SYMBIAN |
Define to determine if code is being built for the Symbian OS.
If this define exists, then you are creating code that runs under the Symbian OS, usually Nokia brand cell phones and PDAs.
| #define BURGER_WII |
Define to determine if code is being built for the Nintendo Wii.
If this define exists, then you are creating code that runs on the Broadway processor for a Nintendo Wii.
| #define BURGER_WIN32 |
Define to determine if code is being built for Microsoft 32 bit Windows.
If this define exists, then you are creating code that runs on Microsoft Windows for 32 bit CPUs.
| #define BURGER_WIN64 |
Define to determine if code is being built for Microsoft 64 bit Windows.
If this define exists, then you are creating code that runs on Microsoft Windows for 64 bit CPUs.
| #define BURGER_WINDOWS |
Define to determine if code is being built for Microsoft 32 or 64 bit Windows.
If this define exists, then you are creating code that runs on Microsoft Windows for either 32 or 64 bit CPUs.
| #define BURGER_XBOX |
Define to determine if code is being built for the Microsoft XBox.
If this define exists, then you are creating code that runs on the Intel Celeron for a Microsoft XBox.
| #define BURGER_XBOX360 |
Define to determine if code is being built for the Microsoft XBox 360.
If this define exists, then you are creating code that runs on the Microsoft XBox360.
| #define FALSE 0 |
| #define NDEBUG |
| #define NULL 0 |
| #define TARGET_API_MAC_CARBON 1 |
Define to determine if Mac OS 9 code is being built with the Carbon libraries.
If this define exists, then you are creating code that runs under classic Mac OS with the Carbon libaries.
This define is declared by the project, not by Burgerlib. If this define is missing, the code will default to classic MacOS 8.6 - 9.2.
| #define TRUE 1 |
128 bit vector intrinsic.
This integer is used for register remapping to the vector units on several CPUs. It is not to be used for 128 bit integer math. Currently, only processors with vector units like the Playstation 2, Xbox 360, PS3, Pentium with SSE and PowerPC with Alti-Vec can use this intrinsic data type.
Signed 32 bit integer for fixed point operations.
All 16.16 fixed point integer math uses this data type to alert the programmer of the special nature of the 32 bits. The upper 16 bits is an integer of the range of -32768 through 32767 and the lower 16 bits is a fraction of x/65536.
Signed 32 bit integer for fixed point operations.
All 2.30 fixed point integer math uses this data type to alert the programmer of the special nature of the 32 bits. The upper 2 bits is an integer of the range of -2 through 1 and the lower 30 bits is a fraction of x/1,073,741,824.
Signed integer.
This is the second most common data type in BurgerLib. On most platforms, this is an signed 32 bit integer but it can be 64 bit if the processor handles 64 bit data more efficently than 32 bit. To date, all CPUs handle 32 bit data with no penalty so it's locked at 32 bits.
16 bit signed integer.
This integer can contain the number -32768 through 32767. It is compiler switch setting safe.
64 bit signed integer.
This integer can contain the number -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807. It is compiler switch setting safe.
8 bit signed integer.
This integer can contain the number -128 through 127. It is compiler switch setting safe.
Unsigned integer.
This is the most common data type in BurgerLib. On most platforms, this is an unsigned 32 bit integer but it can be 64 bit if the processor handles 64 bit data more efficently than 32 bit. To date, all CPUs handle 32 bit data with no penalty so it's locked at 32 bits.
16bit unsigned integer.
This integer can contain the number 0 through 65535. It is compiler switch setting safe.
64 bit unsigned integer.
This integer can contain the number 0 through 9,223,372,036,854,775,807 * 2 + 1. It is compiler switch setting safe.
8 bit unsigned integer.
This integer can contain the number 0 through 255. It is compiler switch setting safe.
Unsigned integer that matches in size to a void *.
Since address pointers can be 64 bit on some platforms, this type allows the casting and storing of this type into an unsigned integer,
1.7.1