Sierra Toolkit
Version of the Day
eaplatform_eastl.h
1
/*
2
Copyright (C) 2009 Electronic Arts, Inc. All rights reserved.
3
4
Redistribution and use in source and binary forms, with or without
5
modification, are permitted provided that the following conditions
6
are met:
7
8
1. Redistributions of source code must retain the above copyright
9
notice, this list of conditions and the following disclaimer.
10
2. Redistributions in binary form must reproduce the above copyright
11
notice, this list of conditions and the following disclaimer in the
12
documentation and/or other materials provided with the distribution.
13
3. Neither the name of Electronic Arts, Inc. ("EA") nor the names of
14
its contributors may be used to endorse or promote products derived
15
from this software without specific prior written permission.
16
17
THIS SOFTWARE IS PROVIDED BY ELECTRONIC ARTS AND ITS CONTRIBUTORS "AS IS" AND ANY
18
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
DISCLAIMED. IN NO EVENT SHALL ELECTRONIC ARTS OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
*/
28
29
/*-----------------------------------------------------------------------------
30
* config/eaplatform.h
31
*
32
* Copyright (c) 2002 - 2005 Electronic Arts Inc. All rights reserved.
33
* Maintained by Paul Pedriana, Maxis
34
*
35
*-----------------------------------------------------------------------------
36
* Currently supported platform indentification defines include:
37
* EA_PLATFORM_PS3
38
* EA_PLATFORM_PS3_PPU
39
* EA_PLATFORM_PS3_SPU
40
* EA_PLATFORM_XENON (a.k.a. XBox2)
41
* EA_PLATFORM_MAC
42
* EA_PLATFORM_OSX
43
* EA_PLATFORM_LINUX
44
* EA_PLATFORM_WINDOWS
45
* EA_PLATFORM_WIN32
46
* EA_PLATFORM_WIN64
47
* EA_PLATFORM_HPUX
48
* EA_PLATFORM_SUN
49
* EA_PLATFORM_LRB (Larrabee)
50
* EA_PLATFORM_UNIX (pseudo-platform; may be defined along with another platform like EA_PLATFORM_LINUX)
51
* EA_PLATFORM_CYGWIN (pseudo-platform; may be defined along with another platform like EA_PLATFORM_LINUX)
52
* EA_PLATFORM_MINGW (pseudo-platform; may be defined along with another platform like EA_PLATFORM_WINDOWS)
53
* EA_PLATFORM_MICROSOFT (pseudo-platform; may be defined along with another platform like EA_PLATFORM_WINDOWS)
54
*
55
* Other definitions emanated from this file inclue:
56
* EA_PLATFORM_NAME = <string>
57
* EA_PLATFORM_DESCRIPTION = <string>
58
* EA_PROCESSOR_XXX
59
* EA_SYSTEM_LITTLE_ENDIAN | EA_SYSTEM_BIG_ENDIAN
60
* EA_ASM_STYLE_ATT | EA_ASM_STYLE_INTEL | EA_ASM_STYLE_MOTOROLA
61
* EA_PLATFORM_PTR_SIZE = <integer size in bytes>
62
* EA_PLATFORM_WORD_SIZE = <integer size in bytes>
63
*
64
*---------------------------------------------------------------------------*/
65
66
67
#ifndef INCLUDED_eaplatform_H
68
#define INCLUDED_eaplatform_H
69
70
71
// Cygwin
72
// This is a pseudo-platform which will be defined along with EA_PLATFORM_LINUX when
73
// using the Cygwin build environment.
74
#if defined(__CYGWIN__)
75
#define EA_PLATFORM_CYGWIN
76
#define EA_PLATFORM_DESKTOP
77
#endif
78
79
// MinGW
80
// This is a pseudo-platform which will be defined along with EA_PLATFORM_WINDOWS when
81
// using the MinGW Windows build environment.
82
#if defined(__MINGW32__) || defined(__MINGW64__)
83
#define EA_PLATFORM_MINGW
84
#define EA_PLATFORM_DESKTOP
85
#endif
86
87
// PlayStation 3 PPU (Primary Processing Unit)
88
#if defined(EA_PLATFORM_PS3_PPU) || defined(EA_PLATFORM_PS3) || defined(__PU__) || defined(__PPU__)
89
#undef EA_PLATFORM_PS3_PPU
90
#define EA_PLATFORM_PS3_PPU 1
91
#undef EA_PLATFORM_PS3
92
#define EA_PLATFORM_PS3 1
93
#define EA_PLATFORM_NAME "PS3"
94
#define EA_PROCESSOR_POWERPC
95
#define EA_PROCESSOR_POWERPC_64
96
#define EA_SYSTEM_BIG_ENDIAN
97
#define EA_PLATFORM_DESCRIPTION "PS3 on PowerPC"
98
#define EA_PLATFORM_CONSOLE
99
100
// PlayStation 3 SPU (Synergistic Processing Unit)
101
#elif defined(EA_PLATFORM_PS3_SPU) || defined(__SPU__)
102
#undef EA_PLATFORM_PS3_SPU
103
#define EA_PLATFORM_PS3_SPU 1
104
#define EA_PLATFORM_NAME "PS3 SPU"
105
#define EA_PROCESSOR_SPU
106
#define EA_SYSTEM_BIG_ENDIAN
107
#define EA_PLATFORM_DESCRIPTION "PS3 SPU on SPU"
108
#define EA_PLATFORM_CONSOLE
109
110
// XBox
111
// _XBOX is defined by the VC++ project, not the compiler. There is no way
112
// to tell if the compiler is compiling for XBox unless _XBOX is #defined
113
// in the project files or otherwise. _M_IX86 is the VC++ way of detecting
114
// an x86 target, which would mean XBox and not Xenon (a.k.a. XBox2).
115
#elif defined(EA_PLATFORM_XBOX) || (defined(_XBOX) && defined(_M_IX86))
116
#undef EA_PLATFORM_XBOX
117
#define EA_PLATFORM_XBOX 1
118
#define EA_PLATFORM_NAME "XBox"
119
#define EA_PROCESSOR_X86
120
#define EA_SYSTEM_LITTLE_ENDIAN
121
#define EA_PLATFORM_DESCRIPTION "XBox on X86"
122
#if defined(_MSC_VER) || defined(__ICL)
123
#define EA_ASM_STYLE_INTEL
124
#endif
125
#define EA_PLATFORM_CONSOLE
126
127
// Xenon (XBox 360)
128
// The Xenon compiler doesn't define anything in particular to indicate that the
129
// target is the Xenon platform. The Xenon SDK, however, expects that XBOX and
130
// _XBOX are #defined, so the project build file must make sure these are defined.
131
// Since the Xenon compiler in fact defines _M_PPC, we can use this information
132
// to infer that Xenon is the target if neither _XENON nor _XBOX2 are specifically
133
// defined by the project build file.
134
#elif defined(EA_PLATFORM_XENON) || defined(_XENON) || defined(_XBOX2) || ((defined(_XBOX) || defined(XBOX)) && defined(_M_PPC))
135
#undef EA_PLATFORM_XENON
136
#define EA_PLATFORM_XENON 1
137
#define EA_PLATFORM_NAME "Xenon"
138
#define EA_PROCESSOR_POWERPC
139
#define EA_PROCESSOR_POWERPC_64
140
#define EA_SYSTEM_BIG_ENDIAN
141
#define EA_PLATFORM_DESCRIPTION "Xenon on PowerPC"
142
#if defined(_MSC_VER) || defined(__ICL)
143
#define EA_ASM_STYLE_INTEL
144
#endif
145
#define EA_PLATFORM_CONSOLE
146
#define EA_PLATFORM_MICROSOFT 1
147
148
// Larrabee // This part to be removed once __LRB__ is supported by the Larrabee compiler in 2009.
149
#elif defined(EA_PLATFORM_LRB) || defined(__LRB__) || (defined(__EDG__) && defined(__ICC) && defined(__x86_64__))
150
#undef EA_PLATFORM_LRB
151
#define EA_PLATFORM_LRB 1
152
#define EA_PLATFORM_NAME "Larrabee"
153
#define EA_PLATFORM_DESCRIPTION "Larrabee on LRB1"
154
#define EA_PROCESSOR_X86_64
155
#if defined(BYTE_ORDER) && (BYTE_ORDER == 4321)
156
#define EA_SYSTEM_BIG_ENDIAN
157
#else
158
#define EA_SYSTEM_LITTLE_ENDIAN
159
#endif
160
#define EA_PROCESSOR_LRB
161
#define EA_PROCESSOR_LRB1 // Larrabee version 1
162
#define EA_ASM_STYLE_ATT // Both types of asm style
163
#define EA_ASM_STYLE_INTEL // are supported.
164
#define EA_PLATFORM_DESKTOP
165
166
// Android (Google phone OS)
167
#elif defined(EA_PLATFORM_ANDROID) || defined(__ANDROID__)
168
#undef EA_PLATFORM_ANDROID
169
#define EA_PLATFORM_ANDROID 1
170
#define EA_PLATFORM_LINUX 1
171
#define EA_PLATFORM_UNIX 1
172
#define EA_PLATFORM_NAME "Android"
173
#define EA_ASM_STYLE_ATT
174
#if defined(__arm__)
175
#define EA_PROCESSOR_ARM
176
#define EA_PLATFORM_DESCRIPTION "Android on ARM"
177
#else
178
#error Unknown processor
179
#endif
180
#if !defined(EA_SYSTEM_BIG_ENDIAN) && !defined(EA_SYSTEM_LITTLE_ENDIAN)
181
#define EA_SYSTEM_LITTLE_ENDIAN
182
#endif
183
#define EA_PLATFORM_MOBILE
184
185
// Palm OS for Mobile (Linux variant)
186
#elif defined(EA_PLATFORM_PALM)
187
#undef EA_PLATFORM_PALM
188
#define EA_PLATFORM_PALM 1
189
#define EA_PLATFORM_LINUX 1
190
#define EA_PLATFORM_UNIX 1
191
#define EA_PLATFORM_NAME "Palm"
192
#define EA_POSIX_THREADS_AVAILABLE 1
193
#define EA_ASM_STYLE_ATT
194
#if defined(__arm__)
195
#define EA_PROCESSOR_ARM
196
#define EA_PLATFORM_DESCRIPTION "Palm on ARM"
197
#else
198
#error Unknown processor
199
#endif
200
#if !defined(EA_SYSTEM_BIG_ENDIAN) && !defined(EA_SYSTEM_LITTLE_ENDIAN)
201
#define EA_SYSTEM_LITTLE_ENDIAN
202
#endif
203
#define EA_PLATFORM_MOBILE
204
205
// Airplay
206
#elif defined(EA_PLATFORM_AIRPLAY) || defined(__S3E__)
207
#undef EA_PLATFORM_AIRPLAY
208
#define EA_PLATFORM_AIRPLAY
209
#define EA_PLATFORM_NAME "Airplay"
210
#if defined(__arm__)
211
#define EA_PROCESSOR_ARM
212
#define EA_PLATFORM_DESCRIPTION "Airplay on ARM"
213
#define EA_ASM_STYLE_ATT
214
#undef _MSC_VER
215
#elif defined(_M_IX86)
216
#define EA_PROCESSOR_X86
217
#define EA_PLATFORM_DESCRIPTION "Airplay on x86"
218
#define EA_ASM_STYLE_INTEL
219
#else
220
#error Unknown processor
221
#endif
222
#if !defined(EA_SYSTEM_BIG_ENDIAN) && !defined(EA_SYSTEM_LITTLE_ENDIAN)
223
#if defined(HAVE_BIG_ENDIAN) || (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN)))
224
#define EA_SYSTEM_BIG_ENDIAN
225
#else
226
#define EA_SYSTEM_LITTLE_ENDIAN
227
#endif
228
#endif
229
#define EA_PLATFORM_MOBILE
230
231
// Samsung Bada OS for Mobile (Linux variant)
232
#elif defined(EA_PLATFORM_BADA)
233
#undef EA_PLATFORM_BADA
234
#define EA_PLATFORM_BADA 1
235
//#define EA_PLATFORM_LINUX 1 // The underlying OS is Linux, but the app mostly doesn't see this.
236
//#define EA_PLATFORM_UNIX 1
237
#define EA_PLATFORM_NAME "bada"
238
#define EA_ASM_STYLE_ATT
239
#if defined(__arm__)
240
#define EA_PROCESSOR_ARM
241
#define EA_PLATFORM_DESCRIPTION "bada on ARM"
242
#elif defined(__i386__)
243
#define EA_PLATFORM_BADA_SIMULATOR
244
#define EA_PROCESSOR_X86
245
#define EA_PLATFORM_DESCRIPTION "bada simulator on x86"
246
#else
247
#error Unknown processor
248
#endif
249
#if !defined(EA_SYSTEM_BIG_ENDIAN) && !defined(EA_SYSTEM_LITTLE_ENDIAN)
250
#define EA_SYSTEM_LITTLE_ENDIAN
251
#endif
252
#define EA_PLATFORM_MOBILE
253
254
#elif defined(__APPLE__) && __APPLE__
255
#include <TargetConditionals.h>
256
257
// Apple family of operating systems.
258
#define EA_PLATFORM_APPLE
259
260
// iPhone
261
// TARGET_OS_IPHONE will be undefined on an unknown compiler, and will be defined on gcc.
262
#if defined(EA_PLATFORM_IPHONE) || defined(__IPHONE__) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR)
263
#undef EA_PLATFORM_IPHONE
264
#define EA_PLATFORM_IPHONE 1
265
#define EA_PLATFORM_NAME "iPhone"
266
#define EA_ASM_STYLE_ATT
267
#define EA_POSIX_THREADS_AVAILABLE 1
268
#if defined(__arm__)
269
#define EA_PROCESSOR_ARM
270
#define EA_SYSTEM_LITTLE_ENDIAN
271
#define EA_PLATFORM_DESCRIPTION "iPhone on ARM"
272
#elif defined(__i386__)
273
#define EA_PLATFORM_IPHONE_SIMULATOR
274
#define EA_PROCESSOR_X86
275
#define EA_SYSTEM_LITTLE_ENDIAN
276
#define EA_PLATFORM_DESCRIPTION "iPhone simulator on x86"
277
#else
278
#error Unknown processor
279
#endif
280
#define EA_PLATFORM_MOBILE
281
282
// Macintosh OSX
283
// TARGET_OS_MAC is defined by the Metrowerks and older AppleC compilers.
284
// Howerver, TARGET_OS_MAC is defined to be 1 in all cases.
285
// __i386__ and __intel__ are defined by the GCC compiler.
286
// __dest_os is defined by the Metrowerks compiler.
287
// __MACH__ is defined by the Metrowerks and GCC compilers.
288
// powerc and __powerc are defined by the Metrowerks and GCC compilers.
289
#elif defined(EA_PLATFORM_OSX) || defined(__MACH__) || (defined(__MSL__) && (__dest_os == __mac_os_x))
290
#undef EA_PLATFORM_OSX
291
#define EA_PLATFORM_OSX 1
292
#define EA_PLATFORM_UNIX 1
293
#define EA_PLATFORM_NAME "OSX"
294
#if defined(__i386__) || defined(__intel__)
295
#define EA_PROCESSOR_X86
296
#define EA_SYSTEM_LITTLE_ENDIAN
297
#define EA_PLATFORM_DESCRIPTION "OSX on x86"
298
#elif defined(__x86_64) || defined(__amd64)
299
#define EA_PROCESSOR_X86_64
300
#define EA_SYSTEM_LITTLE_ENDIAN
301
#define EA_PLATFORM_DESCRIPTION "OSX on x86-64"
302
#elif defined(__arm__)
303
#define EA_PROCESSOR_ARM
304
#define EA_SYSTEM_LITTLE_ENDIAN
305
#define EA_PLATFORM_DESCRIPTION "OSX on ARM"
306
#elif defined(__POWERPC64__) || defined(__powerpc64__)
307
#define EA_PROCESSOR_POWERPC
308
#define EA_PROCESSOR_POWERPC_64
309
#define EA_SYSTEM_BIG_ENDIAN
310
#define EA_PLATFORM_DESCRIPTION "OSX on PowerPC 64"
311
#elif defined(__POWERPC__) || defined(__powerpc__)
312
#define EA_PROCESSOR_POWERPC
313
#define EA_PROCESSOR_POWERPC_32
314
#define EA_SYSTEM_BIG_ENDIAN
315
#define EA_PLATFORM_DESCRIPTION "OSX on PowerPC"
316
#else
317
#error Unknown processor
318
#endif
319
#if defined(__GNUC__)
320
#define EA_ASM_STYLE_ATT
321
#else
322
#define EA_ASM_STYLE_MOTOROLA
323
#endif
324
#define EA_PLATFORM_DESKTOP
325
326
#else
327
#error Unknown Apple Platform
328
#endif
329
330
// Linux
331
// __linux and __linux__ are defined by the GCC and Borland compiler.
332
// __i386__ and __intel__ are defined by the GCC compiler.
333
// __i386__ is defined by the Metrowerks compiler.
334
// _M_IX86 is defined by the Borland compiler.
335
// __sparc__ is defined by the GCC compiler.
336
// __powerpc__ is defined by the GCC compiler.
337
#elif defined(EA_PLATFORM_LINUX) || (defined(__linux) || defined(__linux__))
338
#undef EA_PLATFORM_LINUX
339
#define EA_PLATFORM_LINUX 1
340
#define EA_PLATFORM_UNIX 1
341
#define EA_PLATFORM_NAME "Linux"
342
#if defined(__i386__) || defined(__intel__) || defined(_M_IX86)
343
#define EA_PROCESSOR_X86
344
#define EA_SYSTEM_LITTLE_ENDIAN
345
#define EA_PLATFORM_DESCRIPTION "Linux on x86"
346
#elif defined(__x86_64__)
347
#define EA_PROCESSOR_X86_64
348
#define EA_SYSTEM_LITTLE_ENDIAN
349
#define EA_PLATFORM_DESCRIPTION "Linux on x86-64"
350
#elif defined(__powerpc64__)
351
#define EA_PROCESSOR_POWERPC
352
#define EA_PROCESSOR_POWERPC_64
353
#define EA_SYSTEM_BIG_ENDIAN
354
#define EA_PLATFORM_DESCRIPTION "Linux on PowerPC 64"
355
#elif defined(__powerpc__)
356
#define EA_PROCESSOR_POWERPC
357
#define EA_PROCESSOR_POWERPC_32
358
#define EA_SYSTEM_BIG_ENDIAN
359
#define EA_PLATFORM_DESCRIPTION "Linux on PowerPC"
360
#else
361
#error Unknown processor
362
#error Unknown endianness
363
#endif
364
#if defined(__GNUC__)
365
#define EA_ASM_STYLE_ATT
366
#endif
367
#define EA_PLATFORM_DESKTOP
368
369
// Win CE (Windows mobile)
370
#elif defined(EA_PLATFORM_WINCE) || defined(_WIN32_WCE)
371
#undef EA_PLATFORM_WINCE
372
#define EA_PLATFORM_WINCE 1
373
#define EA_PLATFORM_NAME "WinCE"
374
#define EA_ASM_STYLE_INTEL
375
#define EA_SYSTEM_LITTLE_ENDIAN
376
#if defined(_M_ARM) // Also there is _M_ARMT
377
#define EA_PROCESSOR_ARM
378
#define EA_PLATFORM_DESCRIPTION "Windows CE on ARM"
379
#elif defined(_M_IX86)
380
#define EA_PROCESSOR_X86
381
#define EA_PLATFORM_DESCRIPTION "Windows CE on X86"
382
#else //Possibly other Windows CE variants
383
#error Unknown processor
384
#endif
385
#define EA_PLATFORM_MOBILE
386
387
// Windows
388
// _WIN32 is defined by the VC++, Intel and GCC compilers.
389
// _WIN64 is defined by the VC++, Intel and GCC compilers.
390
// __WIN32__ is defined by the Borland compiler.
391
// __INTEL__ is defined by the Metrowerks compiler.
392
// _M_IX86, _M_AMD64 and _M_IA64 are defined by the VC++, Intel, and Borland compilers.
393
// _X86_, _AMD64_, and _IA64_ are defined by the Metrowerks compiler.
394
// _M_ARM is defined by the VC++ compiler.
395
#elif (defined(EA_PLATFORM_WINDOWS) || (defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || (defined(__MWERKS__) && defined(_X86_)))) && !defined(_XBOX)
396
#undef EA_PLATFORM_WINDOWS
397
#define EA_PLATFORM_WINDOWS 1
398
#define EA_PLATFORM_NAME "Windows"
399
#ifdef _WIN64 // VC++ defines both _WIN32 and _WIN64 when compiling for Win64.
400
#define EA_PLATFORM_WIN64
401
#else
402
#define EA_PLATFORM_WIN32
403
#endif
404
#if defined(_M_AMD64) || defined(_AMD64_) || defined(__x86_64__)
405
#define EA_PROCESSOR_X86_64
406
#define EA_SYSTEM_LITTLE_ENDIAN
407
#define EA_PLATFORM_DESCRIPTION "Windows on X86-64"
408
#elif defined(_M_IX86) || defined(_X86_)
409
#define EA_PROCESSOR_X86
410
#define EA_SYSTEM_LITTLE_ENDIAN
411
#define EA_PLATFORM_DESCRIPTION "Windows on X86"
412
#elif defined(_M_IA64) || defined(_IA64_)
413
#define EA_PROCESSOR_IA64
414
#define EA_SYSTEM_LITTLE_ENDIAN
415
#define EA_PLATFORM_DESCRIPTION "Windows on IA-64"
416
#elif defined(_M_ARM)
417
#define EA_PROCESSOR_ARM
418
#define EA_SYSTEM_LITTLE_ENDIAN
419
#define EA_PLATFORM_DESCRIPTION "Windows CE on ARM"
420
#else //Possibly other Windows CE variants
421
#error Unknown processor
422
#error Unknown endianness
423
#endif
424
#if defined(__GNUC__)
425
#define EA_ASM_STYLE_ATT
426
#elif defined(_MSC_VER) || defined(__BORLANDC__) || defined(__ICL)
427
#define EA_ASM_STYLE_INTEL
428
#endif
429
#define EA_PLATFORM_DESKTOP
430
#define EA_PLATFORM_MICROSOFT 1
431
432
// Sun (Solaris)
433
// __SUNPRO_CC is defined by the Sun compiler.
434
// __sun is defined by the GCC compiler.
435
// __i386 is defined by the Sun and GCC compilers.
436
// __sparc is defined by the Sun and GCC compilers.
437
#elif defined(EA_PLATFORM_SUN) || (defined(__SUNPRO_CC) || defined(__sun))
438
#undef EA_PLATFORM_SUN
439
#define EA_PLATFORM_SUN 1
440
#define EA_PLATFORM_UNIX 1
441
#define EA_PLATFORM_NAME "SUN"
442
#if defined(__i386)
443
#define EA_PROCESSOR_X86
444
#define EA_SYSTEM_LITTLE_ENDIAN
445
#define EA_PLATFORM_DESCRIPTION "SUN on x86"
446
#elif defined(__sparc)
447
#define EA_PROCESSOR_SPARC
448
#define EA_SYSTEM_BIG_ENDIAN
449
#define EA_PLATFORM_DESCRIPTION "SUN on Sparc"
450
#else
451
#error Unknown processor
452
#error Unknown endianness
453
#endif
454
#define EA_PLATFORM_DESKTOP
455
456
#else
457
#error Unknown platform
458
#error Unknown processor
459
#error Unknown endianness
460
#endif
461
462
463
464
// EA_PLATFORM_PTR_SIZE
465
// Platform pointer size; same as sizeof(void*).
466
// This is not the same as sizeof(int), as int is usually 32 bits on
467
// even 64 bit platforms.
468
//
469
// _WIN64 is defined by Win64 compilers, such as VC++.
470
// _M_IA64 is defined by VC++ and Intel compilers for IA64 processors.
471
// __LP64__ is defined by HP compilers for the LP64 standard.
472
// _LP64 is defined by the GCC and Sun compilers for the LP64 standard.
473
// __ia64__ is defined by the GCC compiler for IA64 processors.
474
// __arch64__ is defined by the Sparc compiler for 64 bit processors.
475
// __mips64__ is defined by the GCC compiler for MIPS processors.
476
// __powerpc64__ is defined by the GCC compiler for PowerPC processors.
477
// __64BIT__ is defined by the AIX compiler for 64 bit processors.
478
// __sizeof_ptr is defined by the ARM compiler (armcc, armcpp).
479
//
480
#ifndef EA_PLATFORM_PTR_SIZE
481
#if defined(__WORDSIZE) // Defined by some variations of GCC.
482
#define EA_PLATFORM_PTR_SIZE ((__WORDSIZE) / 8)
483
#elif defined(_WIN64) || defined(__LP64__) || defined(_LP64) || defined(_M_IA64) || defined(__ia64__) || defined(__arch64__) || defined(__mips64__) || defined(__64BIT__)
484
#define EA_PLATFORM_PTR_SIZE 8
485
#elif defined(__CC_ARM) && (__sizeof_ptr == 8)
486
#define EA_PLATFORM_PTR_SIZE 8
487
#else
488
#define EA_PLATFORM_PTR_SIZE 4
489
#endif
490
#endif
491
492
493
494
// EA_PLATFORM_WORD_SIZE
495
// This defines the size of a machine word. This will be the same as
496
// the size of registers on the machine but not necessarily the same
497
// as the size of pointers on the machine. A number of 64 bit platforms
498
// have 64 bit registers but 32 bit pointers.
499
//
500
#ifndef EA_PLATFORM_WORD_SIZE
501
#if defined(EA_PLATFORM_XENON) || defined(EA_PLATFORM_PS3)
502
#define EA_PLATFORM_WORD_SIZE 8
503
#else
504
#define EA_PLATFORM_WORD_SIZE EA_PLATFORM_PTR_SIZE
505
#endif
506
#endif
507
508
509
510
// Disabled until and unless deemed useful:
511
//
512
// Platform integer types
513
// These definitions allow us to define other things properly, such as
514
// sized integer types. In order to bring some order to this chaos,
515
// we follow a variation of the standard LP64 conventions defined at:
516
// http://www.opengroup.org/public/tech/aspen/lp64_wp.htm
517
//
518
// #if defined(EA_PLATFORM_LINUX) || defined(EA_PLATFORM_OSX) || defined(EA_PLATFORM_XBOX) || defined(EA_PLATFORM_XENON)
519
// #define EA_PLATFORM_ILP32_LL64 // int, long, ptr = 32 bits; long long = 64 bits.
520
//
521
// #elif defined(EA_PLATFORM_SUN) || defined(EA_PLATFORM_SGI)
522
// #if (EA_PLATFORM_WORD_SIZE == 32)
523
// #define ILP32_LL64 // int, long, ptr = 32 bits; long long = 64 bits.
524
// #else // 64 bit platform
525
// #define EA_PLATFORM_I32_LLLP64 // int = 32 bits; long, long long, ptr = 64 bits.
526
// #endif
527
//
528
// #elif defined(EA_PLATFORM_WINDOWS)
529
// #if (EA_PLATFORM_WORD_SIZE == 32)
530
// #define ILP32_LL64 // int, long, ptr = 32 bits; long long = 64 bits.
531
// #else // 64 bit platform
532
// #if defined(__MWERKS__) || defined(__GNUC__)
533
// #define EA_PLATFORM_I32_LLLP64 // int = 32 bits; long, long long, ptr = 64 bits.
534
// #else // MSVC
535
// #define EA_PLATFORM_IL32_LLP64 // int, long = 32 bits; long long, ptr = 64 bits.
536
// #endif
537
// #endif
538
// #endif
539
540
541
#endif // INCLUDED_eaplatform_H
stk_util
stk_util
util
unused-maps
eaplatform_eastl.h
Generated by
1.8.14