Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix dllexport/dllimport declarations (Windows)
authorGabriel Corona <gabriel.corona@loria.fr>
Wed, 10 Jun 2015 00:24:53 +0000 (02:24 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Wed, 10 Jun 2015 00:48:32 +0000 (02:48 +0200)
- some were inconsistent;
- XBT_PUBLIC() was used for variables instead of XBT_PUBLIC_DATA().

13 files changed:
include/simgrid/msg.h
include/simgrid/simix.h
include/surf/surf_routing.h
include/xbt/misc.h
src/include/surf/surf.h
src/instr/instr_private.h
src/simix/popping_private.h
src/surf/cpu_interface.hpp
src/surf/surf_interface.hpp
src/surf/surf_private.h
src/surf/surf_routing.cpp
src/surf/surf_routing.hpp
src/xbt/mmalloc/mmprivate.h

index e2d19de..0f29462 100644 (file)
@@ -33,7 +33,7 @@ typedef struct As *msg_as_t;
 
 /* ******************************** Host ************************************ */
 
 
 /* ******************************** Host ************************************ */
 
-extern int MSG_HOST_LEVEL;
+XBT_PUBLIC_DATA(int) MSG_HOST_LEVEL;
 
 /** @brief Host datatype.
     @ingroup m_host_management
 
 /** @brief Host datatype.
     @ingroup m_host_management
index 099966d..79bf716 100644 (file)
@@ -166,7 +166,7 @@ typedef struct s_smx_context_factory {
 
 /* Hack: let msg load directly the right factory */
 typedef void (*smx_ctx_factory_initializer_t)(smx_context_factory_t*);
 
 /* Hack: let msg load directly the right factory */
 typedef void (*smx_ctx_factory_initializer_t)(smx_context_factory_t*);
-XBT_PUBLIC(smx_ctx_factory_initializer_t) smx_factory_initializer_to_use;
+XBT_PUBLIC_DATA(smx_ctx_factory_initializer_t) smx_factory_initializer_to_use;
 extern char* smx_context_factory_name;
 extern int smx_context_stack_size;
 extern int smx_context_stack_size_was_set;
 extern char* smx_context_factory_name;
 extern int smx_context_stack_size;
 extern int smx_context_stack_size_was_set;
index 95984aa..88f92d1 100644 (file)
 
 SG_BEGIN_DECL()
 
 
 SG_BEGIN_DECL()
 
-XBT_PUBLIC(xbt_lib_t) host_lib;
-XBT_PUBLIC(int) ROUTING_HOST_LEVEL; //Routing level
-XBT_PUBLIC(int)  SURF_CPU_LEVEL;    //Surf cpu level
-XBT_PUBLIC(int) SURF_WKS_LEVEL;    //Surf workstation level
-XBT_PUBLIC(int) SIMIX_HOST_LEVEL;  //Simix host level
-XBT_PUBLIC(int) SIMIX_STORAGE_LEVEL;  //Simix storage level
-XBT_PUBLIC(int)  MSG_HOST_LEVEL;    //Msg level
-XBT_PUBLIC(int)  SD_HOST_LEVEL;    //Simdag host level
-XBT_PUBLIC(int)  SD_STORAGE_LEVEL;    //Simdag storage level
-XBT_PUBLIC(int)  COORD_HOST_LEVEL;  //Coordinates level
-XBT_PUBLIC(int) NS3_HOST_LEVEL;    //host node for ns3
-
-XBT_PUBLIC(xbt_lib_t) link_lib;
-XBT_PUBLIC(int) SD_LINK_LEVEL;    //Simdag level
-XBT_PUBLIC(int) SURF_LINK_LEVEL;  //Surf level
-XBT_PUBLIC(int) NS3_LINK_LEVEL;    //link for ns3
-
-XBT_PUBLIC(xbt_lib_t) as_router_lib;
-XBT_PUBLIC(int) ROUTING_ASR_LEVEL;  //Routing level
-XBT_PUBLIC(int) COORD_ASR_LEVEL;  //Coordinates level
-XBT_PUBLIC(int) NS3_ASR_LEVEL;    //host node for ns3
-XBT_PUBLIC(int) ROUTING_PROP_ASR_LEVEL; //Properties for AS and router
-
-XBT_PUBLIC(xbt_lib_t) storage_lib;
-XBT_PUBLIC(int) ROUTING_STORAGE_LEVEL;        //Routing storage level
-XBT_PUBLIC(int) ROUTING_STORAGE_HOST_LEVEL;
-XBT_PUBLIC(int) SURF_STORAGE_LEVEL;  // Surf storage level
-XBT_PUBLIC(xbt_lib_t) file_lib;
-XBT_PUBLIC(xbt_lib_t) storage_type_lib;
-XBT_PUBLIC(int) ROUTING_STORAGE_TYPE_LEVEL;   //Routing storage_type level
+XBT_PUBLIC_DATA(xbt_lib_t) host_lib;
+XBT_PUBLIC_DATA(int) ROUTING_HOST_LEVEL; //Routing level
+XBT_PUBLIC_DATA(int)  SURF_CPU_LEVEL;    //Surf cpu level
+XBT_PUBLIC_DATA(int) SURF_WKS_LEVEL;    //Surf workstation level
+XBT_PUBLIC_DATA(int) SIMIX_HOST_LEVEL;  //Simix host level
+XBT_PUBLIC_DATA(int) SIMIX_STORAGE_LEVEL;  //Simix storage level
+XBT_PUBLIC_DATA(int)  MSG_HOST_LEVEL;    //Msg level
+XBT_PUBLIC_DATA(int)  SD_HOST_LEVEL;    //Simdag host level
+XBT_PUBLIC_DATA(int)  SD_STORAGE_LEVEL;    //Simdag storage level
+XBT_PUBLIC_DATA(int)  COORD_HOST_LEVEL;  //Coordinates level
+XBT_PUBLIC_DATA(int) NS3_HOST_LEVEL;    //host node for ns3
+
+XBT_PUBLIC_DATA(xbt_lib_t) link_lib;
+XBT_PUBLIC_DATA(int) SD_LINK_LEVEL;    //Simdag level
+XBT_PUBLIC_DATA(int) SURF_LINK_LEVEL;  //Surf level
+XBT_PUBLIC_DATA(int) NS3_LINK_LEVEL;    //link for ns3
+
+XBT_PUBLIC_DATA(xbt_lib_t) as_router_lib;
+XBT_PUBLIC_DATA(int) ROUTING_ASR_LEVEL;  //Routing level
+XBT_PUBLIC_DATA(int) COORD_ASR_LEVEL;  //Coordinates level
+XBT_PUBLIC_DATA(int) NS3_ASR_LEVEL;    //host node for ns3
+XBT_PUBLIC_DATA(int) ROUTING_PROP_ASR_LEVEL; //Properties for AS and router
+
+XBT_PUBLIC_DATA(xbt_lib_t) storage_lib;
+XBT_PUBLIC_DATA(int) ROUTING_STORAGE_LEVEL;        //Routing storage level
+XBT_PUBLIC_DATA(int) ROUTING_STORAGE_HOST_LEVEL;
+XBT_PUBLIC_DATA(int) SURF_STORAGE_LEVEL;  // Surf storage level
+XBT_PUBLIC_DATA(xbt_lib_t) file_lib;
+XBT_PUBLIC_DATA(xbt_lib_t) storage_type_lib;
+XBT_PUBLIC_DATA(int) ROUTING_STORAGE_TYPE_LEVEL;   //Routing storage_type level
 
 /* The callbacks to register for the routing to work */
 void routing_AS_begin(sg_platf_AS_cbarg_t AS);
 
 /* The callbacks to register for the routing to work */
 void routing_AS_begin(sg_platf_AS_cbarg_t AS);
index 5a23b73..a0e33d8 100644 (file)
 
 /* Build the DLL */
 #if defined(DLL_EXPORT)
 
 /* Build the DLL */
 #if defined(DLL_EXPORT)
-#  define XBT_PUBLIC(type)            extern __declspec(dllexport) type
+#  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(type)       extern __declspec(dllexport) type
 #  define XBT_EXPORT_NO_IMPORT(type)  __declspec(dllexport) type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
 #  define XBT_PUBLIC_DATA(type)       extern __declspec(dllexport) type
 
 /* Pack everything up statically */
 #elif defined(DLL_STATIC)
 
 /* Pack everything up statically */
 #elif defined(DLL_STATIC)
-#  define XBT_PUBLIC(type)            extern type
+#  define XBT_PUBLIC(type)            type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
 #  define XBT_PUBLIC_DATA(type)       extern type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
 #  define XBT_PUBLIC_DATA(type)       extern type
 
 /* Link against the DLL */
 #elif (defined(_XBT_WIN32) && !defined(DLL_EXPORT) && !defined(DLL_STATIC))
 
 /* Link against the DLL */
 #elif (defined(_XBT_WIN32) && !defined(DLL_EXPORT) && !defined(DLL_STATIC))
-#  define XBT_PUBLIC(type)            extern __declspec(dllimport) type
+#  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(type)       extern __declspec(dllimport) type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  __declspec(dllimport) type
 #  define XBT_PUBLIC_DATA(type)       extern __declspec(dllimport) type
 
 /* UNIX build */
 #else
 
 /* UNIX build */
 #else
-#  define XBT_PUBLIC(type)            extern type
+#  define XBT_PUBLIC(type)            type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
 #  define XBT_PUBLIC_DATA(type)       extern type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
 #  define XBT_PUBLIC_DATA(type)       extern type
index 0ddc491..623eed1 100644 (file)
@@ -1227,7 +1227,7 @@ XBT_PUBLIC_DATA(xbt_dynar_t) host_that_restart;
 /** \ingroup SURF_simulation
  *  \brief List of hosts for which one want to be notified if they ever restart.
  */
 /** \ingroup SURF_simulation
  *  \brief List of hosts for which one want to be notified if they ever restart.
  */
-XBT_PUBLIC(xbt_dict_t) watched_hosts_lib;
+XBT_PUBLIC_DATA(xbt_dict_t) watched_hosts_lib;
 
 /*******************************************/
 /*** SURF Platform *************************/
 
 /*******************************************/
 /*** SURF Platform *************************/
index 1f4b694..b06099e 100644 (file)
@@ -310,7 +310,7 @@ void TRACE_surf_link_set_utilization(const char *resource,
                                      double value,
                                      double now,
                                      double delta);
                                      double value,
                                      double now,
                                      double delta);
-void TRACE_surf_resource_utilization_alloc(void);
+XBT_PUBLIC(void) TRACE_surf_resource_utilization_alloc(void);
 
 /* instr_paje.c */
 extern xbt_dict_t trivaNodeTypes;
 
 /* instr_paje.c */
 extern xbt_dict_t trivaNodeTypes;
index dc8c59d..e76bf23 100644 (file)
@@ -10,7 +10,7 @@
 SG_BEGIN_DECL()
 
 /********************************* Simcalls *********************************/
 SG_BEGIN_DECL()
 
 /********************************* Simcalls *********************************/
-XBT_PUBLIC(const char*) simcall_names[]; /* Name of each simcall */
+XBT_PUBLIC_DATA(const char*) simcall_names[]; /* Name of each simcall */
 
 #include "popping_enum.h" /* Definition of e_smx_simcall_t, with one value per simcall */
 #include "mc/mc_forward.h" /* Definition of mc_snapshot_t, used by one simcall */
 
 #include "popping_enum.h" /* Definition of e_smx_simcall_t, with one value per simcall */
 #include "mc/mc_forward.h" /* Definition of mc_snapshot_t, used by one simcall */
index de6859a..4cf5998 100644 (file)
@@ -223,7 +223,7 @@ public:
  * @details A CpuAction represent the execution of code on a Cpu
  */
 XBT_PUBLIC_CLASS CpuAction : public Action {
  * @details A CpuAction represent the execution of code on a Cpu
  */
 XBT_PUBLIC_CLASS CpuAction : public Action {
-friend CpuPtr getActionCpu(CpuActionPtr action);
+friend XBT_PUBLIC(CpuPtr) getActionCpu(CpuActionPtr action);
 public:
   /**
    * @brief CpuAction constructor
 public:
   /**
    * @brief CpuAction constructor
index fc954fc..9100182 100644 (file)
@@ -60,7 +60,7 @@ XBT_PUBLIC(double) surf_get_clock(void);
 }
 
 extern double sg_sender_gap;
 }
 
 extern double sg_sender_gap;
-XBT_PUBLIC(int)  SURF_CPU_LEVEL;    //Surf cpu level
+XBT_PUBLIC_DATA(int)  SURF_CPU_LEVEL;    //Surf cpu level
 
 extern surf_callback(void, void) surfExitCallbacks;
 
 
 extern surf_callback(void, void) surfExitCallbacks;
 
index 72291ae..114bfa5 100644 (file)
@@ -20,7 +20,7 @@
 
 SG_BEGIN_DECL()
 
 
 SG_BEGIN_DECL()
 
-extern xbt_dict_t watched_hosts_lib;
+XBT_PUBLIC_DATA(xbt_dict_t) watched_hosts_lib;
 
 extern const char *surf_action_state_names[6];
 
 
 extern const char *surf_action_state_names[6];
 
index 3193ec3..e01bd36 100644 (file)
@@ -1403,4 +1403,3 @@ xbt_dynar_t surf_AS_get_hosts(AsPtr as) {
 void surf_AS_get_graph(AS_t as, xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) {
   as->getGraph(graph, nodes, edges);
 }
 void surf_AS_get_graph(AS_t as, xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) {
   as->getGraph(graph, nodes, edges);
 }
-
index c442f02..a45a29c 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef NETWORK_ROUTING_HPP_
 #define NETWORK_ROUTING_HPP_
 
 #ifndef NETWORK_ROUTING_HPP_
 #define NETWORK_ROUTING_HPP_
 
-void routing_model_create( void *loopback);
+XBT_PUBLIC(void) routing_model_create( void *loopback);
 
 /* ************************************************************************** */
 /* ************************* GRAPH EXPORTING FUNCTIONS ********************** */
 
 /* ************************************************************************** */
 /* ************************* GRAPH EXPORTING FUNCTIONS ********************** */
index 07ef47d..98a4cbe 100644 (file)
@@ -290,7 +290,7 @@ struct mdesc {
 
 /* A default malloc descriptor for the single sbrk() managed region. */
 
 
 /* A default malloc descriptor for the single sbrk() managed region. */
 
-XBT_PUBLIC( struct mdesc ) *__mmalloc_default_mdp;
+XBT_PUBLIC_DATA( struct mdesc ) *__mmalloc_default_mdp;
 
 /* Remap a mmalloc region that was previously mapped. */
 
 
 /* Remap a mmalloc region that was previously mapped. */