source: trunk/include/odin.h@ 6102

Last change on this file since 6102 was 6102, checked in by bird, 24 years ago

Inline definitions. EMX updated and more like working. attribute_ for none GNU compilers.

File size: 3.1 KB
Line 
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 #define INLINE inline /* is this allowed for C too? */
56 #define UNALIGNED
57 #define __attribute__(x)
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
66#else
67
68/* ---------- GCC/EMX ---------- */
69#ifdef __GNUC__
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
77 #define CDECL _cdecl
78 #define EXPORT _export
79 #define WIN32API __stdcall
80 #define WINAPI __stdcall
81 #define SYSTEM __stdcall
82 #define PASCAL __stdcall
83 #define INLINE __inline__
84 #define UNALIGNED
85 #define NONAMELESSUNION
86 #define NONAMELESSSTRUCT
87#else
88
89/* ---------- VAC ---------- */
90#if (defined(__IBMCPP__) || defined(__IBMC__))
91
92 #define CDECL __cdecl
93 #define EXPORT _Export
94 #define WIN32API __stdcall
95 #define WINAPI __stdcall
96 #define SYSTEM _System
97 #define PASCAL __stdcall
98 #define UNALIGNED
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)
107
108
109#ifndef RC_INVOKED
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__
113 #define NONAMELESSUNION
114 #define NONAMELESSSTRUCT
115 #endif
116 #if (__IBMCPP__ == 300)
117 #define NONAMELESSSTRUCT
118 #endif
119#endif
120
121#ifndef RC_INVOKED
122 #include <builtin.h>
123#endif
124
125#else
126#ifdef RC_INVOKED
127 //SvL: wrc chokes on calling conventions....
128 #define CDECL
129 #define EXPORT
130 #define WIN32API
131 #define WINAPI
132 #define CALLBACK
133 #define SYSTEM
134 #define PASCAL
135 #define UNALIGNED
136 #define __cdecl
137 #define _System
138 #define __inline__
139 #define INLINE
140#else
141/* ---------- ??? ---------- */
142#error No known compiler.
143#endif
144#endif
145#endif
146#endif
147
148
149
150#endif /* _ODIN_H_*/
151
Note: See TracBrowser for help on using the repository browser.