3 /* simgrid_config.h - Results of the configure made visible to user code */
5 /* Copyright (c) 2009, Da SimGrid team. All rights reserved. */
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. */
10 #include "xbt/misc.h" /* XBT_PUBLIC */
12 #ifdef _XBT_DLL_EXPORT
15 #ifdef _XBT_DLL_STATIC
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__@
28 #ifndef SIMGRID_PUBLIC_CONFIG_H
29 #define SIMGRID_PUBLIC_CONFIG_H
32 #undef SIMGRID_NEED_GETLINE
33 #undef SIMGRID_NEED_ASPRINTF
34 #undef SIMGRID_NEED_VASPRINTF
39 /* Use that config to declare missing elements */
40 #ifdef SIMGRID_NEED_GETLINE
41 #include <stdlib.h> /* size_t */
42 #include <stdio.h> /* FILE* */
43 XBT_PUBLIC(long) getline(char **lineptr, size_t * n, FILE * stream);
52 /* snprintf related functions */
53 /** @addtogroup XBT_str
55 /** @brief print to allocated string (reimplemented when not provided by the system)
57 * The functions asprintf() and vasprintf() are analogues of
58 * sprintf() and vsprintf(), except that they allocate a string large
59 * enough to hold the output including the terminating null byte, and
60 * return a pointer to it via the first parameter. This pointer
61 * should be passed to free(3) to release the allocated storage when
62 * it is no longer needed.
64 #if defined(SIMGRID_NEED_ASPRINTF)||defined(DOXYGEN)
65 XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt, /*args */
66 ...) _XBT_GNUC_PRINTF(2, 3);
68 /** @brief print to allocated string (reimplemented when not provided by the system)
72 #if defined(SIMGRID_NEED_VASPRINTF)||defined(DOXYGEN)
74 XBT_PUBLIC(int) vasprintf(char **ptr, const char *fmt, va_list ap);
76 /** @brief print to allocated string
78 * Works just like asprintf(), but returns a pointer to the newly created string
80 XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2);
83 #endif /* SIMGRID_PUBLIC_CONFIG_H */