Sign in Join
Wiki copytemporary

Platform defines: what changed

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

Title: Platform defines

OldNewLine
1+## Useful tips before using platform defines
2+
3+- [Marco van de Voort: Development Tutorial (a.k.a Build FAQ)](https://www.stack.nl/~marcov/buildfaq.pdf) – general building guidelines
4+- [Marco van de Voort: Creating a portable Pascal codebase.](https://www.stack.nl/~marcov/porting.pdf) – general porting guidelines
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+
7+## Architecture defines
8+
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+
11+<table>
12+<thead>
13+<tr>
14+<th>define(s)</th>
15+<th>meaning</th>
16+</tr>
17+</thead>
18+<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>
172+</tbody>
173+</table>
174+
175+## Operating system defines
176+
177+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".
178+
179+- `ATARI`
180+- `DPMI`: MS-DOS
181+ - `GO32V2`
182+ - `WATCOM`
183+- `EMACS`
184+- `embedded`
185+- `HASAMIGA`
186+ - `AMIGA`
187+ - `AMIGA68K`
188+ - `AMIGAOS4`
189+ - `AROS`
190+ - `MorphOS`
191+- `GBA`: GameBoy Advance
192+- `Java`
193+- `MACOS`: Classic Macintosh (System 7 etc.)
194+- `MSDOS` MS-DOS 16-bit real mode (defined since FPC version 2.7.1)
195+- `NATIVENT`: [[Target NativeNT|NativeNT]]
196+- `NDS`: Nintendo DS
197+- `NETWARE`: NetWare
198+ - `NETWARE_CLIB`: NetWare with classic libc
199+ - `NETWLIBC`, `NETWARE_LIBC`: NetWare with modern libc
200+- `OS2`: OS/2
201+ - `EMX`: emx
202+- `PALMOS`: PalmOS and Garnet OS
203+- `Symbian`: Symbian OS
204+- `UNIX`
205+ - `AIX`
206+ - `ANDROID`
207+ - `BEOS`
208+ - `HAIKU`
209+ - `BSD`
210+ - `DARWIN`: [[Portal:Mac|macOS]] and [[Portal:iOS|iOS]]
211+ - `iPhoneSim`
212+ - `DragonFly`: DragonFlyBSD
213+ - `FREEBSD`: FreeBSD
214+ - `NETBSD`: NetBSD
215+ - `OPENBSD`: OpenBSD
216+ - `LINUX`
217+ - `SUNOS`
218+ - `SOLARIS`
219+ - `QNX`
220+- `WDOSX`
221+- `Wii`
222+- `WINDOWS`: all [[Portal:Windows|Windows]]
223+ - `MSWINDOWS`
224+ - `WIN16`: 16-bit Windows 3.x
225+ - `WIN32`: 32-bit Windows
226+ - `WIN64`: 64-bit Windows
227+ - `WINCE`, `UNDER_CE`, `UNICODE`: Windows CE, Windows mobile
228+
229+## Notes
230+
231+`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”]].
232+
233+## See also
234+
235+- [Delphi Wikia article “FreePascal detection and versioning”](https://delphi.wikia.com/wiki/FreePascal_detection_and_versioning)
236+- [Free Pascal Documentation: Appendix G: Compiler defines during compilation](https://www.freepascal.org/docs-html/prog/progap7.html)
237+
238+---
239+*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).*
240+Category: Directives

Back to history