Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
errno.h and sys/stat/h are always here nowadays
[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_UNISTD_H
26 #  include <unistd.h>
27 #endif
28
29 #ifdef HAVE_SYS_PARAM_H
30 # include <sys/param.h>
31 #endif
32 #ifdef HAVE_SYS_SYSCTL_H
33 # include <sys/sysctl.h>
34 #endif
35
36 /****
37  **** File handling
38  ****/
39
40 #include <fcntl.h>
41
42 #ifdef _XBT_WIN32
43   #ifndef EWOULDBLOCK
44   #define EWOULDBLOCK WSAEWOULDBLOCK
45   #endif
46
47   #ifndef EINPROGRESS
48   #define EINPROGRESS WSAEINPROGRESS
49   #endif
50
51   #ifndef ETIMEDOUT
52   #define ETIMEDOUT   WSAETIMEDOUT
53   #endif
54
55   #ifdef S_IRGRP
56     #undef S_IRGRP
57   #endif
58   #define S_IRGRP 0
59
60   #ifdef S_IWGRP
61     #undef S_IWGRP
62   #endif
63   #define S_IWGRP 0
64 #endif
65
66 #ifndef O_BINARY
67 #  define O_BINARY 0
68 #endif
69
70 /****
71  **** Time handling
72  ****/
73
74 #if HAVE_SYS_TIME_H
75 #  include <sys/time.h>
76 #endif
77 #include <time.h>
78
79 /****
80  **** Signals
81  ****/
82 #ifdef HAVE_SIGNAL_H
83 # include <signal.h>
84 #endif
85
86 /* What we need to extract the backtrace in exception handling code */
87 #ifdef HAVE_EXECINFO_H
88 #  include <execinfo.h>
89 #endif
90
91 #endif                          /* SIMGRID_PORTABLE_H */