Logo AND Algorithmique Numérique Distribuée

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