From: mquinson Date: Mon, 4 Jun 2007 08:44:45 +0000 (+0000) Subject: Export public data in a way where we can specify that they are extern C X-Git-Tag: v3.3~1810 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5f81ae8d6ee53f418eaaceb76430117ddc580869 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@3550 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/surf/surfxml_parse.h b/include/surf/surfxml_parse.h index 72eac5d647..d2485c2765 100644 --- a/include/surf/surfxml_parse.h +++ b/include/surf/surfxml_parse.h @@ -12,7 +12,7 @@ #include "surf/surfxml.h" #include "xbt/function_types.h" /* Entry-point of the surfxml parser. */ -extern int_f_void_t * XBT_PUBLIC_DATA surf_parse; +XBT_PUBLIC_DATA(int_f_void_t *) surf_parse; /* Hook for the different tags. They can be redefined at will whereas the versions without the _fun can't. */ @@ -29,10 +29,10 @@ extern void_f_void_t *STag_surfxml_route_fun; extern void_f_void_t *ETag_surfxml_route_fun; extern void_f_void_t *STag_surfxml_route_element_fun; extern void_f_void_t *ETag_surfxml_route_element_fun; -extern void_f_void_t * XBT_PUBLIC_DATA STag_surfxml_process_fun; -extern void_f_void_t * XBT_PUBLIC_DATA ETag_surfxml_process_fun; +XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_process_fun; +XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_process_fun; extern void_f_void_t *STag_surfxml_argument_fun; -extern void_f_void_t * XBT_PUBLIC_DATA ETag_surfxml_argument_fun; +XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_argument_fun; XBT_PUBLIC(void) surf_parse_open(const char *file); XBT_PUBLIC(void) surf_parse_close(void); diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index e0a06e988d..ebdd986a55 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -169,7 +169,7 @@ typedef struct surf_timer_resource { /** \brief The timer resource * \ingroup SURF_resources */ -extern surf_timer_resource_t XBT_PUBLIC_DATA surf_timer_resource; +XBT_PUBLIC_DATA(surf_timer_resource_t) surf_timer_resource; /** \brief Initializes the timer resource * \ingroup SURF_resources @@ -212,7 +212,7 @@ typedef struct surf_cpu_resource { /** \brief The CPU resource * \ingroup SURF_resources */ -extern surf_cpu_resource_t XBT_PUBLIC_DATA surf_cpu_resource; +XBT_PUBLIC_DATA(surf_cpu_resource_t) surf_cpu_resource; /** \brief Initializes the CPU resource with the model Cas01 * \ingroup SURF_resources @@ -259,7 +259,7 @@ typedef struct surf_network_resource { * resource should be accessed because depending on the platform model, * the network resource can be NULL. */ -extern surf_network_resource_t XBT_PUBLIC_DATA surf_network_resource; +XBT_PUBLIC_DATA(surf_network_resource_t) surf_network_resource; /** \brief Initializes the platform with the network model CM02 * \ingroup SURF_resources @@ -319,7 +319,7 @@ typedef struct surf_workstation_resource { * because depending on the platform model, the network resource and the CPU resource * may not exist. */ -extern surf_workstation_resource_t XBT_PUBLIC_DATA surf_workstation_resource; +XBT_PUBLIC_DATA(surf_workstation_resource_t) surf_workstation_resource; /** \brief Initializes the platform with the workstation model CLM03 * \ingroup SURF_resources @@ -363,7 +363,7 @@ XBT_PUBLIC(void) surf_workstation_resource_init_GTNETS(const char *filename); * * \see workstation_set */ -extern xbt_dict_t XBT_PUBLIC_DATA network_link_set; +XBT_PUBLIC_DATA(xbt_dict_t) network_link_set; /** \brief The workstations * \ingroup SURF_resources @@ -372,12 +372,12 @@ extern xbt_dict_t XBT_PUBLIC_DATA network_link_set; * * \see network_link_set */ -extern xbt_dict_t XBT_PUBLIC_DATA workstation_set; +XBT_PUBLIC_DATA(xbt_dict_t) workstation_set; /** \brief List of initialized resources * \ingroup SURF_resources */ -extern xbt_dynar_t XBT_PUBLIC_DATA resource_list; +XBT_PUBLIC_DATA(xbt_dynar_t) resource_list; /*******************************************/ /*** SURF Globals **************************/ diff --git a/tools/gras/stub_generator.c b/tools/gras/stub_generator.c index 5bd5375a22..1e666558c6 100644 --- a/tools/gras/stub_generator.c +++ b/tools/gras/stub_generator.c @@ -483,7 +483,7 @@ static void generate_rl(char *project) "#include \n" \ "#include \n" \ "\n" \ - "extern const char * XBT_PUBLIC_DATA _gras_procname;\n" \ + "XBT_PUBLIC_DATA(const char *) _gras_procname;\n" \ "/* user code */\n" \ "int %s(int argc, char *argv[]);\n" \ "\n" \