| [17] | 1 | /*
|
|---|
| 2 | * ODIN - Build Environment Definition
|
|---|
| 3 | *
|
|---|
| [774] | 4 | * Copyright (C) 1999 Patrick Haller <phaller@gmx.net>
|
|---|
| 5 | *
|
|---|
| 6 | * ------------------------------------------------------------
|
|---|
| 7 | * Note: Only compiler linkage definitions and similar stuff
|
|---|
| 8 | * goes here. Nothing else.
|
|---|
| 9 | * ------------------------------------------------------------
|
|---|
| 10 | *
|
|---|
| [17] | 11 | */
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | #ifndef _ODIN_H_
|
|---|
| 15 | #define _ODIN_H_
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| [774] | 18 | /***********************************
|
|---|
| 19 | * Compiler Environment Definition *
|
|---|
| 20 | ***********************************/
|
|---|
| [17] | 21 |
|
|---|
| [31] | 22 | #ifdef CDECL
|
|---|
| 23 | # undef CDECL
|
|---|
| 24 | #endif
|
|---|
| 25 |
|
|---|
| 26 | #ifdef EXPORT
|
|---|
| 27 | # undef EXPORT
|
|---|
| 28 | #endif
|
|---|
| 29 |
|
|---|
| 30 | #ifdef WIN32API
|
|---|
| 31 | # undef WIN32API
|
|---|
| 32 | #endif
|
|---|
| 33 |
|
|---|
| 34 | #ifdef SYSTEM
|
|---|
| 35 | # undef SYSTEM
|
|---|
| 36 | #endif
|
|---|
| 37 |
|
|---|
| 38 | #ifdef PASCAL
|
|---|
| 39 | # undef PASCAL
|
|---|
| 40 | #endif
|
|---|
| 41 |
|
|---|
| 42 | #ifdef UNALIGNED
|
|---|
| 43 | # undef UNALIGNED
|
|---|
| 44 | #endif
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| [17] | 47 | /* ---------- WATCOM C ---------- */
|
|---|
| 48 | #ifdef __WATCOMC__
|
|---|
| 49 | #define CDECL _cdecl
|
|---|
| 50 | #define EXPORT _export
|
|---|
| 51 | #define WIN32API __stdcall
|
|---|
| [488] | 52 | #define WINAPI __stdcall
|
|---|
| [5288] | 53 | #define SYSTEM _System
|
|---|
| [5148] | 54 | #define PASCAL __stdcall
|
|---|
| [6102] | 55 | #define INLINE inline /* is this allowed for C too? */
|
|---|
| [31] | 56 | #define UNALIGNED
|
|---|
| [6102] | 57 | #define __attribute__(x)
|
|---|
| [5288] | 58 |
|
|---|
| 59 | //MN: For some strange reason Watcom doesn't define these for C++!
|
|---|
| 60 | // This is not the best place to define them though.
|
|---|
| 61 | #ifdef __cplusplus
|
|---|
| 62 | #define min(a,b) (((a) < (b)) ? (a) : (b))
|
|---|
| 63 | #define max(a,b) (((a) > (b)) ? (a) : (b))
|
|---|
| 64 | #endif
|
|---|
| 65 |
|
|---|
| [17] | 66 | #else
|
|---|
| 67 |
|
|---|
| 68 | /* ---------- GCC/EMX ---------- */
|
|---|
| 69 | #ifdef __GNUC__
|
|---|
| [6102] | 70 | #if defined(__GNUC__) && (__GNUC__ <= 2) && (__GNUC_MINOR__ < 7)
|
|---|
| 71 | #error You need gcc >= 2.7 to build Odin32
|
|---|
| 72 | #endif
|
|---|
| 73 | #if !defined(__stdcall__) /* this is also defined in windef.h if !defined(WIN32OS2) */
|
|---|
| 74 | #define __stdcall __attribute__((__stdcall__))
|
|---|
| 75 | #define __cdecl __attribute__((__cdecl__))
|
|---|
| 76 | #endif
|
|---|
| [17] | 77 | #define CDECL _cdecl
|
|---|
| 78 | #define EXPORT _export
|
|---|
| 79 | #define WIN32API __stdcall
|
|---|
| [488] | 80 | #define WINAPI __stdcall
|
|---|
| [17] | 81 | #define SYSTEM __stdcall
|
|---|
| [5148] | 82 | #define PASCAL __stdcall
|
|---|
| [6102] | 83 | #define INLINE __inline__
|
|---|
| [31] | 84 | #define UNALIGNED
|
|---|
| [5518] | 85 | #define NONAMELESSUNION
|
|---|
| 86 | #define NONAMELESSSTRUCT
|
|---|
| [17] | 87 | #else
|
|---|
| 88 |
|
|---|
| 89 | /* ---------- VAC ---------- */
|
|---|
| 90 | #if (defined(__IBMCPP__) || defined(__IBMC__))
|
|---|
| [6102] | 91 |
|
|---|
| [17] | 92 | #define CDECL __cdecl
|
|---|
| 93 | #define EXPORT _Export
|
|---|
| 94 | #define WIN32API __stdcall
|
|---|
| [488] | 95 | #define WINAPI __stdcall
|
|---|
| [17] | 96 | #define SYSTEM _System
|
|---|
| [5148] | 97 | #define PASCAL __stdcall
|
|---|
| [17] | 98 | #define UNALIGNED
|
|---|
| [6102] | 99 | #ifndef __cplusplus
|
|---|
| 100 | #define INLINE _Inline
|
|---|
| 101 | #define inline INLINE
|
|---|
| 102 | #else
|
|---|
| 103 | #define INLINE inline
|
|---|
| 104 | #endif
|
|---|
| 105 | #define __inline__ INLINE
|
|---|
| 106 | #define __attribute__(x)
|
|---|
| [1007] | 107 |
|
|---|
| [6102] | 108 |
|
|---|
| [2694] | 109 | #ifndef RC_INVOKED
|
|---|
| [5925] | 110 | //Nameless unions or structures are not supported in C mode
|
|---|
| 111 | //(nameless unions only in CPP mode and nameless unions only in VAC 3.6.5 CPP mode)
|
|---|
| 112 | #ifdef __IBMC__
|
|---|
| [785] | 113 | #define NONAMELESSUNION
|
|---|
| [5925] | 114 | #define NONAMELESSSTRUCT
|
|---|
| [3354] | 115 | #endif
|
|---|
| [5925] | 116 | #if (__IBMCPP__ == 300)
|
|---|
| [5518] | 117 | #define NONAMELESSSTRUCT
|
|---|
| 118 | #endif
|
|---|
| [2694] | 119 | #endif
|
|---|
| [883] | 120 |
|
|---|
| [3354] | 121 | #ifndef RC_INVOKED
|
|---|
| [883] | 122 | #include <builtin.h>
|
|---|
| [3354] | 123 | #endif
|
|---|
| [883] | 124 |
|
|---|
| [17] | 125 | #else
|
|---|
| [5518] | 126 | #ifdef RC_INVOKED
|
|---|
| 127 | //SvL: wrc chokes on calling conventions....
|
|---|
| [6102] | 128 | #define CDECL
|
|---|
| 129 | #define EXPORT
|
|---|
| 130 | #define WIN32API
|
|---|
| 131 | #define WINAPI
|
|---|
| 132 | #define CALLBACK
|
|---|
| 133 | #define SYSTEM
|
|---|
| 134 | #define PASCAL
|
|---|
| [5518] | 135 | #define UNALIGNED
|
|---|
| 136 | #define __cdecl
|
|---|
| 137 | #define _System
|
|---|
| [6102] | 138 | #define __inline__
|
|---|
| 139 | #define INLINE
|
|---|
| [5518] | 140 | #else
|
|---|
| [17] | 141 | /* ---------- ??? ---------- */
|
|---|
| 142 | #error No known compiler.
|
|---|
| 143 | #endif
|
|---|
| 144 | #endif
|
|---|
| 145 | #endif
|
|---|
| [2349] | 146 | #endif
|
|---|
| [17] | 147 |
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 | #endif /* _ODIN_H_*/
|
|---|
| 151 |
|
|---|