as_config.h

Go to the documentation of this file.
00001 /*
00002    AngelCode Scripting Library
00003    Copyright (c) 2003-2009 Andreas Jonsson
00004 
00005    This software is provided 'as-is', without any express or implied
00006    warranty. In no event will the authors be held liable for any
00007    damages arising from the use of this software.
00008 
00009    Permission is granted to anyone to use this software for any
00010    purpose, including commercial applications, and to alter it and
00011    redistribute it freely, subject to the following restrictions:
00012 
00013    1. The origin of this software must not be misrepresented; you
00014       must not claim that you wrote the original software. If you use
00015       this software in a product, an acknowledgment in the product
00016       documentation would be appreciated but is not required.
00017 
00018    2. Altered source versions must be plainly marked as such, and
00019       must not be misrepresented as being the original software.
00020 
00021    3. This notice may not be removed or altered from any source
00022       distribution.
00023 
00024    The original version of this library can be located at:
00025    http://www.angelcode.com/angelscript/
00026 
00027    Andreas Jonsson
00028    andreas@angelcode.com
00029 */
00030 
00031 
00032 //
00033 // as_config.h
00034 //
00035 // this file is used for configuring the compilation of the library
00036 //
00037 
00038 #ifndef AS_CONFIG_H
00039 #define AS_CONFIG_H
00040 
00041 
00042 
00043 //
00044 // Features
00045 //-----------------------------------------
00046 
00047 // AS_NO_THREADS
00048 // Turns off support for multithreading. By turning off
00049 // this when it's not needed a bit of performance is gained.
00050 
00051 // AS_WINDOWS_THREADS
00052 // If the library should be compiled using windows threads.
00053 
00054 // AS_POSIX_THREADS
00055 // If the library should be compiled using posix threads.
00056 
00057 // AS_NO_ATOMIC
00058 // If the compiler/platform doesn't support atomic instructions
00059 // then this should be defined to use critical sections instead.
00060 
00061 // AS_DEBUG
00062 // This flag can be defined to make the library write some extra output when
00063 // compiling and executing scripts.
00064 
00065 // AS_DEPRECATED
00066 // If this flag is defined then some backwards compatibility is maintained.
00067 // There is no guarantee for how well deprecated functionality will work though
00068 // so it is best to exchange it for the new functionality as soon as possible.
00069 
00070 // AS_NO_CLASS_METHODS
00071 // Disables the possibility to add class methods. Can increase the
00072 // portability of the library.
00073 
00074 // AS_MAX_PORTABILITY
00075 // Disables all platform specific code. Only the asCALL_GENERIC calling
00076 // convention will be available in with this flag set.
00077 
00078 // AS_DOUBLEBYTE_CHARSET
00079 // When this flag is defined, the parser will treat all characters in strings
00080 // that are greater than 127 as lead characters and automatically include the
00081 // next character in the script without checking its value. This should be 
00082 // compatible with common encoding schemes, e.g. Big5. Shift-JIS is not compatible 
00083 // though as it encodes some single byte characters above 127. 
00084 //
00085 // If support for international text is desired, it is recommended that UTF-8
00086 // is used as this is supported natively by the compiler without the use for this
00087 // preprocessor flag.
00088 
00089 
00090 
00091 
00092 //
00093 // Library usage
00094 //------------------------------------------
00095 
00096 // ANGELSCRIPT_EXPORT
00097 // This flag should be defined when compiling the library as a lib or dll.
00098 
00099 // ANGELSCRIPT_DLL_LIBRARY_IMPORT
00100 // This flag should be defined when using AngelScript as a dll with automatic
00101 // library import.
00102 
00103 // ANGELSCRIPT_DLL_MANUAL_IMPORT
00104 // This flag should be defined when using AngelScript as a dll with manual
00105 // loading of the library.
00106 
00107 
00108 
00109 
00110 //
00111 // Compiler differences
00112 //-----------------------------------------
00113 
00114 // asVSNPRINTF(a,b,c,d)
00115 // Some compilers use different names for this function. You must 
00116 // define this macro to map to the proper function.
00117 
00118 // ASM_AT_N_T or ASM_INTEL
00119 // You should choose what inline assembly syntax to use when compiling.
00120 
00121 // VALUE_OF_BOOLEAN_TRUE
00122 // This flag allows to customize the exact value of boolean true.
00123 
00124 // AS_SIZEOF_BOOL
00125 // On some target platforms the sizeof(bool) is 4, but on most it is 1.
00126 
00127 // STDCALL
00128 // This is used to declare a function to use the stdcall calling convention.
00129 
00130 // AS_USE_NAMESPACE
00131 // Adds the AngelScript namespace on the declarations.
00132 
00133 // AS_NO_MEMORY_H
00134 // Some compilers don't come with the memory.h header file.
00135 
00136 
00137 
00138 //
00139 // How to identify different compilers
00140 //-----------------------------------------
00141 
00142 // MS Visual C++
00143 //  _MSC_VER   is defined
00144 //  __MWERKS__ is not defined
00145 
00146 // Metrowerks
00147 //  _MSC_VER   is defined
00148 //  __MWERKS__ is defined
00149 
00150 // GNU C based compilers
00151 //  __GNUC__   is defined
00152 
00153 
00154 
00155 //
00156 // CPU differences
00157 //---------------------------------------
00158 
00159 // AS_ALIGN
00160 // Some CPUs require that data words are aligned in some way. This macro
00161 // should be defined if the words should be aligned to boundaries of the same
00162 // size as the word, i.e.
00163 //  1 byte  on 1 byte boundaries
00164 //  2 bytes on 2 byte boundaries
00165 //  4 bytes on 4 byte boundaries
00166 //  8 bytes on 4 byte boundaries (no it's not a typo)
00167 
00168 // AS_USE_DOUBLE_AS_FLOAT
00169 // If there is no 64 bit floating point type, then this constant can be defined
00170 // to treat double like normal floats.
00171 
00172 // AS_X86
00173 // Use assembler code for the x86 CPU family
00174 
00175 // AS_SH4
00176 // Use assembler code for the SH4 CPU family
00177 
00178 // AS_MIPS
00179 // Use assembler code for the MIPS CPU family
00180 
00181 // AS_PPC
00182 // Use assembler code for the 32bit PowerPC CPU family
00183 
00184 // AS_PPC_64
00185 // Use assembler code for the 64bit PowerPC CPU family
00186 
00187 // AS_XENON
00188 // Use assembler code for the Xenon (XBOX360) CPU family
00189 
00190 // AS_ARM
00191 // Use assembler code for the ARM CPU family
00192 
00193 // AS_64BIT_PTR
00194 // Define this to make the engine store all pointers in 64bit words. 
00195 
00196 // AS_BIG_ENDIAN
00197 // Define this for CPUs that use big endian memory layout, e.g. PPC
00198 
00199 
00200 
00201 //
00202 // Target systems
00203 //--------------------------------
00204 // This group shows a few of the flags used to identify different target systems.
00205 // Sometimes there are differences on different target systems, while both CPU and
00206 // compiler is the same for both, when this is so these flags are used to produce the
00207 // right code.
00208 
00209 // AS_WIN     - Microsoft Windows
00210 // AS_LINUX   - Linux
00211 // AS_MAC     - Apple Macintosh
00212 // AS_BSD     - FreeBSD
00213 // AS_XBOX    - Microsoft XBox
00214 // AS_XBOX360 - Microsoft XBox 360
00215 // AS_PSP     - Sony Playstation Portable
00216 // AS_PS2     - Sony Playstation 2
00217 // AS_PS3     - Sony Playstation 3
00218 // AS_DC      - Sega Dreamcast
00219 // AS_GC      - Nintendo GameCube
00220 // AS_WII     - Nintendo Wii
00221 // AS_IPHONE  - Apple IPhone
00222 // AS_ANDROID - Android
00223 
00224 
00225 
00226 
00227 //
00228 // Calling conventions
00229 //-----------------------------------------
00230 
00231 // GNU_STYLE_VIRTUAL_METHOD
00232 // This constant should be defined if method pointers store index for virtual
00233 // functions in the same location as the function pointer. In such cases the method
00234 // is identified as virtual if the least significant bit is set.
00235 
00236 // MULTI_BASE_OFFSET(x)
00237 // This macro is used to retrieve the offset added to the object pointer in order to
00238 // implicitly cast the object to the base object. x is the method pointer received by
00239 // the register function.
00240 
00241 // HAVE_VIRTUAL_BASE_OFFSET
00242 // Define this constant if the compiler stores the virtual base offset in the method
00243 // pointers. If it is not stored in the pointers then AngelScript have no way of
00244 // identifying a method as coming from a class with virtual inheritance.
00245 
00246 // VIRTUAL_BASE_OFFSET(x)
00247 // This macro is used to retrieve the offset added to the object pointer in order to
00248 // find the virtual base object. x is the method pointer received by the register
00249 // function;
00250 
00251 // COMPLEX_MASK
00252 // This constant shows what attributes determines if an object is returned in memory
00253 // or in the registers as normal structures
00254 
00255 // THISCALL_RETURN_SIMPLE_IN_MEMORY
00256 // CDECL_RETURN_SIMPLE_IN_MEMORY
00257 // STDCALL_RETURN_SIMPLE_IN_MEMORY
00258 // When these constants are defined then the corresponding calling convention always
00259 // return classes/structs in memory regardless of size or complexity.
00260 
00261 // CALLEE_POPS_HIDDEN_RETURN_POINTER
00262 // This constant should be defined if the callee pops the hidden return pointer,
00263 // used when returning an object in memory.
00264 
00265 // THISCALL_PASS_OBJECT_POINTER_ON_THE_STACK
00266 // With this constant defined AngelScript will pass the object pointer on the stack
00267 
00268 // THISCALL_CALLEE_POPS_ARGUMENTS
00269 // If the callee pops arguments for class methods then define this constant
00270 
00271 // COMPLEX_OBJS_PASSED_BY_REF
00272 // Some compilers always pass certain objects by reference. GNUC for example does
00273 // this if the the class has a defined destructor.
00274 
00275 // HAS_128_BIT_PRIMITIVES
00276 // 64bit processors often support 128bit primitives. These may require special
00277 // treatment when passed in function arguments or returned by functions.
00278 
00279 // SPLIT_OBJS_BY_MEMBER_TYPES
00280 // On some platforms objects with primitive members are split over different
00281 // register types when passed by value to functions. 
00282 
00283 
00284 
00285 
00286 
00287 //
00288 // Detect compiler
00289 //------------------------------------------------
00290 
00291 #define VALUE_OF_BOOLEAN_TRUE  1
00292 
00293 // Microsoft Visual C++
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         // 360 uses a Xenon processor (which is a modified 64bit PPC)
00318         #define AS_XBOX360
00319         #define AS_XENON
00320         #define AS_BIG_ENDIAN
00321     #else
00322         // Support native calling conventions on x86, but not 64bit yet
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 // Metrowerks CodeWarrior (experimental, let me know if something isn't working)
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     // Support native calling conventions on x86, but not 64bit yet
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 // SN Systems ProDG (also experimental, let me know if something isn't working)
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     // SN doesnt seem to like STDCALL.
00389     // Maybe it can work with some fiddling, but I can't imagine linking to
00390     // any STDCALL functions with a console anyway...
00391     #define STDCALL
00392 
00393     // Linux specific
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     // Support native calling conventions on x86, but not 64bit yet
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 // GNU C (and MinGW on Windows)
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     // MacOSX and IPhone
00428     #ifdef __APPLE__
00429 
00430         // Is this a Mac or an IPhone?
00431         #ifdef TARGET_OS_IPHONE
00432             #define AS_IPHONE
00433         #else
00434             #define AS_MAC
00435         #endif
00436 
00437         // The sizeof bool is different depending on the target CPU
00438         #undef AS_SIZEOF_BOOL
00439         #if defined(__ppc__)
00440             #define AS_SIZEOF_BOOL 4
00441             // STDCALL is not available on PPC
00442             #undef STDCALL
00443             #define STDCALL
00444         #else
00445             #define AS_SIZEOF_BOOL 1
00446         #endif
00447 
00448         #if defined(i386) && !defined(__LP64__)
00449             // Support native calling conventions on Mac OS X + Intel 32bit CPU
00450             #define AS_X86
00451         #elif (defined(__ppc__) || defined(__PPC__)) && !defined(__LP64__)
00452             // Support native calling conventions on Mac OS X + PPC 32bit CPU
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             // The IPhone use an ARM processor
00461             #define AS_ARM
00462             #define AS_ALIGN
00463 
00464             // TODO: Native calling convention on the IPhone is not available yet. Need to adapt
00465             //       the code in as_callfunc_armasm.asm to allow GNU's assembler to compile it.
00466             #define AS_MAX_PORTABILITY
00467         #else
00468             // Unknown CPU type
00469             #define AS_MAX_PORTABILITY
00470         #endif
00471         #define AS_POSIX_THREADS
00472  
00473     // Windows
00474     #elif defined(WIN32)
00475         // On Windows the simple classes are returned in the EAX:EDX registers
00476         //#define THISCALL_RETURN_SIMPLE_IN_MEMORY
00477         //#define CDECL_RETURN_SIMPLE_IN_MEMORY
00478         //#define STDCALL_RETURN_SIMPLE_IN_MEMORY
00479 
00480         #if defined(i386) && !defined(__LP64__)
00481             // Support native calling conventions on Intel 32bit CPU
00482             #define AS_X86
00483         #else
00484             // No support for native calling conventions yet
00485             #define AS_MAX_PORTABILITY
00486             // STDCALL is not available on 64bit Linux
00487             #undef STDCALL
00488             #define STDCALL
00489         #endif
00490         #define AS_WIN
00491         #define AS_WINDOWS_THREADS
00492 
00493     // Linux
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             // Support native calling conventions on Intel 32bit CPU
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             // STDCALL is not available on 64bit Linux
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             // Only with GCC 4.1 was the atomic instructions available
00515             #define AS_NO_ATOMIC
00516         #endif
00517 
00518     // Free BSD
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             // Only with GCC 4.1 was the atomic instructions available
00529             #define AS_NO_ATOMIC
00530         #endif
00531 
00532     // PSP and PS2
00533     #elif defined(__PSP__) || defined(__psp__) || defined(_EE_) || defined(_PSP) || defined(_PS2)
00534         // Support native calling conventions on MIPS architecture
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     // PS3
00542     #elif (defined(__PPC__) || defined(__ppc__)) && defined(__PPU__)
00543         // Support native calling conventions on PS3
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         // PS3 doesn't have STDCALL
00551         #undef STDCALL
00552         #define STDCALL
00553 
00554     // Dreamcast
00555     #elif __SH4_SINGLE_ONLY__
00556         // Support native calling conventions on Dreamcast
00557         #define AS_DC
00558         #define AS_SH4
00559 
00560     // Wii JWC - Close to PS3 just no PPC_64 and AS_PS3
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     // Android
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 // Detect target hardware
00588 //------------------------------------------------
00589 
00590 // X86, Intel, AMD, etc, i.e. most PCs
00591 #if defined(__i386__) || defined(_M_IX86)
00592     // Nothing special here
00593 #endif
00594 
00595 // MIPS architecture (generally PS2 and PSP consoles, potentially supports N64 as well)
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 // PowerPC, e.g. Mac, GameCube, PS3, XBox 360, Wii
00602 #if defined(__PPC__) || defined(__ppc__) || defined(_PPC_) || defined(EPPC)
00603     #define AS_BIG_ENDIAN
00604 
00605     // Gamecube
00606     #if defined(_GC)
00607         #define AS_ALIGN
00608         #define AS_USE_DOUBLE_AS_FLOAT
00609     #endif
00610     // XBox 360
00611     #if (_XBOX_VER >= 200 )
00612         #define AS_ALIGN
00613     #endif
00614     // PS3
00615     #if defined(__PPU__)
00616         #define AS_ALIGN
00617     #endif
00618     // Wii
00619     #if defined(EPPC)
00620         #define AS_ALIGN
00621     #endif
00622 #endif
00623 
00624 // Dreamcast console
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 // Is the target a 64bit system?
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 // If there are no current support for native calling
00638 // conventions, then compile with AS_MAX_PORTABILITY
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 // If the form of threads to use hasn't been chosen
00646 // then the library will be compiled without support
00647 // for multithreading
00648 #if !defined(AS_POSIX_THREADS) && !defined(AS_WINDOWS_THREADS)
00649     #define AS_NO_THREADS
00650 #endif
00651 
00652 
00653 // The assert macro
00654 #include <assert.h>
00655 #define asASSERT(x) assert(x)
00656 
00657 
00658 
00659 //
00660 // Internal defines (do not change these)
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 // This macro is used to avoid warnings about unused variables.
00689 // Usually where the variables are only used in debug mode.
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

Generated on Mon Jan 11 12:03:40 2010 for Werewolf by  doxygen 1.6.1