Logo AND Algorithmique Numérique Distribuée

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