Logo AND Algorithmique Numérique Distribuée

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