Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix: correct trace mask checking
[simgrid.git] / src / win32 / compiler / visualc.h
1 #ifndef __XBT_VISUALC_COMPILER_CONFIG_H__
2 #define __XBT_VISUALC_COMPILER_CONFIG_H__
3
4 /* borland.h - simgrid config for Borland C++ Builder   */
5
6 /* Copyright (c) 2003, 2004 Cherier Malek. All rights reserved.            */
7
8 /* This program is free software; you can redistribute it and/or modify it
9  * under the terms of the license (GNU LGPL) which comes with this package. */
10
11 /*
12  *  Borland C++ compiler configuration
13  */
14
15 #include <win32/platform/select_platform_features.h>
16
17 #ifdef _WIN32_WINNT
18         #if _WIN32_WINNT < 0x0400
19                 #undef _WIN32_WINNT
20                 #define _WIN32_WINNT 0x0400
21         #endif
22 #else
23         #define _WIN32_WINNT 0x0400     
24 #endif
25
26 /* 
27  * include files. 
28  */
29
30 /* No <dlfcn.h> header file. */
31 #if defined(HAVE_DLFCN_H)
32         #undef HAVE_DLFCN_H
33 #endif 
34
35 /* Defined if the compiler has the <errno.h> header file. */
36 #if !defined(HAVE_ERRNO_H)
37         #define HAVE_ERRNO_H            1
38 #endif
39
40 /* No <execinfo.h> header file. */
41 #if defined(HAVE_EXECINFO_H)
42         #undef HAVE_EXECINFO_H
43 #endif
44
45 /* No <inttypes.h> header file. */
46 #if defined(HAVE_INTTYPES_H)
47         #undef HAVE_INTTYPES_H
48 #endif
49
50 /* Defined if compiler has the <memory.h> header file. */
51 #if !defined(HAVE_MEMORY_H)
52         #define HAVE_MEMORY_H           1
53 #endif
54
55 /* No <pthread.h> header file. */
56 #if defined(HAVE_PTHREAD_H)
57         #undef HAVE_PTHREAD_H
58 #endif
59
60
61 /* No <stdint.h> header file. */
62 #if defined(HAVE_STDINT_H)
63         #undef HAVE_STDINT_H
64 #endif
65
66 /* The compiler has the <stdlib.h> header file. */
67 #if !defined(HAVE_STDLIB_H)
68         #define HAVE_STDLIB_H           1
69 #endif
70
71 /* No <strings.h> header file. */
72 #if defined(HAVE_STRINGS_H)
73         #undef HAVE_STRINGS_H
74 #endif
75
76 /* The compiler has the <string.h> header file. */
77 #if !defined(HAVE_STRING_H)
78         #define HAVE_STRING_H           1
79 #endif
80
81 /* No <sys/socket.h> header file. */
82 #if defined(HAVE_SYS_SOCKET_H)
83         #undef HAVE_SYS_SOCKET_H
84 #endif
85
86 /* The compiler has <sys/stat.h> header file. */
87 #if !defined(HAVE_SYS_STAT_H)
88         #define HAVE_SYS_STAT_H         1
89 #endif
90
91 /* No <sys/time.h> header file. */
92 #if defined(HAVE_SYS_TIME_H)
93         #undef HAVE_SYS_TIME_H          1
94 #endif
95
96 /* The compiler has the <sys/types.h> header file. */
97 #if !defined(HAVE_SYS_TYPES_H)
98         #define HAVE_SYS_TYPES_H        1
99 #endif
100
101 /* No <unistd.h> header file. */
102 #if defined(HAVE_UNISTD_H)
103         #undef HAVE_UNISTD_H    
104 #endif
105
106 /* 
107  * The compiler has the <windows.h> header file. 
108  * Process the case of afx.h
109 */
110 #if !defined(HAVE_WINDOWS_H)
111         #define HAVE_WINDOWS_H          1
112 #endif
113
114 /* The compiler has the <winsock2.h> header file. */
115 #if !defined(HAVE_WINSOCK2_H)
116         #define HAVE_WINSOCK2_H
117 #endif
118
119 /*  
120  * The compiler has the <winsock.h> header file.
121  * Trouble if winsock2.h exists ?  
122  */
123 #if !defined(HAVE_WINSOCK_H)
124         #define HAVE_WINSOCK_H  1
125 #endif
126
127 /* The compiler has the <signal.h> header file */
128 #if !defined(HAVE_SIGNAL_H)
129         #define HAVE_SIGNAL_H   1
130 #endif
131
132 /* 
133  * functions.
134  */
135
136 /* No `getcontext' function. */
137 #if defined(HAVE_GETCONTEXT)
138         #undef HAVE_GETCONTEXT
139 #endif
140
141 /* No `getdtablesize' function. */
142 #if defined(HAVE_GETDTABLESIZE)
143         #undef HAVE_GETDTABLESIZE
144 #endif
145
146 /* No `gettimeofday' function. */
147 #if defined(HAVE_GETTIMEOFDAY)
148         #undef HAVE_GETTIMEOFDAY
149 #endif
150
151 /* No `makecontext' function. */
152 #if defined(HAVE_MAKECONTEXT)
153         #undef HAVE_MAKECONTEXT
154 #endif
155
156 /* No 'popen' function. */
157 #if defined(HAVE_POPEN)
158         #undef HAVE_POPEN
159 #endif
160
161 /* No `readv' function. */
162 #if defined(HAVE_READV)
163         #undef HAVE_READV
164 #endif
165
166 /* No `setcontext' function. */
167 #if defined(HAVE_SETCONTEXT)
168         #undef HAVE_SETCONTEXT
169 #endif
170
171 /* No 'signal' function */
172 #if defined(HAVE_SIGNAL)
173         #undef HAVE_SIGNAL
174 #endif
175
176 /* "disable the snprintf replacement ( this function is broken on system v only" */
177
178
179
180 #ifdef PREFER_PORTABLE_SNPRINTF
181 # undef PREFER_PORTABLE_SNPRINTF        1       
182 #endif
183
184
185 /* The compiler has `snprintf' function. */
186 #if _MSC_VER >= 1400 
187 #  ifndef HAVE_SNPRINTF
188 #    define HAVE_SNPRINTF       1
189 #    ifndef PREFER_PORTABLE_SNPRINTF
190 #      define snprintf _snprintf
191 #    endif
192 #  endif
193 #else 
194 #  ifdef HAVE_SNPRINTF
195         #undef HAVE_SNPRINTF
196 #  endif
197 #endif
198
199
200
201 /* No `swapcontext' function. */
202 #if defined(HAVE_SWAPCONTEXT)
203         #undef HAVE_SWAPCONTEXT
204 #endif
205
206 /* No `sysconf' function. */
207 #if defined(HAVE_SYSCONF)
208         #undef HAVE_SYSCONF
209 #endif
210
211 /* No `usleep' function. */
212 #if defined(HAVE_USLEEP)
213         #undef HAVE_USLEEP
214 #endif
215
216 /* The compiler has the `vsnprintf' function. */
217 #ifndef HAVE_VSNPRINTF
218         #define HAVE_VSNPRINTF  1
219 #endif
220
221
222 /* disable the asprintf replacement */
223 #ifndef NEED_ASPRINTF
224         #define NEED_ASPRINTF   
225 #endif
226
227
228 /* disable the vasprintf replacement */
229 #ifndef NEED_VASPRINTF
230         #define NEED_VASPRINTF
231 #endif
232
233 /* The maximal size of any scalar on this arch */
234 #if !defined(SIZEOF_MAX)
235         #define SIZEOF_MAX 8
236 #endif
237
238 /* Define to 1 if you have the ANSI C header files. */
239 #if !defined(STDC_HEADERS)
240         #define STDC_HEADERS 1
241 #endif
242
243 #if defined(TIME_WITH_SYS_TIME)
244         #undef TIME_WITH_SYS_TIME 
245 #endif
246
247 /* 
248  * libraries
249  */
250
251 /* Define to 1 if you have the `pthread' library (-lpthread). */
252 #if defined(HAVE_LIBPTHREAD)
253         #undef HAVE_LIBPTHREAD
254 #endif
255
256 /* 
257  * package informations ?
258  */
259  
260  
261 /* Defined if arrays in struct can straddle struct alignment boundaries. This
262 is like than the structure compaction above, but this time, the argument to
263 be compacted is an array whom each element would be normally compacted.
264 Exemple: struct s { double d; int i; char c[6]; }; Arrays can straddle if c
265 is allowed to come just after i. Note that GRAS only support architecture
266 presenting this caracteristic so far. */
267
268 #if defined(GRAS_ARRAY_STRADDLE_STRUCT)
269         #undef GRAS_ARRAY_STRADDLE_STRUCT
270 #endif
271
272 /* Defined if structures are compacted when possible. Consider this structure:
273 struct s {double d; int i; char c;}; If it is allowed, the char is placed
274 just after the int. If not, it has to be on the 8 bytes boundary imposed by
275 the double. For now, GRAS requires the structures to be compacted. */
276 #if defined(GRAS_STRUCT_COMPACT)
277         #undef GRAS_STRUCT_COMPACT
278 #endif
279
280 /* Name of package */
281 #define PACKAGE "simgrid"
282
283 /* Define to the address where bug reports for this package should be sent. */
284 #define PACKAGE_BUGREPORT "simgrid-devel@lists.gforge.inria.fr"
285
286 /* Define to the full name of this package. */
287 #define PACKAGE_NAME "simgrid"
288
289 /* Define to the full name and version of this package. */
290 #define PACKAGE_STRING "simgrid 3.1.1-cvs"
291
292 /* Define to the one symbol short name of this package. */
293 #define PACKAGE_TARNAME "simgrid"
294
295 /* Define to the version of this package. */
296 #define PACKAGE_VERSION "3.1.1-cvs"
297
298 /* 
299  * macro
300  */
301  
302  /* define if big endian */
303 #if !defined(GRAS_BIGENDIAN)
304         #define GRAS_BIGENDIAN 0
305 #endif
306
307 /* Defined if structures are compacted when possible. Consider this structure:
308 struct s {double d; int i; char c;}; If it is allowed, the char is placed
309 just after the int. If not, it has to be on the 8 bytes boundary imposed by
310 the double. For now, GRAS requires the structures to be compacted. */
311 #if defined(GRAS_STRUCT_COMPACT)
312         #define GRAS_STRUCT_COMPACT 1
313 #endif
314
315 /* defines the GRAS architecture signature of this machine */
316 #if defined(GRAS_THISARCH)
317         #undef GRAS_THISARCH
318 #endif
319
320 #define GRAS_THISARCH 3
321
322  
323  /* Path to the addr2line tool */
324 #if defined(ADDR2LINE)
325         #undef ADDR2LINE
326 #endif
327
328 #if !defined(HAVE_VA_COPY)
329         #define HAVE_VA_COPY 1
330 #endif
331
332 /* This macro is not defined in borland stdarg.h include file, adds it. */
333 #define va_copy(dest,src)   ((dest)=(src))  
334
335 /* Predefined possible va_copy() implementation (id: ASP) */
336 #define __VA_COPY_USE_ASP(d, s) do { *(d) = *(s); } while (0)
337
338 /* Predefined possible va_copy() implementation (id: ASS) */
339 #define __VA_COPY_USE_ASS(d, s) do { (d) = (s); } while (0)
340
341 /* Predefined possible va_copy() implementation (id: C99) */
342 #define __VA_COPY_USE_C99(d, s) va_copy((d), (s))
343
344 /* Predefined possible va_copy() implementation (id: CPP) */
345 #define __VA_COPY_USE_CPP(d, s) memcpy((void *)(d), (void *)(s)), sizeof(*(s))
346
347 /* Predefined possible va_copy() implementation (id: CPS) */
348 #define __VA_COPY_USE_CPS(d, s) memcpy((void *)&(d), (void *)&(s)), sizeof((s))
349
350 /* Predefined possible va_copy() implementation (id: GCB) */
351 #define __VA_COPY_USE_GCB(d, s) __builtin_va_copy((d), (s))
352
353 /* Predefined possible va_copy() implementation (id: GCH) */
354 #define __VA_COPY_USE_GCH(d, s) __va_copy((d), (s))
355
356 /* Predefined possible va_copy() implementation (id: GCM) */
357 #define __VA_COPY_USE_GCM(d, s) VA_COPY((d), (s))
358
359
360 /* Optional va_copy() implementation activation */
361 #ifndef HAVE_VA_COPY
362 #define va_copy(d, s) __VA_COPY_USE(d, s)
363 #endif
364
365 /* xbt contexts are based on our threads implementation */
366 #ifndef CONTEXT_THREADS
367 #define CONTEXT_THREADS 1
368 #endif
369
370 /* xbt contexts are not based on ucontext */
371 #ifdef CONTEXT_UCONTEXT
372 #undef CONTEXT_UCONTEXT
373 #endif
374
375 /* Define to id of used va_copy() implementation */
376 #define __VA_COPY_USE __VA_COPY_USE_C99
377
378 #ifndef _XBT_CALL
379         #if defined(_XBT_DESIGNATED_DLL)
380                 #define _XBT_CALL __cdecl __export
381         #elif defined(_RTLDLL)
382                 #define  _XBT_CALL __cdecl __import
383         #else
384                 #define  _XBT_CALL __cdecl
385         #endif
386 #endif
387
388 /* auto enable thread safety and exceptions: */
389 #ifndef _CPPUNWIND
390         #define _XBT_HAS_NO_EXCEPTIONS
391 #endif
392
393 #if defined ( __MT__ ) && !defined (_NOTHREADS) && !defined (_REENTRANT)
394         #define _REENTRANT 1
395 #endif
396
397
398 /* For open, read etc. file operations. */
399 #include <io.h>
400 #include <fcntl.h>
401
402 /* For getpid() function. */
403 #include <process.h>
404
405 /* no unistd.h header file. */
406 #define YY_NO_UNISTD_H 
407 /*
408  * Replace winsock2.h,ws2tcpip.h and winsock.h header files */
409 #include <windows.h>
410
411
412 /* Choose setjmp as exception implementation */
413 #ifndef __EX_MCTX_SJLJ__
414 #define __EX_MCTX_SJLJ__
415 #endif 
416
417
418
419 #include <sys/stat.h>
420
421 #define S_IWUSR _S_IWRITE
422 #define S_IRUSR _S_IREAD
423
424
425 /* Visual C++ does not declare the ssize_t type */
426 typedef int ssize_t;
427
428 /* Visual C++ does not declare the mode_t type */
429 typedef unsigned int mode_t;
430
431 /* Visual C++ does not declare the uint32_t type */
432 typedef unsigned int uint32_t;
433
434
435 #endif /* #ifndef __XBT_VISUALC_COMPILER_CONFIG_H__ */