1 #ifndef __XBT_VISUALC_COMPILER_CONFIG_H__
2 #define __XBT_VISUALC_COMPILER_CONFIG_H__
4 /* borland.h - simgrid config for Borland C++ Builder */
6 /* Copyright (c) 2003, 2004 Cherier Malek. All rights reserved. */
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. */
12 * Borland C++ compiler configuration
15 #include <win32/platform/select_platform_features.h>
18 #if _WIN32_WINNT < 0x0400
20 #define _WIN32_WINNT 0x0400
23 #define _WIN32_WINNT 0x0400
30 /* No <dlfcn.h> header file. */
31 #if defined(HAVE_DLFCN_H)
35 /* Defined if the compiler has the <errno.h> header file. */
36 #if !defined(HAVE_ERRNO_H)
37 #define HAVE_ERRNO_H 1
40 /* No <execinfo.h> header file. */
41 #if defined(HAVE_EXECINFO_H)
42 #undef HAVE_EXECINFO_H
45 /* No <inttypes.h> header file. */
46 #if defined(HAVE_INTTYPES_H)
47 #undef HAVE_INTTYPES_H
50 /* Defined if compiler has the <memory.h> header file. */
51 #if !defined(HAVE_MEMORY_H)
52 #define HAVE_MEMORY_H 1
55 /* No <pthread.h> header file. */
56 #if defined(HAVE_PTHREAD_H)
61 /* No <stdint.h> header file. */
62 #if defined(HAVE_STDINT_H)
66 /* The compiler has the <stdlib.h> header file. */
67 #if !defined(HAVE_STDLIB_H)
68 #define HAVE_STDLIB_H 1
71 /* No <strings.h> header file. */
72 #if defined(HAVE_STRINGS_H)
76 /* The compiler has the <string.h> header file. */
77 #if !defined(HAVE_STRING_H)
78 #define HAVE_STRING_H 1
81 /* No <sys/socket.h> header file. */
82 #if defined(HAVE_SYS_SOCKET_H)
83 #undef HAVE_SYS_SOCKET_H
86 /* The compiler has <sys/stat.h> header file. */
87 #if !defined(HAVE_SYS_STAT_H)
88 #define HAVE_SYS_STAT_H 1
91 /* No <sys/time.h> header file. */
92 #if defined(HAVE_SYS_TIME_H)
93 #undef HAVE_SYS_TIME_H 1
96 /* The compiler has the <sys/types.h> header file. */
97 #if !defined(HAVE_SYS_TYPES_H)
98 #define HAVE_SYS_TYPES_H 1
101 /* No <unistd.h> header file. */
102 #if defined(HAVE_UNISTD_H)
107 * The compiler has the <windows.h> header file.
108 * Process the case of afx.h
110 #if !defined(HAVE_WINDOWS_H)
111 #define HAVE_WINDOWS_H 1
114 /* The compiler has the <winsock2.h> header file. */
115 #if !defined(HAVE_WINSOCK2_H)
116 #define HAVE_WINSOCK2_H
120 * The compiler has the <winsock.h> header file.
121 * Trouble if winsock2.h exists ?
123 #if !defined(HAVE_WINSOCK_H)
124 #define HAVE_WINSOCK_H 1
127 /* The compiler has the <signal.h> header file */
128 #if !defined(HAVE_SIGNAL_H)
129 #define HAVE_SIGNAL_H 1
136 /* No `getcontext' function. */
137 #if defined(HAVE_GETCONTEXT)
138 #undef HAVE_GETCONTEXT
141 /* No `getdtablesize' function. */
142 #if defined(HAVE_GETDTABLESIZE)
143 #undef HAVE_GETDTABLESIZE
146 /* No `gettimeofday' function. */
147 #if defined(HAVE_GETTIMEOFDAY)
148 #undef HAVE_GETTIMEOFDAY
151 /* No `makecontext' function. */
152 #if defined(HAVE_MAKECONTEXT)
153 #undef HAVE_MAKECONTEXT
156 /* No 'popen' function. */
157 #if defined(HAVE_POPEN)
161 /* No `readv' function. */
162 #if defined(HAVE_READV)
166 /* No `setcontext' function. */
167 #if defined(HAVE_SETCONTEXT)
168 #undef HAVE_SETCONTEXT
171 /* No 'signal' function */
172 #if defined(HAVE_SIGNAL)
176 /* "disable the snprintf replacement ( this function is broken on system v only" */
180 #ifdef PREFER_PORTABLE_SNPRINTF
181 # undef PREFER_PORTABLE_SNPRINTF 1
185 /* The compiler has `snprintf' function. */
187 # ifndef HAVE_SNPRINTF
188 # define HAVE_SNPRINTF 1
189 # ifndef PREFER_PORTABLE_SNPRINTF
190 # define snprintf _snprintf
194 # ifdef HAVE_SNPRINTF
201 /* No `swapcontext' function. */
202 #if defined(HAVE_SWAPCONTEXT)
203 #undef HAVE_SWAPCONTEXT
206 /* No `sysconf' function. */
207 #if defined(HAVE_SYSCONF)
211 /* No `usleep' function. */
212 #if defined(HAVE_USLEEP)
216 /* The compiler has the `vsnprintf' function. */
217 #ifndef HAVE_VSNPRINTF
218 #define HAVE_VSNPRINTF 1
222 /* disable the asprintf replacement */
223 #ifndef NEED_ASPRINTF
224 #define NEED_ASPRINTF
228 /* disable the vasprintf replacement */
229 #ifndef NEED_VASPRINTF
230 #define NEED_VASPRINTF
233 /* The maximal size of any scalar on this arch */
234 #if !defined(SIZEOF_MAX)
238 /* Define to 1 if you have the ANSI C header files. */
239 #if !defined(STDC_HEADERS)
240 #define STDC_HEADERS 1
243 #if defined(TIME_WITH_SYS_TIME)
244 #undef TIME_WITH_SYS_TIME
251 /* Define to 1 if you have the `pthread' library (-lpthread). */
252 #if defined(HAVE_LIBPTHREAD)
253 #undef HAVE_LIBPTHREAD
257 * package informations ?
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. */
268 #if defined(GRAS_ARRAY_STRADDLE_STRUCT)
269 #undef GRAS_ARRAY_STRADDLE_STRUCT
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
280 /* Name of package */
281 #define PACKAGE "simgrid"
283 /* Define to the address where bug reports for this package should be sent. */
284 #define PACKAGE_BUGREPORT "simgrid-devel@lists.gforge.inria.fr"
286 /* Define to the full name of this package. */
287 #define PACKAGE_NAME "simgrid"
289 /* Define to the full name and version of this package. */
290 #define PACKAGE_STRING "simgrid 3.1.1-cvs"
292 /* Define to the one symbol short name of this package. */
293 #define PACKAGE_TARNAME "simgrid"
295 /* Define to the version of this package. */
296 #define PACKAGE_VERSION "3.1.1-cvs"
302 /* define if big endian */
303 #if !defined(GRAS_BIGENDIAN)
304 #define GRAS_BIGENDIAN 0
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
315 /* defines the GRAS architecture signature of this machine */
316 #if defined(GRAS_THISARCH)
320 #define GRAS_THISARCH 3
323 /* Path to the addr2line tool */
324 #if defined(ADDR2LINE)
328 #if !defined(HAVE_VA_COPY)
329 #define HAVE_VA_COPY 1
332 /* This macro is not defined in borland stdarg.h include file, adds it. */
333 #define va_copy(dest,src) ((dest)=(src))
335 /* Predefined possible va_copy() implementation (id: ASP) */
336 #define __VA_COPY_USE_ASP(d, s) do { *(d) = *(s); } while (0)
338 /* Predefined possible va_copy() implementation (id: ASS) */
339 #define __VA_COPY_USE_ASS(d, s) do { (d) = (s); } while (0)
341 /* Predefined possible va_copy() implementation (id: C99) */
342 #define __VA_COPY_USE_C99(d, s) va_copy((d), (s))
344 /* Predefined possible va_copy() implementation (id: CPP) */
345 #define __VA_COPY_USE_CPP(d, s) memcpy((void *)(d), (void *)(s)), sizeof(*(s))
347 /* Predefined possible va_copy() implementation (id: CPS) */
348 #define __VA_COPY_USE_CPS(d, s) memcpy((void *)&(d), (void *)&(s)), sizeof((s))
350 /* Predefined possible va_copy() implementation (id: GCB) */
351 #define __VA_COPY_USE_GCB(d, s) __builtin_va_copy((d), (s))
353 /* Predefined possible va_copy() implementation (id: GCH) */
354 #define __VA_COPY_USE_GCH(d, s) __va_copy((d), (s))
356 /* Predefined possible va_copy() implementation (id: GCM) */
357 #define __VA_COPY_USE_GCM(d, s) VA_COPY((d), (s))
360 /* Optional va_copy() implementation activation */
362 #define va_copy(d, s) __VA_COPY_USE(d, s)
365 /* xbt contexts are based on our threads implementation */
366 #ifndef CONTEXT_THREADS
367 #define CONTEXT_THREADS 1
370 /* xbt contexts are not based on ucontext */
371 #ifdef CONTEXT_UCONTEXT
372 #undef CONTEXT_UCONTEXT
375 /* Define to id of used va_copy() implementation */
376 #define __VA_COPY_USE __VA_COPY_USE_C99
379 #if defined(_XBT_DESIGNATED_DLL)
380 #define _XBT_CALL __cdecl __export
381 #elif defined(_RTLDLL)
382 #define _XBT_CALL __cdecl __import
384 #define _XBT_CALL __cdecl
388 /* auto enable thread safety and exceptions: */
390 #define _XBT_HAS_NO_EXCEPTIONS
393 #if defined ( __MT__ ) && !defined (_NOTHREADS) && !defined (_REENTRANT)
398 /* For open, read etc. file operations. */
402 /* For getpid() function. */
405 /* no unistd.h header file. */
406 #define YY_NO_UNISTD_H
408 * Replace winsock2.h,ws2tcpip.h and winsock.h header files */
412 /* Choose setjmp as exception implementation */
413 #ifndef __EX_MCTX_SJLJ__
414 #define __EX_MCTX_SJLJ__
419 #include <sys/stat.h>
421 #define S_IWUSR _S_IWRITE
422 #define S_IRUSR _S_IREAD
425 /* Visual C++ does not declare the ssize_t type */
428 /* Visual C++ does not declare the mode_t type */
429 typedef unsigned int mode_t;
431 /* Visual C++ does not declare the uint32_t type */
432 typedef unsigned int uint32_t;
435 #endif /* #ifndef __XBT_VISUALC_COMPILER_CONFIG_H__ */