FEDRA emulsion software from the OPERA Collaboration
im_env.h
Go to the documentation of this file.
1 /*******************************************************************
2  *
3  * COPYRIGHT (c) 2000 Matrox Electronic Systems Ltd.
4  * All Rights Reserved
5  *
6  *******************************************************************/
7 
8 #ifndef __IM_ENV_H__
9 #define __IM_ENV_H__
10 
11 
12 #if !defined(_IM_LOCAL_CODE) && defined(SHOW_INCLUDE_FILE)
13 #pragma message ("#include "__FILE__)
14 #endif
15 
16 // Need auto-config ?
17 #if (defined(__IMAPI_H__) || defined(__IMAGE2_H__)) && !defined(_IM_HOST_OS_NT) && !defined(_IM_LOCAL_CODE)
18 // Auto-config compiler settings because no known compile mode setting defines
19 
20 #define PROD_NAME "ODYSSEY"
21 
22 
23 #if defined(__GNUC__) && defined(__i386__)
24 
25 #ifndef _IM_COMP_GNUC
26 #define _IM_COMP_GNUC
27 #endif
28 
29 #ifndef _IM_HOST_X86_CODE
30 #define _IM_HOST_X86_CODE
31 #endif
32 
33 #if !defined(I_UNIX)
34 #define I_UNIX
35 #endif
36 
37 #define _IM_HOST_CODE
38 
39 #if defined(__LINUX__)
40 
41 #ifndef _IM_HOST_OS_LINUX
42 #define _IM_HOST_OS_LINUX
43 #endif
44 
45 #elif defined(__NTO__)
46 
47 #ifndef _IM_HOST_OS_NTO
48 #define _IM_HOST_OS_NTO
49 #endif
50 
51 #endif
52 
53 #elif defined(_MSC_VER)
54 
55 #define _IM_COMP_MICROSOFT
56 #define _IM_HOST_X86_CODE
57 #define _IM_HOST_OS_NT
58 #define _IM_HOST_CODE
59 #if !defined(_X86_)
60 #define _X86_
61 #endif
62 #if !defined(NT)
63 #define NT
64 #endif
65 #if !defined(WIN)
66 #define WIN
67 #endif
68 #if !defined(WIN32)
69 #define WIN32
70 #endif
71 
72 #elif defined(__MWERKS__)
73 
74 #define _IM_COMP_PPC
75 #define _IM_LOCAL_CODE
76 
77 #endif // End compiler choice
78 
79 #endif // End auto-config
80 
81 
82 #if !defined(__IMAPI_H__) && !defined(__IMAGE2_H__)
83 /* In some case im_env.h is included alone.
84  * Neither by imapi.h and image2.h.
85  * Be sure to define the proper packing in that case.
86  * push & pop are not required for this special case.
87  */
88 
89 #if defined(_IM_COMP_WATCOM) || defined(_IM_COMP_GNUC) || defined(_IM_COMP_MICROSOFT)
90 #pragma pack( 1 )
91 #endif
92 
93 #endif
94 
95 #ifndef INLINE_FUNCTION
96 #if defined(_IM_COMP_MICROSOFT)
97 #define INLINE_FUNCTION __inline
98 
99 typedef __int64 LONGLONG;
100 typedef unsigned __int64 ULONGLONG;
101 
102 #if defined(_IM_COMP_MIL_PA)
103 #undef double
104 #define double __int64
105 #endif
106 
107 #if defined(_IM_COMP_MIL_PA_NO_INLINE)
108 #undef INLINE_FUNCTION
109 #define INLINE_FUNCTION
110 #endif
111 
112 #elif defined(_IM_COMP_WATCOM)
113 #define INLINE_FUNCTION inline
114 
115 #elif defined(_IM_LOCAL_CODE) && defined(__HIGHC__)
116 #define INLINE_FUNCTION _Inline
117 typedef long long LONGLONG;
118 typedef unsigned long long ULONGLONG;
119 
120 #elif defined(_IM_LOCAL_CODE) && defined(__MWERKS__)
121 #define INLINE_FUNCTION inline
122 typedef long long LONGLONG;
123 typedef unsigned long long ULONGLONG;
124 
125 #elif defined(_IM_COMP_GNUC)
126 
127 #if defined(__NTO__)
128 #define INLINE_FUNCTION inline
129 #elif defined(_IM_HOST_OS_LINUX_DRIVER)
130 #define INLINE_FUNCTION static inline
131 #else
132 #define INLINE_FUNCTION __inline
133 #endif
134 
135 //typedef long long LONGLONG;
136 //typedef unsigned long long ULONGLONG;
137 
138 #else
139 #define INLINE_FUNCTION inline
140 #endif
141 #endif
142 
143 
144 #ifndef ASM_FUNCTION
145 #if defined(__MWERKS__)
146 #define ASM_FUNCTION asm
147 #define FORCE_DATA_IN_TEXT_SECTION __declspec(section ".text") extern
148 #define INTERRUPT_FUNCTION
149 
150 #elif defined(__HIGHC__)
151 #define ASM_FUNCTION
152 /* #define FORCE_DATA_IN_TEXT_SECTION __declspec(section ".text") extern */
153 #define INTERRUPT_FUNCTION _Interrupt
154 #define FORCE_DATA_IN_TEXT_SECTION extern
155 #ifdef __ALTIVEC
156 #undef __ALTIVEC
157 #endif
158 #include <ppc/asm.h>
159 
160 #else
161 #define ASM_FUNCTION
162 #define FORCE_DATA_IN_TEXT_SECTION extern
163 #define INTERRUPT_FUNCTION
164 
165 #endif
166 #endif
167 
168 /* NT OS */
169 #if defined(_IM_HOST_OS_NT)
170 #include <im_nt.h>
171 
172 /* PPC OS */
173 #elif defined(_IM_LOCAL_CODE)
174 #include <im_ppc.h>
175 
176 /* LINUX OS */
177 #elif defined(_IM_HOST_OS_LINUX)
178 #include <im_linux.h>
179 
180 /* NEUTRINO OS */
181 #elif defined(_IM_HOST_OS_NTO)
182 #include <im_nto.h>
183 
184 /* Error Condition */
185 #else
186 #error IM_WARNING: Operating system and/or processor type not specified (Refer to image2.h header for compiler switch settings!)
187 #endif
188 
189 
190 #if defined(I_UNIX)
191 #define DIRECTORY_SEPARATOR "/"
192 #define PATHSEPARATOR ":"
193 #else
194 #define DIRECTORY_SEPARATOR "\\"
195 #define PATHSEPARATOR ";"
196 #endif
197 
198 #endif /* __IM_ENV_H__ */