as_config.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef AS_CONFIG_H
00039 #define AS_CONFIG_H
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291 #define VALUE_OF_BOOLEAN_TRUE 1
00292
00293
00294 #if defined(_MSC_VER) && !defined(__MWERKS__)
00295 #define MULTI_BASE_OFFSET(x) (*((asDWORD*)(&x)+1))
00296 #define HAVE_VIRTUAL_BASE_OFFSET
00297 #define VIRTUAL_BASE_OFFSET(x) (*((asDWORD*)(&x)+3))
00298 #define THISCALL_RETURN_SIMPLE_IN_MEMORY
00299 #define THISCALL_PASS_OBJECT_POINTER_IN_ECX
00300 #if _MSC_VER < 1500 // MSVC++ 9 (aka MSVC++ .NET 2008)
00301 #define asVSNPRINTF(a, b, c, d) _vsnprintf(a, b, c, d)
00302 #else
00303 #define asVSNPRINTF(a, b, c, d) vsnprintf_s(a, b, _TRUNCATE, c, d)
00304 #endif
00305 #define THISCALL_CALLEE_POPS_ARGUMENTS
00306 #define STDCALL __stdcall
00307 #define AS_SIZEOF_BOOL 1
00308 #define AS_WINDOWS_THREADS
00309
00310 #define ASM_INTEL // Intel style for inline assembly on microsoft compilers
00311
00312 #if defined(WIN32)
00313 #define AS_WIN
00314 #endif
00315
00316 #if _XBOX_VER >= 200
00317
00318 #define AS_XBOX360
00319 #define AS_XENON
00320 #define AS_BIG_ENDIAN
00321 #else
00322
00323 #if defined(_XBOX) || (defined(_M_IX86) && !defined(__LP64__))
00324 #define AS_X86
00325 #endif
00326 #endif
00327
00328 #if _MSC_VER <= 1200 // MSVC++ 6
00329 #define I64(x) x##l
00330 #else
00331 #define I64(x) x##ll
00332 #endif
00333
00334 #ifdef _ARM_
00335 #define AS_ALIGN
00336 #define AS_ARM
00337 #define CDECL_RETURN_SIMPLE_IN_MEMORY
00338 #define STDCALL_RETURN_SIMPLE_IN_MEMORY
00339 #define COMPLEX_OBJS_PASSED_BY_REF
00340 #define COMPLEX_MASK asOBJ_APP_CLASS_ASSIGNMENT
00341 #else
00342 #define COMPLEX_MASK (asOBJ_APP_CLASS_CONSTRUCTOR | asOBJ_APP_CLASS_DESTRUCTOR | asOBJ_APP_CLASS_ASSIGNMENT)
00343 #endif
00344
00345 #define UNREACHABLE_RETURN
00346 #endif
00347
00348
00349 #if defined(__MWERKS__) && !defined(EPPC) // JWC -- If Wii DO NOT use this even when using Metrowerks Compiler. Even though they are called Freescale...
00350 #define MULTI_BASE_OFFSET(x) (*((asDWORD*)(&x)+1))
00351 #define HAVE_VIRTUAL_BASE_OFFSET
00352 #define VIRTUAL_BASE_OFFSET(x) (*((asDWORD*)(&x)+3))
00353 #define THISCALL_RETURN_SIMPLE_IN_MEMORY
00354 #define THISCALL_PASS_OBJECT_POINTER_IN_ECX
00355 #define asVSNPRINTF(a, b, c, d) _vsnprintf(a, b, c, d)
00356 #define THISCALL_CALLEE_POPS_ARGUMENTS
00357 #define COMPLEX_MASK (asOBJ_APP_CLASS_CONSTRUCTOR | asOBJ_APP_CLASS_DESTRUCTOR | asOBJ_APP_CLASS_ASSIGNMENT)
00358 #define AS_SIZEOF_BOOL 1
00359 #define AS_WINDOWS_THREADS
00360 #define STDCALL __stdcall
00361
00362
00363 #if defined(_M_IX86) && !defined(__LP64__)
00364 #define AS_X86
00365 #define ASM_INTEL // Intel style for inline assembly
00366 #endif
00367
00368 #if _MSC_VER <= 1200 // MSVC++ 6
00369 #define I64(x) x##l
00370 #else
00371 #define I64(x) x##ll
00372 #endif
00373
00374 #define UNREACHABLE_RETURN
00375 #endif
00376
00377
00378 #if defined(__SNC__) || defined(SNSYS)
00379 #define GNU_STYLE_VIRTUAL_METHOD
00380 #define MULTI_BASE_OFFSET(x) (*((asDWORD*)(&x)+1))
00381 #define CALLEE_POPS_HIDDEN_RETURN_POINTER
00382 #define COMPLEX_OBJS_PASSED_BY_REF
00383 #define ASM_AT_N_T // AT&T style inline assembly
00384 #define COMPLEX_MASK (asOBJ_APP_CLASS_DESTRUCTOR)
00385 #define AS_SIZEOF_BOOL 1
00386 #define asVSNPRINTF(a, b, c, d) vsnprintf(a, b, c, d)
00387
00388
00389
00390
00391 #define STDCALL
00392
00393
00394 #ifdef __linux__
00395 #define THISCALL_RETURN_SIMPLE_IN_MEMORY
00396 #define CDECL_RETURN_SIMPLE_IN_MEMORY
00397 #define STDCALL_RETURN_SIMPLE_IN_MEMORY
00398 #endif
00399
00400
00401 #if defined(i386) && !defined(__LP64__)
00402 #define AS_X86
00403 #endif
00404
00405 #define I64(x) x##ll
00406
00407 #define UNREACHABLE_RETURN
00408 #endif
00409
00410
00411 #if (defined(__GNUC__) && !defined(__SNC__)) || defined(EPPC) // JWC -- use this instead for Wii
00412 #define GNU_STYLE_VIRTUAL_METHOD
00413 #if !defined( __amd64__ )
00414 #define MULTI_BASE_OFFSET(x) (*((asDWORD*)(&x)+1))
00415 #else
00416 #define MULTI_BASE_OFFSET(x) (*((asQWORD*)(&x)+1))
00417 #endif
00418 #define asVSNPRINTF(a, b, c, d) vsnprintf(a, b, c, d)
00419 #define CALLEE_POPS_HIDDEN_RETURN_POINTER
00420 #define COMPLEX_OBJS_PASSED_BY_REF
00421 #define COMPLEX_MASK (asOBJ_APP_CLASS_DESTRUCTOR)
00422 #define AS_NO_MEMORY_H
00423 #define AS_SIZEOF_BOOL 1
00424 #define STDCALL __attribute__((stdcall))
00425 #define ASM_AT_N_T
00426
00427
00428 #ifdef __APPLE__
00429
00430
00431 #ifdef TARGET_OS_IPHONE
00432 #define AS_IPHONE
00433 #else
00434 #define AS_MAC
00435 #endif
00436
00437
00438 #undef AS_SIZEOF_BOOL
00439 #if defined(__ppc__)
00440 #define AS_SIZEOF_BOOL 4
00441
00442 #undef STDCALL
00443 #define STDCALL
00444 #else
00445 #define AS_SIZEOF_BOOL 1
00446 #endif
00447
00448 #if defined(i386) && !defined(__LP64__)
00449
00450 #define AS_X86
00451 #elif (defined(__ppc__) || defined(__PPC__)) && !defined(__LP64__)
00452
00453 #define AS_PPC
00454 #define THISCALL_RETURN_SIMPLE_IN_MEMORY
00455 #define CDECL_RETURN_SIMPLE_IN_MEMORY
00456 #define STDCALL_RETURN_SIMPLE_IN_MEMORY
00457 #elif (defined(__ppc__) || defined(__PPC__)) && defined(__LP64__)
00458 #define AS_PPC_64
00459 #elif (defined(_ARM_) || defined(__arm__))
00460
00461 #define AS_ARM
00462 #define AS_ALIGN
00463
00464
00465
00466 #define AS_MAX_PORTABILITY
00467 #else
00468
00469 #define AS_MAX_PORTABILITY
00470 #endif
00471 #define AS_POSIX_THREADS
00472
00473
00474 #elif defined(WIN32)
00475
00476
00477
00478
00479
00480 #if defined(i386) && !defined(__LP64__)
00481
00482 #define AS_X86
00483 #else
00484
00485 #define AS_MAX_PORTABILITY
00486
00487 #undef STDCALL
00488 #define STDCALL
00489 #endif
00490 #define AS_WIN
00491 #define AS_WINDOWS_THREADS
00492
00493
00494 #elif defined(__linux__)
00495 #if defined(i386) && !defined(__LP64__)
00496 #define THISCALL_RETURN_SIMPLE_IN_MEMORY
00497 #define CDECL_RETURN_SIMPLE_IN_MEMORY
00498 #define STDCALL_RETURN_SIMPLE_IN_MEMORY
00499
00500
00501 #define AS_X86
00502 #else
00503 #define AS_X64_GCC
00504 #define HAS_128_BIT_PRIMITIVES
00505 #define SPLIT_OBJS_BY_MEMBER_TYPES
00506
00507 #undef STDCALL
00508 #define STDCALL
00509 #endif
00510 #define AS_LINUX
00511 #define AS_POSIX_THREADS
00512
00513 #if !( ( (__GNUC__ == 4) && (__GNUC_MINOR__ >= 1) || __GNUC__ > 4) )
00514
00515 #define AS_NO_ATOMIC
00516 #endif
00517
00518
00519 #elif __FreeBSD__
00520 #define AS_BSD
00521 #if defined(i386) && !defined(__LP64__)
00522 #define AS_X86
00523 #else
00524 #define AS_MAX_PORTABILITY
00525 #endif
00526 #define AS_POSIX_THREADS
00527 #if !( ( (__GNUC__ == 4) && (__GNUC_MINOR__ >= 1) || __GNUC__ > 4) )
00528
00529 #define AS_NO_ATOMIC
00530 #endif
00531
00532
00533 #elif defined(__PSP__) || defined(__psp__) || defined(_EE_) || defined(_PSP) || defined(_PS2)
00534
00535 #if (defined(_MIPS_ARCH) || defined(_mips) || defined(__MIPSEL__)) && !defined(__LP64__)
00536 #define AS_MIPS
00537 #else
00538 #define AS_MAX_PORTABILITY
00539 #endif
00540
00541
00542 #elif (defined(__PPC__) || defined(__ppc__)) && defined(__PPU__)
00543
00544 #define AS_PS3
00545 #define AS_PPC_64
00546 #define SPLIT_OBJS_BY_MEMBER_TYPES
00547 #define THISCALL_RETURN_SIMPLE_IN_MEMORY
00548 #define CDECL_RETURN_SIMPLE_IN_MEMORY
00549 #define STDCALL_RETURN_SIMPLE_IN_MEMORY
00550
00551 #undef STDCALL
00552 #define STDCALL
00553
00554
00555 #elif __SH4_SINGLE_ONLY__
00556
00557 #define AS_DC
00558 #define AS_SH4
00559
00560
00561 #elif defined(EPPC)
00562 #define AS_WII
00563 #define THISCALL_RETURN_SIMPLE_IN_MEMORY
00564 #define CDECL_RETURN_SIMPLE_IN_MEMORY
00565 #define STDCALL_RETURN_SIMPLE_IN_MEMORY
00566 #undef STDCALL
00567 #define STDCALL
00568
00569
00570 #elif defined(ANDROID)
00571 #define AS_ANDROID
00572 #define AS_NO_ATOMIC
00573
00574 #if (defined(_ARM_) || defined(__arm__))
00575 #define AS_ARM
00576 #define AS_ALIGN
00577 #endif
00578 #endif
00579
00580 #define I64(x) x##ll
00581
00582 #define UNREACHABLE_RETURN
00583 #endif
00584
00585
00586
00587
00588
00589
00590
00591 #if defined(__i386__) || defined(_M_IX86)
00592
00593 #endif
00594
00595
00596 #if defined(_MIPS_ARCH) || defined(_mips) || defined(__MIPSEL__) || defined(__PSP__) || defined(__psp__) || defined(_EE_) || defined(_PSP) || defined(_PS2)
00597 #define AS_ALIGN // align datastructures
00598 #define AS_USE_DOUBLE_AS_FLOAT // use 32bit floats instead of doubles
00599 #endif
00600
00601
00602 #if defined(__PPC__) || defined(__ppc__) || defined(_PPC_) || defined(EPPC)
00603 #define AS_BIG_ENDIAN
00604
00605
00606 #if defined(_GC)
00607 #define AS_ALIGN
00608 #define AS_USE_DOUBLE_AS_FLOAT
00609 #endif
00610
00611 #if (_XBOX_VER >= 200 )
00612 #define AS_ALIGN
00613 #endif
00614
00615 #if defined(__PPU__)
00616 #define AS_ALIGN
00617 #endif
00618
00619 #if defined(EPPC)
00620 #define AS_ALIGN
00621 #endif
00622 #endif
00623
00624
00625 #ifdef __SH4_SINGLE_ONLY__
00626 #define AS_ALIGN // align datastructures
00627 #define AS_USE_DOUBLE_AS_FLOAT // use 32bit floats instead of doubles
00628 #endif
00629
00630
00631 #if defined(__LP64__) || defined(__amd64__) || defined(_M_X64)
00632 #ifndef AS_64BIT_PTR
00633 #define AS_64BIT_PTR
00634 #endif
00635 #endif
00636
00637
00638
00639 #if (!defined(AS_X86) && !defined(AS_SH4) && !defined(AS_MIPS) && !defined(AS_PPC) && !defined(AS_PPC_64) && !defined(AS_XENON) && !defined(AS_X64_GCC) && !defined(AS_ARM))
00640 #ifndef AS_MAX_PORTABILITY
00641 #define AS_MAX_PORTABILITY
00642 #endif
00643 #endif
00644
00645
00646
00647
00648 #if !defined(AS_POSIX_THREADS) && !defined(AS_WINDOWS_THREADS)
00649 #define AS_NO_THREADS
00650 #endif
00651
00652
00653
00654 #include <assert.h>
00655 #define asASSERT(x) assert(x)
00656
00657
00658
00659
00660
00661
00662
00663 #ifdef AS_ALIGN
00664 #define ALIGN(b) (((b)+3)&(~3))
00665 #else
00666 #define ALIGN(b) (b)
00667 #endif
00668
00669 #define ARG_W(b) ((asWORD*)&b)
00670 #define ARG_DW(b) ((asDWORD*)&b)
00671 #define ARG_QW(b) ((asQWORD*)&b)
00672 #define BCARG_W(b) ((asWORD*)&(b)[1])
00673 #define BCARG_DW(b) ((asDWORD*)&(b)[1])
00674 #define BCARG_QW(b) ((asQWORD*)&(b)[1])
00675
00676 #ifdef AS_64BIT_PTR
00677 #define AS_PTR_SIZE 2
00678 #define asPTRWORD asQWORD
00679 #define asBC_RDSPTR asBC_RDS8
00680 #else
00681 #define AS_PTR_SIZE 1
00682 #define asPTRWORD asDWORD
00683 #define asBC_RDSPTR asBC_RDS4
00684 #endif
00685 #define ARG_PTR(b) ((asPTRWORD*)&b)
00686 #define BCARG_PTR(b) ((asPTRWORD*)&(b)[1])
00687
00688
00689
00690 #define UNUSED_VAR(x) (x)=(x)
00691
00692 #include "../include/angelscript.h"
00693 #include "as_memory.h"
00694
00695 #ifdef AS_USE_NAMESPACE
00696 using namespace AngelScript;
00697 #endif
00698
00699 #endif