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) 2007, 2008, 2010. The SimGrid Team.
7 * All rights reserved. */
9 /* This program is free software; you can redistribute it and/or modify it
10 * under the terms of the license (GNU LGPL) which comes with this package. */
13 * Borland C++ compiler configuration
16 #include <win32/platform/select_platform_features.h>
19 #if _WIN32_WINNT < 0x0400
21 #define _WIN32_WINNT 0x0400
24 #define _WIN32_WINNT 0x0400
31 /* No <dlfcn.h> header file. */
32 #if defined(HAVE_DLFCN_H)
36 /* Defined if the compiler has the <errno.h> header file. */
37 #if !defined(HAVE_ERRNO_H)
38 #define HAVE_ERRNO_H 1
41 /* No <execinfo.h> header file. */
42 #if defined(HAVE_EXECINFO_H)
43 #undef HAVE_EXECINFO_H
46 /* No <inttypes.h> header file. */
47 #if defined(HAVE_INTTYPES_H)
48 #undef HAVE_INTTYPES_H
51 /* Defined if compiler has the <memory.h> header file. */
52 #if !defined(HAVE_MEMORY_H)
53 #define HAVE_MEMORY_H 1
56 /* No <pthread.h> header file. */
57 #if defined(HAVE_PTHREAD_H)
62 /* No <stdint.h> header file. */
63 #if defined(HAVE_STDINT_H)
67 /* The compiler has the <stdlib.h> header file. */
68 #if !defined(HAVE_STDLIB_H)
69 #define HAVE_STDLIB_H 1
72 /* No <strings.h> header file. */
73 #if defined(HAVE_STRINGS_H)
77 /* The compiler has the <string.h> header file. */
78 #if !defined(HAVE_STRING_H)
79 #define HAVE_STRING_H 1
82 /* No <sys/socket.h> header file. */
83 #if defined(HAVE_SYS_SOCKET_H)
84 #undef HAVE_SYS_SOCKET_H
87 /* The compiler has <sys/stat.h> header file. */
88 #if !defined(HAVE_SYS_STAT_H)
89 #define HAVE_SYS_STAT_H 1
92 /* No <sys/time.h> header file. */
93 #if defined(HAVE_SYS_TIME_H)
94 #undef HAVE_SYS_TIME_H 1
97 /* The compiler has the <sys/types.h> header file. */
98 #if !defined(HAVE_SYS_TYPES_H)
99 #define HAVE_SYS_TYPES_H 1
102 /* No <unistd.h> header file. */
103 #if defined(HAVE_UNISTD_H)
108 * The compiler has the <windows.h> header file.
109 * Process the case of afx.h
111 #if !defined(HAVE_WINDOWS_H)
112 #define HAVE_WINDOWS_H 1
115 /* The compiler has the <winsock2.h> header file. */
116 #if !defined(HAVE_WINSOCK2_H)
117 #define HAVE_WINSOCK2_H
121 * The compiler has the <winsock.h> header file.
122 * Trouble if winsock2.h exists ?
124 #if !defined(HAVE_WINSOCK_H)
125 #define HAVE_WINSOCK_H 1
128 /* The compiler has the <signal.h> header file */
129 #if !defined(HAVE_SIGNAL_H)
130 #define HAVE_SIGNAL_H 1
137 /* No `getcontext' function. */
138 #if defined(HAVE_GETCONTEXT)
139 #undef HAVE_GETCONTEXT
142 /* No `getdtablesize' function. */
143 #if defined(HAVE_GETDTABLESIZE)
144 #undef HAVE_GETDTABLESIZE
147 /* No `gettimeofday' function. */
148 #if defined(HAVE_GETTIMEOFDAY)
149 #undef HAVE_GETTIMEOFDAY
152 /* No `makecontext' function. */
153 #if defined(HAVE_MAKECONTEXT)
154 #undef HAVE_MAKECONTEXT
157 /* No 'popen' function. */
158 #if defined(HAVE_POPEN)
162 /* No `readv' function. */
163 #if defined(HAVE_READV)
167 /* No `setcontext' function. */
168 #if defined(HAVE_SETCONTEXT)
169 #undef HAVE_SETCONTEXT
172 /* No 'signal' function */
173 #if defined(HAVE_SIGNAL)
177 /* "disable the snprintf replacement ( this function is broken on system v only" */
181 #ifdef PREFER_PORTABLE_SNPRINTF
182 # undef PREFER_PORTABLE_SNPRINTF 1
186 /* The compiler has `snprintf' function. */
188 # ifndef HAVE_SNPRINTF
189 # define HAVE_SNPRINTF 1
190 # ifndef PREFER_PORTABLE_SNPRINTF
191 # define snprintf _snprintf
195 # ifdef HAVE_SNPRINTF
202 /* No `swapcontext' function. */
203 #if defined(HAVE_SWAPCONTEXT)
204 #undef HAVE_SWAPCONTEXT
207 /* No `sysconf' function. */
208 #if defined(HAVE_SYSCONF)
212 /* No `usleep' function. */
213 #if defined(HAVE_USLEEP)
217 /* The compiler has the `vsnprintf' function. */
218 #ifndef HAVE_VSNPRINTF
219 #define HAVE_VSNPRINTF 1
223 /* disable the asprintf replacement */
224 #ifndef NEED_ASPRINTF
225 #define NEED_ASPRINTF
229 /* disable the vasprintf replacement */
230 #ifndef NEED_VASPRINTF
231 #define NEED_VASPRINTF
234 /* The maximal size of any scalar on this arch */
235 #if !defined(SIZEOF_MAX)
239 /* Define to 1 if you have the ANSI C header files. */
240 #if !defined(STDC_HEADERS)
241 #define STDC_HEADERS 1
244 #if defined(TIME_WITH_SYS_TIME)
245 #undef TIME_WITH_SYS_TIME
252 /* Define to 1 if you have the `pthread' library (-lpthread). */
253 #if defined(HAVE_LIBPTHREAD)
254 #undef HAVE_LIBPTHREAD
258 * package informations ?
262 /* Defined if arrays in struct can straddle struct alignment boundaries. This
263 is like than the structure compaction above, but this time, the argument to
264 be compacted is an array whom each element would be normally compacted.
265 Exemple: struct s { double d; int i; char c[6]; }; Arrays can straddle if c
266 is allowed to come just after i. Note that GRAS only support architecture
267 presenting this caracteristic so far. */
269 #if defined(GRAS_ARRAY_STRADDLE_STRUCT)
270 #undef GRAS_ARRAY_STRADDLE_STRUCT
273 /* Defined if structures are compacted when possible. Consider this structure:
274 struct s {double d; int i; char c;}; If it is allowed, the char is placed
275 just after the int. If not, it has to be on the 8 bytes boundary imposed by
276 the double. For now, GRAS requires the structures to be compacted. */
277 #if defined(GRAS_STRUCT_COMPACT)
278 #undef GRAS_STRUCT_COMPACT
281 /* Name of package */
282 #define PACKAGE "simgrid"
284 /* Define to the address where bug reports for this package should be sent. */
285 #define PACKAGE_BUGREPORT "simgrid-devel@lists.gforge.inria.fr"
287 /* Define to the full name of this package. */
288 #define PACKAGE_NAME "simgrid"
290 /* Define to the full name and version of this package. */
291 #define PACKAGE_STRING "simgrid 3.1.1-cvs"
293 /* Define to the one symbol short name of this package. */
294 #define PACKAGE_TARNAME "simgrid"
296 /* Define to the version of this package. */
297 #define PACKAGE_VERSION "3.1.1-cvs"
303 /* define if big endian */
304 #if !defined(GRAS_BIGENDIAN)
305 #define GRAS_BIGENDIAN 0
308 /* Defined if structures are compacted when possible. Consider this structure:
309 struct s {double d; int i; char c;}; If it is allowed, the char is placed
310 just after the int. If not, it has to be on the 8 bytes boundary imposed by
311 the double. For now, GRAS requires the structures to be compacted. */
312 #if defined(GRAS_STRUCT_COMPACT)
313 #define GRAS_STRUCT_COMPACT 1
316 /* defines the GRAS architecture signature of this machine */
317 #if defined(GRAS_THISARCH)
321 #define GRAS_THISARCH 3
324 /* Path to the addr2line tool */
325 #if defined(ADDR2LINE)
332 #if !defined(HAVE_VA_COPY)
333 #define HAVE_VA_COPY 1
336 /* This macro is not defined in borland stdarg.h include file, adds it. */
337 #ifndef va_copy(dest,src)
338 #define va_copy(dest,src) ((dest)=(src))
341 #ifndef __VA_COPY_USE_ASP(d, s)
342 /* Predefined possible va_copy() implementation (id: ASP) */
343 #define __VA_COPY_USE_ASP(d, s) do { *(d) = *(s); } while (0)
346 #ifndef __VA_COPY_USE_ASS(d, s)
347 /* Predefined possible va_copy() implementation (id: ASS) */
348 #define __VA_COPY_USE_ASS(d, s) do { (d) = (s); } while (0)
351 #ifndef __VA_COPY_USE_C99(d, s)
352 /* Predefined possible va_copy() implementation (id: C99) */
353 #define __VA_COPY_USE_C99(d, s) va_copy((d), (s))
356 #ifndef __VA_COPY_USE_CPP(d, s)
357 /* Predefined possible va_copy() implementation (id: CPP) */
358 #define __VA_COPY_USE_CPP(d, s) memcpy((void *)(d), (void *)(s)), sizeof(*(s))
361 #ifndef __VA_COPY_USE_CPS(d, s)
362 /* Predefined possible va_copy() implementation (id: CPS) */
363 #define __VA_COPY_USE_CPS(d, s) memcpy((void *)&(d), (void *)&(s)), sizeof((s))
366 #ifndef __VA_COPY_USE_GCB(d, s)
367 /* Predefined possible va_copy() implementation (id: GCB) */
368 #define __VA_COPY_USE_GCB(d, s) __builtin_va_copy((d), (s))
371 #ifndef __VA_COPY_USE_GCH(d, s)
372 /* Predefined possible va_copy() implementation (id: GCH) */
373 #define __VA_COPY_USE_GCH(d, s) __va_copy((d), (s))
375 /* Predefined possible va_copy() implementation (id: GCM) */
376 #define __VA_COPY_USE_GCM(d, s) VA_COPY((d), (s))
379 /* Optional va_copy() implementation activation */
381 #define va_copy(d, s) __VA_COPY_USE(d, s)
384 /* Define to id of used va_copy() implementation */
385 #ifndef __VA_COPY_USE
386 #define __VA_COPY_USE __VA_COPY_USE_C99
390 /* xbt contexts are based on our threads implementation */
391 #ifndef CONTEXT_THREADS
392 #define CONTEXT_THREADS 1
396 /* xbt contexts are not based on ucontext */
397 #ifdef CONTEXT_UCONTEXT
398 #undef CONTEXT_UCONTEXT
403 #if defined(_XBT_DESIGNATED_DLL)
404 #define _XBT_CALL __cdecl __export
405 #elif defined(_RTLDLL)
406 #define _XBT_CALL __cdecl __import
408 #define _XBT_CALL __cdecl
412 /* auto enable thread safety and exceptions: */
414 #define _XBT_HAS_NO_EXCEPTIONS
417 #if defined ( __MT__ ) && !defined (_NOTHREADS) && !defined (_REENTRANT)
422 /* For open, read etc. file operations. */
426 /* For getpid() function. */
429 /* no unistd.h header file. */
430 #define YY_NO_UNISTD_H
432 * Replace winsock2.h,ws2tcpip.h and winsock.h header files */
436 /* Choose setjmp as exception implementation */
437 #ifndef __EX_MCTX_SJLJ__
438 #define __EX_MCTX_SJLJ__
443 #include <sys/stat.h>
445 #define S_IWUSR _S_IWRITE
446 #define S_IRUSR _S_IREAD
449 /* Visual C++ does not declare the ssize_t type */
452 /* Visual C++ does not declare the mode_t type */
453 typedef unsigned int mode_t;
455 /* Visual C++ does not declare the uint32_t type */
456 typedef unsigned int uint32_t;
459 #endif /* #ifndef __XBT_VISUALC_COMPILER_CONFIG_H__ */