Sign in Join
Wiki copytemporary

Platform defines: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Useful tips before using platform defines
22
33- [Marco van de Voort: Development Tutorial (a.k.a Build FAQ)](https://www.stack.nl/~marcov/buildfaq.pdf) – general building guidelines
44- [Marco van de Voort: Creating a portable Pascal codebase.](https://www.stack.nl/~marcov/porting.pdf) – general porting guidelines
55- 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.
66
77## Architecture defines
88
99> **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.
1010
11-<table>
1211<thead>
13-<tr>
14-<th>define(s)</th>
15-<th>meaning</th>
16-</tr>
12+
1713</thead>
1814<tbody>
19-<tr>
20-<td colspan="2">General</td>
21-</tr>
22-<tr>
23-<td>ENDIAN_BIG</td>
24-<td>big endian</td>
25-</tr>
26-<tr>
27-<td>ENDIAN_LITTLE</td>
28-<td>little endian</td>
29-</tr>
30-<tr>
31-<td>CPU16</td>
32-<td>16 bit CPU</td>
33-</tr>
34-<tr>
35-<td>CPU32</td>
36-<td>32 bit CPU</td>
37-</tr>
38-<tr>
39-<td>CPU64</td>
40-<td>64 bit CPU</td>
41-</tr>
42-<tr>
43-<td colspan="2">Specific</td>
44-</tr>
45-<tr>
46-<td>CPU86</td>
47-<td>Intel 8086 and compatible (original PC)</td>
48-</tr>
49-<tr>
50-<td>CPU87</td>
51-<td>Intel 8086 and compatible (original PC)</td>
52-</tr>
53-<tr>
54-<td>CPU386, CPUi386</td>
55-<td>386 and compatible (32 bit PC)</td>
56-</tr>
57-<tr>
58-<td>CPUAMD64, CPUX86_64</td>
59-<td>AMD64 or Intel 64-bit processor</td>
60-</tr>
61-<tr>
62-<td>CPUIA64</td>
63-<td>Intel itanium 64-bit processor</td>
64-</tr>
65-<tr>
66-<td>CPU68</td>
67-<td>Motorola 680x0 or compatible CPU</td>
68-</tr>
69-<tr>
70-<td>CPU68K, CPUM68K</td>
71-<td>Motorola 680x0 or compatible CPU</td>
72-</tr>
73-<tr>
74-<td>CPUM68020</td>
75-<td>Motorola 68020 or compatible CPU</td>
76-</tr>
77-<tr>
78-<td>CPUPOWERPC</td>
79-<td>[[PPC Calling conventions|PowerPC processor]] (32 or 64 bit)</td>
80-</tr>
81-<tr>
82-<td>CPUPOWERPC32</td>
83-<td>PowerPC processor (32 bit)</td>
84-</tr>
85-<tr>
86-<td>CPUPOWERPC64</td>
87-<td>PowerPC processor (64 bit)</td>
88-</tr>
89-<tr>
90-<td>CPUSPARC, CPUSPARC32</td>
91-<td>SPARC v7 or compatible</td>
92-</tr>
93-<tr>
94-<td>CPUARM</td>
95-<td>ARM 32 bit processor</td>
96-</tr>
97-<tr>
98-<td>CPUAARCH64</td>
99-<td>ARM 64 bit processor</td>
100-</tr>
101-<tr>
102-<td>CPUAVR</td>
103-<td>AVR 8/16-bit processor</td>
104-</tr>
105-<tr>
106-<td colspan="2">FPU</td>
107-</tr>
108-<tr>
109-<td>FPUSOFT</td>
110-<td>Software emulation of FPU (all types)</td>
111-</tr>
112-<tr>
113-<td>FPUSSE64</td>
114-<td>SSE64 FPU on Intel I386 and higher, AMD64.</td>
115-</tr>
116-<tr>
117-<td>FPUSSE</td>
118-<td>SSE instructions on Intel I386 and higher.</td>
119-</tr>
120-<tr>
121-<td>FPUSSE2</td>
122-<td>SSE 2 instructions on Intel I386 and higher.</td>
123-</tr>
124-<tr>
125-<td>FPUSSE3</td>
126-<td>SSE 3 instructions on Intel I386 and higher, AMD64.</td>
127-</tr>
128-<tr>
129-<td>FPULIBGCC</td>
130-<td>GCC library FPU emulation on ARM and M68K.</td>
131-</tr>
132-<tr>
133-<td>FPU68881</td>
134-<td>68881 on M68K.</td>
135-</tr>
136-<tr>
137-<td>FPUFPA</td>
138-<td>FPA on ARM.</td>
139-</tr>
140-<tr>
141-<td>FPUFPA10</td>
142-<td>FPA 10 on ARM.</td>
143-</tr>
144-<tr>
145-<td>FPUFPA11</td>
146-<td>FPA 11 on ARM.</td>
147-</tr>
148-<tr>
149-<td>FPUVFP</td>
150-<td>VFP on ARM.</td>
151-</tr>
152-<tr>
153-<td>FPUX87</td>
154-<td>X87 FPU on Intel I386 and higher.</td>
155-</tr>
156-<tr>
157-<td>FPUITANIUM</td>
158-<td>On Intel Itanium.</td>
159-</tr>
160-<tr>
161-<td>FPUSTANDARD</td>
162-<td>On PowerPC (32/64 bit).</td>
163-</tr>
164-<tr>
165-<td>FPUHARD</td>
166-<td>On Sparc.</td>
167-</tr>
168-<tr>
169-<td></td>
170-<td></td>
171-</tr>
15+
17216</tbody>
173-</table>
17417
17518## Operating system defines
17619
17720In 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".
17821
17922- `ATARI`
18023- `DPMI`: MS-DOS
18124 - `GO32V2`
18225 - `WATCOM`
18326- `EMACS`
18427- `embedded`
18528- `HASAMIGA`
18629 - `AMIGA`
18730 - `AMIGA68K`
18831 - `AMIGAOS4`
18932 - `AROS`
19033 - `MorphOS`
19134- `GBA`: GameBoy Advance
19235- `Java`
19336- `MACOS`: Classic Macintosh (System 7 etc.)
19437- `MSDOS` MS-DOS 16-bit real mode (defined since FPC version 2.7.1)
19538- `NATIVENT`: [[Target NativeNT|NativeNT]]
19639- `NDS`: Nintendo DS
19740- `NETWARE`: NetWare
19841 - `NETWARE_CLIB`: NetWare with classic libc
19942 - `NETWLIBC`, `NETWARE_LIBC`: NetWare with modern libc
20043- `OS2`: OS/2
20144 - `EMX`: emx
20245- `PALMOS`: PalmOS and Garnet OS
20346- `Symbian`: Symbian OS
20447- `UNIX`
20548 - `AIX`
20649 - `ANDROID`
20750 - `BEOS`
20851 - `HAIKU`
20952 - `BSD`
21053 - `DARWIN`: [[Portal:Mac|macOS]] and [[Portal:iOS|iOS]]
21154 - `iPhoneSim`
21255 - `DragonFly`: DragonFlyBSD
21356 - `FREEBSD`: FreeBSD
21457 - `NETBSD`: NetBSD
21558 - `OPENBSD`: OpenBSD
21659 - `LINUX`
21760 - `SUNOS`
21861 - `SOLARIS`
21962 - `QNX`
22063- `WDOSX`
22164- `Wii`
22265- `WINDOWS`: all [[Portal:Windows|Windows]]
22366 - `MSWINDOWS`
22467 - `WIN16`: 16-bit Windows 3.x
22568 - `WIN32`: 32-bit Windows
22669 - `WIN64`: 64-bit Windows
22770 - `WINCE`, `UNDER_CE`, `UNICODE`: Windows CE, Windows mobile
22871
22972## Notes
23073
23174`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”]].
23275
23376## See also
23477
23578- [Delphi Wikia article “FreePascal detection and versioning”](https://delphi.wikia.com/wiki/FreePascal_detection_and_versioning)
23679- [Free Pascal Documentation: Appendix G: Compiler defines during compilation](https://www.freepascal.org/docs-html/prog/progap7.html)
23780
23881---
23982*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).*
24083Category: Directives

Back to history