Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a1baeeef6bd9014b6060aa10c11b552e4aa4df58
[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, 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 #ifdef _XBT_DLL_EXPORT
13         #define DLL_EXPORT
14 #else
15         #define DLL_IMPORT
16 #endif
17
18 #cmakedefine _XBT_WIN32 @_XBT_WIN32@    //this variable is set if it is a windows platform
19 #cmakedefine _WIN32 @_WIN32@                    //this variable is set if it is a 32 bits windows platform
20 #cmakedefine _WIN64 @_WIN64@                    //this variable is set if it is a 64 bits  windows platform
21 #cmakedefine __VISUALC__ @__VISUALC__@
22 #cmakedefine __BORLANDC__ @__BORLANDC__@
23
24 #ifndef SIMGRID_PUBLIC_CONFIG_H
25 #define SIMGRID_PUBLIC_CONFIG_H
26
27 /* Get the config */
28 #undef SIMGRID_NEED_GETLINE
29 #undef SIMGRID_NEED_ASPRINTF
30 #undef SIMGRID_NEED_VASPRINTF
31 @need_getline@
32 @need_asprintf@
33 @need_vasprintf@
34
35 /* Use that config to declare missing elements */
36 #ifdef SIMGRID_NEED_GETLINE
37 #include <stdlib.h> /* size_t */
38 #include <stdio.h>  /* FILE*  */
39 XBT_PUBLIC(long) getline(char **lineptr, size_t * n, FILE * stream);
40 #else
41 #ifndef _GNU_SOURCE
42         #define _GNU_SOURCE
43 #endif
44 #include <stdio.h>
45 #endif
46
47
48 /* snprintf related functions */
49 /** @addtogroup XBT_str
50   * @{ */
51 /** @brief print to allocated string (reimplemented when not provided by the system)
52  *
53  * The functions asprintf() and vasprintf() are analogues of
54  * sprintf() and vsprintf(), except that they allocate a string large
55  * enough to hold the output including the terminating null byte, and
56  * return a pointer to it via the first parameter.  This pointer
57  * should be passed to free(3) to release the allocated storage when
58  * it is no longer needed.
59  */
60 #if defined(SIMGRID_NEED_ASPRINTF)||defined(DOXYGEN)
61 XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt,   /*args */
62                          ...) _XBT_GNUC_PRINTF(2, 3);
63 #endif
64 /** @brief print to allocated string (reimplemented when not provided by the system)
65  *
66  * See asprintf()
67  */
68 #if defined(SIMGRID_NEED_VASPRINTF)||defined(DOXYGEN)
69 #include <stdarg.h>
70 XBT_PUBLIC(int) vasprintf(char **ptr, const char *fmt, va_list ap);
71 #endif
72 /** @brief print to allocated string
73  *
74  * Works just like asprintf(), but returns a pointer to the newly created string
75  */
76 XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2);
77 /** @} */
78
79 #endif /* SIMGRID_PUBLIC_CONFIG_H */