Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
8c62ff57566abc293f2124ede2439286bafd2c32
[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 /* 
108  * The compiler has the <windows.h> header file. 
109  * Process the case of afx.h
110 */
111 #if !defined(HAVE_WINDOWS_H)
112         #define HAVE_WINDOWS_H          1
113 #endif
114
115 /* The compiler has the <winsock2.h> header file. */
116 #if !defined(HAVE_WINSOCK2_H)
117         #define HAVE_WINSOCK2_H
118 #endif
119
120 /*  
121  * The compiler has the <winsock.h> header file.
122  * Trouble if winsock2.h exists ?  
123  */
124 #if !defined(HAVE_WINSOCK_H)
125         #define HAVE_WINSOCK_H  1
126 #endif
127
128 /* The compiler has the <signal.h> header file */
129 #if !defined(HAVE_SIGNAL_H)
130         #define HAVE_SIGNAL_H   1
131 #endif
132
133 /* 
134  * functions.
135  */
136
137 /* No `getcontext' function. */
138 #if defined(HAVE_GETCONTEXT)
139         #undef HAVE_GETCONTEXT
140 #endif
141
142 /* No `getdtablesize' function. */
143 #if defined(HAVE_GETDTABLESIZE)
144         #undef HAVE_GETDTABLESIZE
145 #endif
146
147 /* No `gettimeofday' function. */
148 #if defined(HAVE_GETTIMEOFDAY)
149         #undef HAVE_GETTIMEOFDAY
150 #endif
151
152 /* No `makecontext' function. */
153 #if defined(HAVE_MAKECONTEXT)
154         #undef HAVE_MAKECONTEXT
155 #endif
156
157 /* No 'popen' function. */
158 #if defined(HAVE_POPEN)
159         #undef HAVE_POPEN
160 #endif
161
162 /* No `readv' function. */
163 #if defined(HAVE_READV)
164         #undef HAVE_READV
165 #endif
166
167 /* No `setcontext' function. */
168 #if defined(HAVE_SETCONTEXT)
169         #undef HAVE_SETCONTEXT
170 #endif
171
172 /* No 'signal' function */
173 #if defined(HAVE_SIGNAL)
174         #undef HAVE_SIGNAL
175 #endif
176
177 /* "disable the snprintf replacement ( this function is broken on system v only" */
178
179
180
181 #ifdef PREFER_PORTABLE_SNPRINTF
182 # undef PREFER_PORTABLE_SNPRINTF        1       
183 #endif
184
185
186 /* The compiler has `snprintf' function. */
187 #if _MSC_VER >= 1400 
188 #  ifndef HAVE_SNPRINTF
189 #    define HAVE_SNPRINTF       1
190 #    ifndef PREFER_PORTABLE_SNPRINTF
191 #      define snprintf _snprintf
192 #    endif
193 #  endif
194 #else 
195 #  ifdef HAVE_SNPRINTF
196         #undef HAVE_SNPRINTF
197 #  endif
198 #endif
199
200
201
202 /* No `swapcontext' function. */
203 #if defined(HAVE_SWAPCONTEXT)
204         #undef HAVE_SWAPCONTEXT
205 #endif
206
207 /* No `sysconf' function. */
208 #if defined(HAVE_SYSCONF)
209         #undef HAVE_SYSCONF
210 #endif
211
212 /* No `usleep' function. */
213 #if defined(HAVE_USLEEP)
214         #undef HAVE_USLEEP
215 #endif
216
217 /* The compiler has the `vsnprintf' function. */
218 #ifndef HAVE_VSNPRINTF
219         #define HAVE_VSNPRINTF  1
220 #endif
221
222
223 /* disable the asprintf replacement */
224 #ifndef NEED_ASPRINTF
225         #define NEED_ASPRINTF   
226 #endif
227
228
229 /* disable the vasprintf replacement */
230 #ifndef NEED_VASPRINTF
231         #define NEED_VASPRINTF
232 #endif
233
234 /* The maximal size of any scalar on this arch */
235 #if !defined(SIZEOF_MAX)
236         #define SIZEOF_MAX 8
237 #endif
238
239 /* Define to 1 if you have the ANSI C header files. */
240 #if !defined(STDC_HEADERS)
241         #define STDC_HEADERS 1
242 #endif
243
244 #if defined(TIME_WITH_SYS_TIME)
245         #undef TIME_WITH_SYS_TIME 
246 #endif
247
248 /* 
249  * libraries
250  */
251
252 /* Define to 1 if you have the `pthread' library (-lpthread). */
253 #if defined(HAVE_LIBPTHREAD)
254         #undef HAVE_LIBPTHREAD
255 #endif
256
257 /* 
258  * package informations ?
259  */
260  
261  
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. */
268
269 #if defined(GRAS_ARRAY_STRADDLE_STRUCT)
270         #undef GRAS_ARRAY_STRADDLE_STRUCT
271 #endif
272
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
279 #endif
280
281 /* Name of package */
282 #define PACKAGE "simgrid"
283
284 /* Define to the address where bug reports for this package should be sent. */
285 #define PACKAGE_BUGREPORT "simgrid-devel@lists.gforge.inria.fr"
286
287 /* Define to the full name of this package. */
288 #define PACKAGE_NAME "simgrid"
289
290 /* Define to the full name and version of this package. */
291 #define PACKAGE_STRING "simgrid 3.1.1-cvs"
292
293 /* Define to the one symbol short name of this package. */
294 #define PACKAGE_TARNAME "simgrid"
295
296 /* Define to the version of this package. */
297 #define PACKAGE_VERSION "3.1.1-cvs"
298
299 /* 
300  * macro
301  */
302  
303  /* define if big endian */
304 #if !defined(GRAS_BIGENDIAN)
305         #define GRAS_BIGENDIAN 0
306 #endif
307
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
314 #endif
315
316 /* defines the GRAS architecture signature of this machine */
317 #if defined(GRAS_THISARCH)
318         #undef GRAS_THISARCH
319 #endif
320
321 #define GRAS_THISARCH 3
322
323  
324  /* Path to the addr2line tool */
325 #if defined(ADDR2LINE)
326         #undef ADDR2LINE
327 #endif
328
329 #if !defined(HAVE_VA_COPY)
330         #define HAVE_VA_COPY 1
331 #endif
332
333 /* This macro is not defined in borland stdarg.h include file, adds it. */
334 #ifndef va_copy(dest,src)
335         #define va_copy(dest,src)   ((dest)=(src))
336 #endif
337
338 #ifndef __VA_COPY_USE_ASP(d, s)
339 /* Predefined possible va_copy() implementation (id: ASP) */
340         #define __VA_COPY_USE_ASP(d, s) do { *(d) = *(s); } while (0)
341 #endif
342
343 #ifndef __VA_COPY_USE_ASS(d, s)
344 /* Predefined possible va_copy() implementation (id: ASS) */
345         #define __VA_COPY_USE_ASS(d, s) do { (d) = (s); } while (0)
346 #endif
347
348 #ifndef __VA_COPY_USE_C99(d, s)
349 /* Predefined possible va_copy() implementation (id: C99) */
350         #define __VA_COPY_USE_C99(d, s) va_copy((d), (s))
351 #endif
352
353 #ifndef __VA_COPY_USE_CPP(d, s)
354 /* Predefined possible va_copy() implementation (id: CPP) */
355         #define __VA_COPY_USE_CPP(d, s) memcpy((void *)(d), (void *)(s)), sizeof(*(s))
356 #endif
357
358 #ifndef __VA_COPY_USE_CPS(d, s)
359 /* Predefined possible va_copy() implementation (id: CPS) */
360         #define __VA_COPY_USE_CPS(d, s) memcpy((void *)&(d), (void *)&(s)), sizeof((s))
361 #endif
362
363 #ifndef __VA_COPY_USE_GCB(d, s)
364 /* Predefined possible va_copy() implementation (id: GCB) */
365         #define __VA_COPY_USE_GCB(d, s) __builtin_va_copy((d), (s))
366 #endif
367
368 #ifndef __VA_COPY_USE_GCH(d, s)
369 /* Predefined possible va_copy() implementation (id: GCH) */
370         #define __VA_COPY_USE_GCH(d, s) __va_copy((d), (s))
371 #endif
372 /* Predefined possible va_copy() implementation (id: GCM) */
373 #define __VA_COPY_USE_GCM(d, s) VA_COPY((d), (s))
374
375
376 /* Optional va_copy() implementation activation */
377 #ifndef HAVE_VA_COPY
378 #define va_copy(d, s) __VA_COPY_USE(d, s)
379 #endif
380
381 /* xbt contexts are based on our threads implementation */
382 #ifndef CONTEXT_THREADS
383 #define CONTEXT_THREADS 1
384 #endif
385
386 /* xbt contexts are not based on ucontext */
387 #ifdef CONTEXT_UCONTEXT
388 #undef CONTEXT_UCONTEXT
389 #endif
390
391 /* Define to id of used va_copy() implementation */
392 #ifndef __VA_COPY_USE
393         #define __VA_COPY_USE __VA_COPY_USE_C99
394 #endif
395
396 #ifndef _XBT_CALL
397         #if defined(_XBT_DESIGNATED_DLL)
398                 #define _XBT_CALL __cdecl __export
399         #elif defined(_RTLDLL)
400                 #define  _XBT_CALL __cdecl __import
401         #else
402                 #define  _XBT_CALL __cdecl
403         #endif
404 #endif
405
406 /* auto enable thread safety and exceptions: */
407 #ifndef _CPPUNWIND
408         #define _XBT_HAS_NO_EXCEPTIONS
409 #endif
410
411 #if defined ( __MT__ ) && !defined (_NOTHREADS) && !defined (_REENTRANT)
412         #define _REENTRANT 1
413 #endif
414
415
416 /* For open, read etc. file operations. */
417 #include <io.h>
418 #include <fcntl.h>
419
420 /* For getpid() function. */
421 #include <process.h>
422
423 /* no unistd.h header file. */
424 #define YY_NO_UNISTD_H 
425 /*
426  * Replace winsock2.h,ws2tcpip.h and winsock.h header files */
427 #include <windows.h>
428
429
430 /* Choose setjmp as exception implementation */
431 #ifndef __EX_MCTX_SJLJ__
432 #define __EX_MCTX_SJLJ__
433 #endif 
434
435
436
437 #include <sys/stat.h>
438
439 #define S_IWUSR _S_IWRITE
440 #define S_IRUSR _S_IREAD
441
442
443 /* Visual C++ does not declare the ssize_t type */
444 typedef int ssize_t;
445
446 /* Visual C++ does not declare the mode_t type */
447 typedef unsigned int mode_t;
448
449 /* Visual C++ does not declare the uint32_t type */
450 typedef unsigned int uint32_t;
451
452
453 #endif /* #ifndef __XBT_VISUALC_COMPILER_CONFIG_H__ */