Platform defines: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | ## Useful tips before using platform defines | |
| 2 | 2 | ||
| 3 | 3 | - [Marco van de Voort: Development Tutorial (a.k.a Build FAQ)](https://www.stack.nl/~marcov/buildfaq.pdf) – general building guidelines | |
| 4 | 4 | - [Marco van de Voort: Creating a portable Pascal codebase.](https://www.stack.nl/~marcov/porting.pdf) – general porting guidelines | |
| 5 | 5 | - if you need to cast a [[Pointer|pointer]] to an integer for arithmetic or you want to provide a spare field (like [`tag`](https://www.freepascal.org/docs-html/rtl/classes/tcomponent.tag.html) in [`TComponent`](https://www.freepascal.org/docs-html/rtl/classes/tcomponent.html)) that may be used to store a pointer, use [`PtrInt`](https://www.freepascal.org/docs-html/rtl/system/ptrint.html) as signed type, or better [`PtrUInt`](https://www.freepascal.org/docs-html/rtl/system/ptruint.html) as unsigned type. | |
| 6 | 6 | ||
| 7 | 7 | ## Architecture defines | |
| 8 | 8 | ||
| 9 | 9 | > **Note:** This is a copy of the official [FPC documentation](http://www.freepascal.org/docs-html/prog/progap7.html#x333-348000G) which is the authorative version for the stable FPC version. | |
| 10 | 10 | ||
| 11 | - | ||
| 12 | - | ||
| 13 | - | ||
| 14 | - | ||
| 15 | - | ||
| 16 | - | ||
| 11 | + | | define(s) | meaning | | |
| 12 | + | |---|---| | |
| 13 | + | | General | | | |
| 14 | + | | ENDIAN_BIG | big endian | | |
| 15 | + | | ENDIAN_LITTLE | little endian | | |
| 16 | + | | CPU16 | 16 bit CPU | | |
| 17 | + | | CPU32 | 32 bit CPU | | |
| 18 | + | | CPU64 | 64 bit CPU | | |
| 19 | + | | Specific | | | |
| 20 | + | | CPU86 | Intel 8086 and compatible (original PC) | | |
| 21 | + | | CPU87 | Intel 8086 and compatible (original PC) | | |
| 22 | + | | CPU386, CPUi386 | 386 and compatible (32 bit PC) | | |
| 23 | + | | CPUAMD64, CPUX86_64 | AMD64 or Intel 64-bit processor | | |
| 24 | + | | CPUIA64 | Intel itanium 64-bit processor | | |
| 25 | + | | CPU68 | Motorola 680x0 or compatible CPU | | |
| 26 | + | | CPU68K, CPUM68K | Motorola 680x0 or compatible CPU | | |
| 27 | + | | CPUM68020 | Motorola 68020 or compatible CPU | | |
| 28 | + | | CPUPOWERPC | [[PPC Calling conventions\|PowerPC processor]] (32 or 64 bit) | | |
| 29 | + | | CPUPOWERPC32 | PowerPC processor (32 bit) | | |
| 30 | + | | CPUPOWERPC64 | PowerPC processor (64 bit) | | |
| 31 | + | | CPUSPARC, CPUSPARC32 | SPARC v7 or compatible | | |
| 32 | + | | CPUARM | ARM 32 bit processor | | |
| 33 | + | | CPUAARCH64 | ARM 64 bit processor | | |
| 34 | + | | CPUAVR | AVR 8/16-bit processor | | |
| 35 | + | | FPU | | | |
| 36 | + | | FPUSOFT | Software emulation of FPU (all types) | | |
| 37 | + | | FPUSSE64 | SSE64 FPU on Intel I386 and higher, AMD64. | | |
| 38 | + | | FPUSSE | SSE instructions on Intel I386 and higher. | | |
| 39 | + | | FPUSSE2 | SSE 2 instructions on Intel I386 and higher. | | |
| 40 | + | | FPUSSE3 | SSE 3 instructions on Intel I386 and higher, AMD64. | | |
| 41 | + | | FPULIBGCC | GCC library FPU emulation on ARM and M68K. | | |
| 42 | + | | FPU68881 | 68881 on M68K. | | |
| 43 | + | | FPUFPA | FPA on ARM. | | |
| 44 | + | | FPUFPA10 | FPA 10 on ARM. | | |
| 45 | + | | FPUFPA11 | FPA 11 on ARM. | | |
| 46 | + | | FPUVFP | VFP on ARM. | | |
| 47 | + | | FPUX87 | X87 FPU on Intel I386 and higher. | | |
| 48 | + | | FPUITANIUM | On Intel Itanium. | | |
| 49 | + | | FPUSTANDARD | On PowerPC (32/64 bit). | | |
| 50 | + | | FPUHARD | On Sparc. | | |
| 17 | 51 | ||
| 18 | 52 | ## Operating system defines | |
| 19 | 53 | ||
| 20 | 54 | In the following tree, you have to follow leaves to their respective roots, in order to determine all defines. To check this information, refer to files in FPC sources: "compiler/systems/i_*.pas". | |
| 21 | 55 | ||
| 22 | 56 | - `ATARI` | |
| 23 | 57 | - `DPMI`: MS-DOS | |
| 24 | 58 | - `GO32V2` | |
| 25 | 59 | - `WATCOM` | |
| 26 | 60 | - `EMACS` | |
| 27 | 61 | - `embedded` | |
| 28 | 62 | - `HASAMIGA` | |
| 29 | 63 | - `AMIGA` | |
| 30 | 64 | - `AMIGA68K` | |
| 31 | 65 | - `AMIGAOS4` | |
| 32 | 66 | - `AROS` | |
| 33 | 67 | - `MorphOS` | |
| 34 | 68 | - `GBA`: GameBoy Advance | |
| 35 | 69 | - `Java` | |
| 36 | 70 | - `MACOS`: Classic Macintosh (System 7 etc.) | |
| 37 | 71 | - `MSDOS` MS-DOS 16-bit real mode (defined since FPC version 2.7.1) | |
| 38 | 72 | - `NATIVENT`: [[Target NativeNT|NativeNT]] | |
| 39 | 73 | - `NDS`: Nintendo DS | |
| 40 | 74 | - `NETWARE`: NetWare | |
| 41 | 75 | - `NETWARE_CLIB`: NetWare with classic libc | |
| 42 | 76 | - `NETWLIBC`, `NETWARE_LIBC`: NetWare with modern libc | |
| 43 | 77 | - `OS2`: OS/2 | |
| 44 | 78 | - `EMX`: emx | |
| 45 | 79 | - `PALMOS`: PalmOS and Garnet OS | |
| 46 | 80 | - `Symbian`: Symbian OS | |
| 47 | 81 | - `UNIX` | |
| 48 | 82 | - `AIX` | |
| 49 | 83 | - `ANDROID` | |
| 50 | 84 | - `BEOS` | |
| 51 | 85 | - `HAIKU` | |
| 52 | 86 | - `BSD` | |
| 53 | 87 | - `DARWIN`: [[Portal:Mac|macOS]] and [[Portal:iOS|iOS]] | |
| 54 | 88 | - `iPhoneSim` | |
| 55 | 89 | - `DragonFly`: DragonFlyBSD | |
| 56 | 90 | - `FREEBSD`: FreeBSD | |
| 57 | 91 | - `NETBSD`: NetBSD | |
| 58 | 92 | - `OPENBSD`: OpenBSD | |
| 59 | 93 | - `LINUX` | |
| 60 | 94 | - `SUNOS` | |
| 61 | 95 | - `SOLARIS` | |
| 62 | 96 | - `QNX` | |
| 63 | 97 | - `WDOSX` | |
| 64 | 98 | - `Wii` | |
| 65 | 99 | - `WINDOWS`: all [[Portal:Windows|Windows]] | |
| 66 | 100 | - `MSWINDOWS` | |
| 67 | 101 | - `WIN16`: 16-bit Windows 3.x | |
| 68 | 102 | - `WIN32`: 32-bit Windows | |
| 69 | 103 | - `WIN64`: 64-bit Windows | |
| 70 | 104 | - `WINCE`, `UNDER_CE`, `UNICODE`: Windows CE, Windows mobile | |
| 71 | 105 | ||
| 72 | 106 | ## Notes | |
| 73 | 107 | ||
| 74 | 108 | `UNICODE` was defined till FPC 3.0.0, see [[User Changes 3.0|User changes 3.0 § “define UNICODE was changed to FPC_OS_UNICODE”]]. | |
| 75 | 109 | ||
| 76 | 110 | ## See also | |
| 77 | 111 | ||
| 78 | 112 | - [Delphi Wikia article “FreePascal detection and versioning”](https://delphi.wikia.com/wiki/FreePascal_detection_and_versioning) | |
| 79 | 113 | - [Free Pascal Documentation: Appendix G: Compiler defines during compilation](https://www.freepascal.org/docs-html/prog/progap7.html) | |
| 80 | 114 | ||
| 81 | 115 | --- | |
| 82 | 116 | *From the Free Pascal wiki, page "Platform defines", as it stood on 2021-04-01 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 83 | 117 | Category: Directives |
