Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SIMIX refactoring: replace 'request' by a more precise term: 'simcall'
[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, 2010, 2011. Da 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 #include "xbt/misc.h"           /* XBT_PUBLIC */
9
10 #ifndef SIMGRID_PUBLIC_CONFIG_H
11 #define SIMGRID_PUBLIC_CONFIG_H
12 SG_BEGIN_DECL()
13
14
15 /* Version X.Y.Z will get version number XYZ: all digits concatenated without dots
16  * (with Y and Z must be on two positions)*/
17
18 #define MAKE_SIMGRID_VERSION(major, minor, patch)       \
19   (100UL * (100UL * (major) + (minor)) + (patch))
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 #define SIMGRID_VERSION MAKE_SIMGRID_VERSION(SIMGRID_VERSION_MAJOR, \
26                                              SIMGRID_VERSION_MINOR, \
27                                              SIMGRID_VERSION_PATCH)
28
29 /* take care of DLL usage madness */
30
31 #ifdef _XBT_DLL_EXPORT
32         #ifndef DLL_EXPORT
33                 #define DLL_EXPORT
34         #endif
35 #else
36         #ifdef _XBT_DLL_STATIC
37                 #ifndef DLL_STATIC
38                         #define DLL_STATIC
39                 #endif
40         #else
41                 #ifndef DLL_EXPORT
42                         #define DLL_IMPORT
43                 #endif
44         #endif
45 #endif
46
47 #cmakedefine _XBT_WIN32 @_XBT_WIN32@    /*this variable is set if it is a windows platform*/
48 #cmakedefine _WIN32 @_WIN32@                    /*this variable is set if it is a 32 bits windows platform*/
49 #cmakedefine _WIN64 @_WIN64@                    /*this variable is set if it is a 64 bits  windows platform*/
50 #cmakedefine __VISUALC__ @__VISUALC__@
51 #cmakedefine __BORLANDC__ @__BORLANDC__@
52 #ifdef _XBT_WIN32
53         #ifndef __GNUC__
54                 #cmakedefine __GNUC__ @__GNUC__@
55         #endif
56 #endif
57
58
59 /* Define to 1 if you have the `mmap' function. */
60 #cmakedefine HAVE_MMAP @HAVE_MMAP@
61
62 /* Get the config */
63 #undef SIMGRID_NEED_GETLINE
64 #undef SIMGRID_NEED_ASPRINTF
65 #undef SIMGRID_NEED_VASPRINTF
66 @need_getline@
67 @simgrid_need_asprintf@
68 @simgrid_need_vasprintf@
69
70 /* Use that config to declare missing elements */
71 #ifdef SIMGRID_NEED_GETLINE
72 #include <stdlib.h> /* size_t */
73 #include <stdio.h>  /* FILE*  */
74 XBT_PUBLIC(long) getline(char **lineptr, size_t * n, FILE * stream);
75 #else
76 #ifndef _GNU_SOURCE
77         #define _GNU_SOURCE
78 #endif
79 #include <stdio.h>
80 #endif
81 #include <stdarg.h>
82
83 /* snprintf related functions */
84 /** @addtogroup XBT_str
85   * @{ */
86 /** @brief print to allocated string (reimplemented when not provided by the system)
87  *
88  * The functions asprintf() and vasprintf() are analogues of
89  * sprintf() and vsprintf(), except that they allocate a string large
90  * enough to hold the output including the terminating null byte, and
91  * return a pointer to it via the first parameter.  This pointer
92  * should be passed to free(3) to release the allocated storage when
93  * it is no longer needed.
94  */
95 #if defined(SIMGRID_NEED_ASPRINTF)||defined(DOXYGEN)
96 XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt,   /*args */
97                          ...) _XBT_GNUC_PRINTF(2, 3);
98 #endif
99 /** @brief print to allocated string (reimplemented when not provided by the system)
100  *
101  * See asprintf()
102  */
103 #if defined(SIMGRID_NEED_VASPRINTF)||defined(DOXYGEN)
104 XBT_PUBLIC(int) vasprintf(char **ptr, const char *fmt, va_list ap);
105 #endif
106 /** @brief print to allocated string
107  *
108  * Works just like vasprintf(), but returns a pointer to the newly
109  * created string, or aborts on error.
110  */
111 XBT_PUBLIC(char *) bvprintf(const char *fmt, va_list ap);
112 /** @brief print to allocated string
113  *
114  * Works just like asprintf(), but returns a pointer to the newly
115  * created string, or aborts on error.
116  */
117 XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2);
118 /** @} */
119
120 /* Define if xbt contexts are based on our threads implementation or not */
121 #cmakedefine CONTEXT_THREADS @CONTEXT_THREADS@
122
123 /* Tracing SimGrid */
124 #cmakedefine HAVE_TRACING @HAVE_TRACING@
125
126 /* Jedule output  */
127 #cmakedefine HAVE_JEDULE @HAVE_JEDULE@
128
129 /* Tracking of latency bound */
130 #cmakedefine HAVE_LATENCY_BOUND_TRACKING @HAVE_LATENCY_BOUND_TRACKING@
131
132 /* If __thread is available */
133 #cmakedefine HAVE_THREAD_LOCAL_STORAGE @HAVE_THREAD_LOCAL_STORAGE@
134
135
136 SG_END_DECL()
137 #endif /* SIMGRID_PUBLIC_CONFIG_H */