Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
we now only have one build mode for win, as mc is irrelevant for now
[simgrid.git] / include / simgrid_config.h.in
1 /* simgrid_config.h - Results of the configure made visible to user code    */
2
3 /* Copyright (c) 2009-2013. The SimGrid Team.
4    All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #include "xbt/misc.h"           /* XBT_PUBLIC */
10 #include "xbt/dynar.h"          /* sg_commandline */
11
12 #ifndef SIMGRID_PUBLIC_CONFIG_H
13 #define SIMGRID_PUBLIC_CONFIG_H
14 SG_BEGIN_DECL()
15
16
17 /** Define the version numbers of the used header files. 
18     sg_version() can be used to retrieve the version of the dynamic library.
19     But actually, if these numbers don't match, SimGrid refuses to start (so you shouldn't have to care about sg_version() yourself) */
20
21 #define SIMGRID_VERSION_MAJOR @SIMGRID_VERSION_MAJOR@
22 #define SIMGRID_VERSION_MINOR @SIMGRID_VERSION_MINOR@
23 #define SIMGRID_VERSION_PATCH @SIMGRID_VERSION_PATCH@
24
25 /* Version X.Y.Z will get version number XYZ: all digits concatenated without dots
26  * (with Y and Z must be on two positions)*/
27
28 #define MAKE_SIMGRID_VERSION(major, minor, patch)       \
29   (100UL * (100UL * (major) + (minor)) + (patch))
30 #define SIMGRID_VERSION MAKE_SIMGRID_VERSION(SIMGRID_VERSION_MAJOR, \
31                                              SIMGRID_VERSION_MINOR, \
32                                              SIMGRID_VERSION_PATCH)
33
34 /** Retrieves the version numbers of the used dynamic library (so, DLL or dynlib) , while
35     SIMGRID_VERSION_MAJOR and friends give the version numbers of the used header files */
36 XBT_PUBLIC(void) sg_version(int *major,int *minor,int *patch);
37
38 /** Contains all the parameters we got from the command line */
39 XBT_PUBLIC_DATA(xbt_dynar_t) sg_cmdline;
40
41 /* take care of DLL usage madness */
42
43 #ifdef _XBT_DLL_EXPORT
44         #ifndef DLL_EXPORT
45                 #define DLL_EXPORT
46         #endif
47 #else
48         #ifdef _XBT_DLL_STATIC
49                 #ifndef DLL_STATIC
50                         #define DLL_STATIC
51                 #endif
52         #else
53                 #ifndef DLL_EXPORT
54                         #define DLL_IMPORT
55                 #endif
56         #endif
57 #endif
58
59 #cmakedefine _XBT_WIN32 @_XBT_WIN32@    /*this variable is set if it is a windows platform*/
60 #cmakedefine _WIN32 @_WIN32@                    /*this variable is set if it is a 32 bits windows platform*/
61 #cmakedefine _WIN64 @_WIN64@                    /*this variable is set if it is a 64 bits  windows platform*/
62 #cmakedefine __VISUALC__ @__VISUALC__@
63 #cmakedefine __BORLANDC__ @__BORLANDC__@
64 #ifdef _XBT_WIN32
65         #ifndef __GNUC__
66                 #cmakedefine __GNUC__ @__GNUC__@
67         #endif
68 #endif
69
70
71 /* Define to 1 if you have the `mmap' function. */
72 #cmakedefine HAVE_MMAP @HAVE_MMAP@
73
74 /* Get the config */
75 #undef SIMGRID_NEED_ASPRINTF
76 #undef SIMGRID_NEED_VASPRINTF
77 @simgrid_need_asprintf@
78 @simgrid_need_vasprintf@
79
80 #include <stdarg.h>
81
82 /* snprintf related functions */
83 /** @addtogroup XBT_str
84   * @{ */
85 /** @brief print to allocated string (reimplemented when not provided by the system)
86  *
87  * The functions asprintf() and vasprintf() are analogues of
88  * sprintf() and vsprintf(), except that they allocate a string large
89  * enough to hold the output including the terminating null byte, and
90  * return a pointer to it via the first parameter.  This pointer
91  * should be passed to free(3) to release the allocated storage when
92  * it is no longer needed.
93  */
94 #if defined(SIMGRID_NEED_ASPRINTF)||defined(DOXYGEN)
95 XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt,   /*args */
96                          ...) _XBT_GNUC_PRINTF(2, 3);
97 #endif
98 /** @brief print to allocated string (reimplemented when not provided by the system)
99  *
100  * See asprintf()
101  */
102 #if defined(SIMGRID_NEED_VASPRINTF)||defined(DOXYGEN)
103 XBT_PUBLIC(int) vasprintf(char **ptr, const char *fmt, va_list ap);
104 #endif
105 /** @brief print to allocated string
106  *
107  * Works just like vasprintf(), but returns a pointer to the newly
108  * created string, or aborts on error.
109  */
110 XBT_PUBLIC(char *) bvprintf(const char *fmt, va_list ap);
111 /** @brief print to allocated string
112  *
113  * Works just like asprintf(), but returns a pointer to the newly
114  * created string, or aborts on error.
115  */
116 XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2);
117 /** @} */
118
119 /* Whether mallocators were enabled in ccmake or not. */
120 #define MALLOCATOR_COMPILED_IN @MALLOCATOR_IS_WANTED@
121
122 /* Define if xbt contexts are based on our threads implementation or not */
123 #cmakedefine CONTEXT_THREADS @CONTEXT_THREADS@
124
125 /* Tracing SimGrid */
126 #cmakedefine HAVE_TRACING @HAVE_TRACING@
127
128 /* Jedule output  */
129 #cmakedefine HAVE_JEDULE @HAVE_JEDULE@
130
131 /* Tracking of latency bound */
132 #cmakedefine HAVE_LATENCY_BOUND_TRACKING @HAVE_LATENCY_BOUND_TRACKING@
133
134 /* If __thread is available */
135 #cmakedefine HAVE_THREAD_LOCAL_STORAGE @HAVE_THREAD_LOCAL_STORAGE@
136
137 /* If Model-Checking support was requested */
138 #cmakedefine HAVE_MC @HAVE_MC@
139
140 SG_END_DECL()
141 #endif /* SIMGRID_PUBLIC_CONFIG_H */