From bed7df33bf28def1f3de010bd983f419f68f3049 Mon Sep 17 00:00:00 2001 From: mquinson Date: Mon, 4 Jun 2007 08:37:47 +0000 Subject: [PATCH 1/1] Export public data in a way where we can specify that they are extern C git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3547 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/xbt/ex.h | 4 ++-- include/xbt/misc.h | 10 +++++----- src/gras/Virtu/rl_process.c | 2 +- src/gras_simix/Virtu/gras_simix_rl_process.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/xbt/ex.h b/include/xbt/ex.h index 143a26e31c..9684a8cffe 100644 --- a/include/xbt/ex.h +++ b/include/xbt/ex.h @@ -309,12 +309,12 @@ typedef struct { /* the exception context */ typedef ex_ctx_t *(*ex_ctx_cb_t)(void); -extern ex_ctx_cb_t XBT_PUBLIC_DATA __xbt_ex_ctx; +extern XBT_PUBLIC_DATA(ex_ctx_cb_t) __xbt_ex_ctx; extern ex_ctx_t *__xbt_ex_ctx_default(void); /* the termination handler */ typedef void (*ex_term_cb_t)(xbt_ex_t *); -extern ex_term_cb_t XBT_PUBLIC_DATA __xbt_ex_terminate; +extern XBT_PUBLIC_DATA(ex_term_cb_t) __xbt_ex_terminate; extern void __xbt_ex_terminate_default(xbt_ex_t *e); /** @brief Introduce a block where exception may be dealed with diff --git a/include/xbt/misc.h b/include/xbt/misc.h index 24ea9c680b..6a5f341ec0 100644 --- a/include/xbt/misc.h +++ b/include/xbt/misc.h @@ -115,14 +115,14 @@ # define XBT_PUBLIC(type) __declspec(dllexport) type # define XBT_EXPORT_NO_IMPORT(type) __declspec(dllexport) type # define XBT_IMPORT_NO_EXPORT(type) type -# define XBT_PUBLIC_DATA __declspec(dllexport) +# define XBT_PUBLIC_DATA(type) __declspec(dllexport) type /* Pack everything up statically */ #elif defined(DLL_STATIC) # define XBT_PUBLIC(type) type # define XBT_EXPORT_NO_IMPORT(type) type # define XBT_IMPORT_NO_EXPORT(type) type -# define XBT_PUBLIC_DATA +# define XBT_PUBLIC_DATA(type) type /* Link against the DLL */ @@ -130,14 +130,14 @@ # define XBT_PUBLIC(type) __declspec(dllimport) type # define XBT_EXPORT_NO_IMPORT(type) type # define XBT_IMPORT_NO_EXPORT(type) __declspec(dllimport) type -# define XBT_PUBLIC_DATA __declspec(dllimport) +# define XBT_PUBLIC_DATA(type) __declspec(dllimport) type -/* Non-UNIX build. Let's keep sain here ;) */ +/* UNIX build. Let's keep sain here ;) */ #else # define XBT_PUBLIC(type) extern type # define XBT_EXPORT_NO_IMPORT(type) type # define XBT_IMPORT_NO_EXPORT(type) type -# define XBT_PUBLIC_DATA +# define XBT_PUBLIC_DATA(type) type #endif #if !defined (max) && !defined(__cplusplus) diff --git a/src/gras/Virtu/rl_process.c b/src/gras/Virtu/rl_process.c index 7351f8aff4..d044831cf4 100644 --- a/src/gras/Virtu/rl_process.c +++ b/src/gras/Virtu/rl_process.c @@ -13,7 +13,7 @@ /* globals */ static gras_procdata_t *_gras_procdata = NULL; -char const * XBT_PUBLIC_DATA _gras_procname = NULL; +XBT_PUBLIC_DATA(char const *) _gras_procname = NULL; void gras_process_init() { _gras_procdata=xbt_new0(gras_procdata_t,1); diff --git a/src/gras_simix/Virtu/gras_simix_rl_process.c b/src/gras_simix/Virtu/gras_simix_rl_process.c index 2c6329e10e..4799bf5101 100644 --- a/src/gras_simix/Virtu/gras_simix_rl_process.c +++ b/src/gras_simix/Virtu/gras_simix_rl_process.c @@ -13,7 +13,7 @@ /* globals */ static gras_procdata_t *_gras_procdata = NULL; -char const * XBT_PUBLIC_DATA _gras_procname = NULL; +XBT_PUBLIC_DATA(char const *) _gras_procname = NULL; void gras_process_init() { _gras_procdata=xbt_new0(gras_procdata_t,1); -- 2.20.1