Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reindent
[simgrid.git] / src / portable.h
1 /* portable -- header loading to write portable code                         */
2 /* loads much more stuff than sysdep.h since the latter is in public interface*/
3
4 /* Copyright (c) 2004-2010, 2012-2015. The SimGrid Team.
5  * All rights reserved.                                                     */
6
7 /* This program is free software; you can redistribute it and/or modify it
8  * under the terms of the license (GNU LGPL) which comes with this package. */
9
10 #ifndef SIMGRID_PORTABLE_H
11 #define SIMGRID_PORTABLE_H
12
13 #include "simgrid_config.h"       /* what was compiled in? */
14 #include "src/internal_config.h"  /* some information about the environment */
15
16 #include "xbt/base.h"
17 #include "xbt/misc.h"
18 #ifdef _XBT_WIN32
19 # include <windows.h>
20 #endif
21
22 #include <stdarg.h>
23 #include <stdio.h>
24
25 #ifdef HAVE_ERRNO_H
26 #  include <errno.h>
27 #endif
28
29 #ifdef HAVE_UNISTD_H
30 #  include <unistd.h>
31 #endif
32
33 #ifdef HAVE_SYS_PARAM_H
34 # include <sys/param.h>
35 #endif
36 #ifdef HAVE_SYS_SYSCTL_H
37 # include <sys/sysctl.h>
38 #endif
39
40 /****
41  **** File handling
42  ****/
43
44 #include <fcntl.h>
45
46 #ifdef _XBT_WIN32
47   #ifndef EWOULDBLOCK
48   #define EWOULDBLOCK WSAEWOULDBLOCK
49   #endif
50
51   #ifndef EINPROGRESS
52   #define EINPROGRESS WSAEINPROGRESS
53   #endif
54
55   #ifndef ETIMEDOUT
56   #define ETIMEDOUT   WSAETIMEDOUT
57   #endif
58
59   #ifdef S_IRGRP
60     #undef S_IRGRP
61   #endif
62   #define S_IRGRP 0
63
64   #ifdef S_IWGRP
65     #undef S_IWGRP
66   #endif
67   #define S_IWGRP 0
68 #endif
69
70 #ifdef HAVE_SYS_STAT_H
71 #  include <sys/stat.h>
72 #endif
73
74 #ifndef O_BINARY
75 #  define O_BINARY 0
76 #endif
77
78 /****
79  **** Time handling
80  ****/
81
82 #if HAVE_SYS_TIME_H
83 #  include <sys/time.h>
84 #endif
85 #include <time.h>
86
87 /****
88  **** Signals
89  ****/
90 #ifdef HAVE_SIGNAL_H
91 # include <signal.h>
92 #endif
93
94 /* What we need to extract the backtrace in exception handling code */
95 #ifdef HAVE_EXECINFO_H
96 #  include <execinfo.h>
97 #endif
98
99 #endif                          /* SIMGRID_PORTABLE_H */