| 1 | /* | 
|---|
| 2 | * ODIN - Build Environment Definition | 
|---|
| 3 | * | 
|---|
| 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 | * | 
|---|
| 11 | */ | 
|---|
| 12 |  | 
|---|
| 13 |  | 
|---|
| 14 | #ifndef _ODIN_H_ | 
|---|
| 15 | #define _ODIN_H_ | 
|---|
| 16 |  | 
|---|
| 17 |  | 
|---|
| 18 | /*********************************** | 
|---|
| 19 | * Compiler Environment Definition * | 
|---|
| 20 | ***********************************/ | 
|---|
| 21 |  | 
|---|
| 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 |  | 
|---|
| 47 | /* ---------- WATCOM C ---------- */ | 
|---|
| 48 | #ifdef __WATCOMC__ | 
|---|
| 49 | #define CDECL     _cdecl | 
|---|
| 50 | #define EXPORT    _export | 
|---|
| 51 | #define WIN32API  __stdcall | 
|---|
| 52 | #define WINAPI    __stdcall | 
|---|
| 53 | #define SYSTEM    _System | 
|---|
| 54 | #define PASCAL    __stdcall | 
|---|
| 55 | #ifdef __cplusplus | 
|---|
| 56 | #define INLINE    inline | 
|---|
| 57 | #else | 
|---|
| 58 | #define INLINE    __inline | 
|---|
| 59 | #define inline    __inline | 
|---|
| 60 | #endif | 
|---|
| 61 | #define UNALIGNED | 
|---|
| 62 | #define __attribute__(x) | 
|---|
| 63 |  | 
|---|
| 64 | //MN: For some strange reason Watcom doesn't define these for C++! | 
|---|
| 65 | //    This is not the best place to define them though. | 
|---|
| 66 | #ifdef __cplusplus | 
|---|
| 67 | #define min(a,b)  (((a) < (b)) ? (a) : (b)) | 
|---|
| 68 | #define max(a,b)  (((a) > (b)) ? (a) : (b)) | 
|---|
| 69 | #endif | 
|---|
| 70 |  | 
|---|
| 71 | #else | 
|---|
| 72 |  | 
|---|
| 73 | /* ---------- GCC/EMX ---------- */ | 
|---|
| 74 | #ifdef __GNUC__ | 
|---|
| 75 | #if defined(__GNUC__) && (__GNUC__ <= 2) && (__GNUC_MINOR__ < 7) | 
|---|
| 76 | #error You need gcc >= 2.7 to build Odin32 | 
|---|
| 77 | #endif | 
|---|
| 78 | #if !defined(__stdcall__)             /* this is also defined in windef.h if !defined(WIN32OS2) */ | 
|---|
| 79 | #define __stdcall __attribute__((__stdcall__)) | 
|---|
| 80 | #define __cdecl   __attribute__((__cdecl__)) | 
|---|
| 81 | #endif | 
|---|
| 82 | #define CDECL     _cdecl | 
|---|
| 83 | #define EXPORT    _export | 
|---|
| 84 | #define WIN32API  __stdcall | 
|---|
| 85 | #define WINAPI    __stdcall | 
|---|
| 86 | #define SYSTEM    __stdcall | 
|---|
| 87 | #define PASCAL    __stdcall | 
|---|
| 88 | #define INLINE    __inline__ | 
|---|
| 89 | #define UNALIGNED | 
|---|
| 90 | #define NONAMELESSUNION | 
|---|
| 91 | #define NONAMELESSSTRUCT | 
|---|
| 92 | #else | 
|---|
| 93 |  | 
|---|
| 94 | /* ---------- VAC ---------- */ | 
|---|
| 95 | #if (defined(__IBMCPP__) || defined(__IBMC__)) | 
|---|
| 96 |  | 
|---|
| 97 | #define CDECL     __cdecl | 
|---|
| 98 | #define EXPORT    _Export | 
|---|
| 99 | #define WIN32API  __stdcall | 
|---|
| 100 | #define WINAPI    __stdcall | 
|---|
| 101 | #define SYSTEM    _System | 
|---|
| 102 | #define PASCAL    __stdcall | 
|---|
| 103 | #define UNALIGNED | 
|---|
| 104 | #ifndef __cplusplus | 
|---|
| 105 | #define INLINE  _Inline | 
|---|
| 106 | #define inline  INLINE | 
|---|
| 107 | #else | 
|---|
| 108 | #define INLINE  inline | 
|---|
| 109 | #endif | 
|---|
| 110 | #define __inline__ INLINE | 
|---|
| 111 | #define __attribute__(x) | 
|---|
| 112 |  | 
|---|
| 113 |  | 
|---|
| 114 | #ifndef RC_INVOKED | 
|---|
| 115 | //Nameless unions or structures are not supported in C mode | 
|---|
| 116 | //(nameless unions only in CPP mode and nameless unions only in VAC 3.6.5 CPP mode) | 
|---|
| 117 | #ifdef __IBMC__ | 
|---|
| 118 | #define NONAMELESSUNION | 
|---|
| 119 | #define NONAMELESSSTRUCT | 
|---|
| 120 | #endif | 
|---|
| 121 | #if (__IBMCPP__ == 300) | 
|---|
| 122 | #define NONAMELESSSTRUCT | 
|---|
| 123 | #endif | 
|---|
| 124 | #endif | 
|---|
| 125 |  | 
|---|
| 126 | #ifndef RC_INVOKED | 
|---|
| 127 | #include <builtin.h> | 
|---|
| 128 | #endif | 
|---|
| 129 |  | 
|---|
| 130 | #else | 
|---|
| 131 | #ifdef RC_INVOKED | 
|---|
| 132 | //SvL: wrc chokes on calling conventions.... | 
|---|
| 133 | #define CDECL | 
|---|
| 134 | #define EXPORT | 
|---|
| 135 | #define WIN32API | 
|---|
| 136 | #define WINAPI | 
|---|
| 137 | #define CALLBACK | 
|---|
| 138 | #define SYSTEM | 
|---|
| 139 | #define PASCAL | 
|---|
| 140 | #define UNALIGNED | 
|---|
| 141 | #define __cdecl | 
|---|
| 142 | #define _System | 
|---|
| 143 | #define __inline__ | 
|---|
| 144 | #define INLINE | 
|---|
| 145 | #else | 
|---|
| 146 | /* ---------- ??? ---------- */ | 
|---|
| 147 | #error No known compiler. | 
|---|
| 148 | #endif | 
|---|
| 149 | #endif | 
|---|
| 150 | #endif | 
|---|
| 151 | #endif | 
|---|
| 152 |  | 
|---|
| 153 |  | 
|---|
| 154 |  | 
|---|
| 155 | #endif /* _ODIN_H_*/ | 
|---|
| 156 |  | 
|---|