Logo AND Algorithmique Numérique Distribuée

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