source: trunk/include/odin.h@ 10010

Last change on this file since 10010 was 9985, checked in by sandervl, 22 years ago

PF: header updates

File size: 3.2 KB
RevLine 
[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
[6906]55 #ifdef __cplusplus
56 #define INLINE inline
57 #else
58 #define INLINE __inline
59 #define inline __inline
60 #endif
[31]61 #define UNALIGNED
[6102]62 #define __attribute__(x)
[5288]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
[17]71#else
72
73/* ---------- GCC/EMX ---------- */
74#ifdef __GNUC__
[9985]75 #if defined(__GNUC__) && (__GNUC__ <= 3) && (__GNUC_MINOR__ < 2)
76 #error You need gcc >= 3.2 to build Odin32
[6102]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
[17]82 #define CDECL _cdecl
83 #define EXPORT _export
84 #define WIN32API __stdcall
[488]85 #define WINAPI __stdcall
[9985]86 #define SYSTEM CDECL
[5148]87 #define PASCAL __stdcall
[6102]88 #define INLINE __inline__
[31]89 #define UNALIGNED
[5518]90 #define NONAMELESSUNION
91 #define NONAMELESSSTRUCT
[9985]92 #undef APIENTRY
93 #define APIENTRY CDECL
94
[17]95#else
96
97/* ---------- VAC ---------- */
98#if (defined(__IBMCPP__) || defined(__IBMC__))
[6102]99
[17]100 #define CDECL __cdecl
101 #define EXPORT _Export
102 #define WIN32API __stdcall
[488]103 #define WINAPI __stdcall
[17]104 #define SYSTEM _System
[5148]105 #define PASCAL __stdcall
[17]106 #define UNALIGNED
[6102]107 #ifndef __cplusplus
108 #define INLINE _Inline
109 #define inline INLINE
110 #else
111 #define INLINE inline
112 #endif
113 #define __inline__ INLINE
114 #define __attribute__(x)
[1007]115
[6102]116
[2694]117#ifndef RC_INVOKED
[5925]118 //Nameless unions or structures are not supported in C mode
119 //(nameless unions only in CPP mode and nameless unions only in VAC 3.6.5 CPP mode)
120 #ifdef __IBMC__
[785]121 #define NONAMELESSUNION
[5925]122 #define NONAMELESSSTRUCT
[3354]123 #endif
[5925]124 #if (__IBMCPP__ == 300)
[5518]125 #define NONAMELESSSTRUCT
126 #endif
[2694]127#endif
[883]128
[3354]129#ifndef RC_INVOKED
[883]130 #include <builtin.h>
[3354]131#endif
[883]132
[17]133#else
[5518]134#ifdef RC_INVOKED
135 //SvL: wrc chokes on calling conventions....
[6102]136 #define CDECL
137 #define EXPORT
138 #define WIN32API
139 #define WINAPI
140 #define CALLBACK
141 #define SYSTEM
142 #define PASCAL
[5518]143 #define UNALIGNED
144 #define __cdecl
145 #define _System
[6102]146 #define __inline__
147 #define INLINE
[5518]148#else
[17]149/* ---------- ??? ---------- */
150#error No known compiler.
151#endif
152#endif
153#endif
[2349]154#endif
[17]155
156
157
158#endif /* _ODIN_H_*/
159
Note: See TracBrowser for help on using the repository browser.