Logo AND Algorithmique Numérique Distribuée

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