Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
In XBT_LOG_NEW_SUBCATEGORY_helper, protect function declaration with SG_{BEGIN,END...
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 5 Dec 2013 20:49:55 +0000 (21:49 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 5 Dec 2013 21:20:04 +0000 (22:20 +0100)
Also remove now useless extern "C" specifications.

17 files changed:
include/xbt/log.h
src/surf/cpu_cas01.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_ti.cpp
src/surf/network_interface.cpp
src/surf/storage_interface.cpp
src/surf/surf_interface.cpp
src/surf/surf_routing.cpp
src/surf/surf_routing_cluster.cpp
src/surf/surf_routing_dijkstra.cpp
src/surf/surf_routing_floyd.cpp
src/surf/surf_routing_full.cpp
src/surf/surf_routing_generic.cpp
src/surf/surf_routing_none.cpp
src/surf/surf_routing_vivaldi.cpp
src/surf/vm_workstation_interface.cpp
src/surf/workstation_interface.cpp

index 697cb50..4801360 100644 (file)
@@ -126,6 +126,7 @@ typedef enum {
  * to avoid an extra declaration of root when XBT_LOG_NEW_SUBCATEGORY is called by
  * XBT_LOG_NEW_CATEGORY */
 #define XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc)           \
  * to avoid an extra declaration of root when XBT_LOG_NEW_SUBCATEGORY is called by
  * XBT_LOG_NEW_CATEGORY */
 #define XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc)           \
+  SG_BEGIN_DECL()                                                       \
   XBT_PUBLIC(void) _XBT_LOGV_CTOR(catName)(void) _XBT_LOGV_CTOR_ATTRIBUTE; \
   void _XBT_LOGV_CTOR(catName)(void)                                    \
   {                                                                     \
   XBT_PUBLIC(void) _XBT_LOGV_CTOR(catName)(void) _XBT_LOGV_CTOR_ATTRIBUTE; \
   void _XBT_LOGV_CTOR(catName)(void)                                    \
   {                                                                     \
@@ -134,6 +135,7 @@ typedef enum {
       _xbt_log_cat_init(&_XBT_LOGV(catName), xbt_log_priority_uninitialized); \
     }                                                                   \
   }                                                                     \
       _xbt_log_cat_init(&_XBT_LOGV(catName), xbt_log_priority_uninitialized); \
     }                                                                   \
   }                                                                     \
+  SG_END_DECL()                                                         \
   XBT_EXPORT_NO_IMPORT(s_xbt_log_category_t) _XBT_LOGV(catName) = {     \
     &_XBT_LOGV(parent),                                                 \
     NULL /* firstChild */,                                              \
   XBT_EXPORT_NO_IMPORT(s_xbt_log_category_t) _XBT_LOGV(catName) = {     \
     &_XBT_LOGV(parent),                                                 \
     NULL /* firstChild */,                                              \
index 2e71b13..648e0c4 100644 (file)
@@ -9,10 +9,8 @@
 #include "maxmin_private.h"
 #include "simgrid/sg_config.h"
 
 #include "maxmin_private.h"
 #include "simgrid/sg_config.h"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu,
                                 "Logging specific to the SURF CPU IMPROVED module");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu,
                                 "Logging specific to the SURF CPU IMPROVED module");
-}
 
 /*************
  * CallBacks *
 
 /*************
  * CallBacks *
index c80c77a..57d285a 100644 (file)
@@ -1,10 +1,8 @@
 #include "cpu_interface.hpp"
 
 #include "cpu_interface.hpp"
 
-extern "C" {
 XBT_LOG_EXTERNAL_CATEGORY(surf_kernel);
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
                                 "Logging specific to the SURF cpu module");
 XBT_LOG_EXTERNAL_CATEGORY(surf_kernel);
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
                                 "Logging specific to the SURF cpu module");
-}
 
 CpuModelPtr surf_cpu_model_pm;
 CpuModelPtr surf_cpu_model_vm;
 
 CpuModelPtr surf_cpu_model_pm;
 CpuModelPtr surf_cpu_model_vm;
index 568dd75..f7b25dd 100644 (file)
@@ -5,10 +5,8 @@
 #ifndef SURF_MODEL_CPUTI_H_
 #define SURF_MODEL_CPUTI_H_
 
 #ifndef SURF_MODEL_CPUTI_H_
 #define SURF_MODEL_CPUTI_H_
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf_cpu,
                                 "Logging specific to the SURF CPU TRACE INTEGRATION module");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf_cpu,
                                 "Logging specific to the SURF CPU TRACE INTEGRATION module");
-}
 
 static void cpu_ti_action_update_index_heap(void *action, int i);
 
 
 static void cpu_ti_action_update_index_heap(void *action, int i);
 
index 3e7130d..a7767aa 100644 (file)
 #ifndef NETWORK_INTERFACE_CPP_
 #define NETWORK_INTERFACE_CPP_
 
 #ifndef NETWORK_INTERFACE_CPP_
 #define NETWORK_INTERFACE_CPP_
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
                                 "Logging specific to the SURF network module");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
                                 "Logging specific to the SURF network module");
-}
 
 NetworkModelPtr surf_network_model = NULL;
 
 
 NetworkModelPtr surf_network_model = NULL;
 
index bf6a106..f39a118 100644 (file)
@@ -1,10 +1,8 @@
 #include "storage_interface.hpp"
 #include "surf_private.h"
 
 #include "storage_interface.hpp"
 #include "surf_private.h"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf,
                                 "Logging specific to the SURF storage module");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf,
                                 "Logging specific to the SURF storage module");
-}
 
 xbt_lib_t storage_lib;
 int ROUTING_STORAGE_LEVEL;      //Routing for storagelevel
 
 xbt_lib_t storage_lib;
 int ROUTING_STORAGE_LEVEL;      //Routing for storagelevel
index b87f73c..ea208ec 100644 (file)
@@ -9,13 +9,9 @@
 #include "simgrid/sg_config.h"
 #include "mc/mc.h"
 
 #include "simgrid/sg_config.h"
 #include "mc/mc.h"
 
-extern "C" {
 XBT_LOG_NEW_CATEGORY(surf, "All SURF categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
                                 "Logging specific to SURF (kernel)");
 XBT_LOG_NEW_CATEGORY(surf, "All SURF categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
                                 "Logging specific to SURF (kernel)");
-}
-
-
 
 /*********
  * Utils *
 
 /*********
  * Utils *
index cb3672c..e277425 100644 (file)
@@ -66,9 +66,7 @@ AsPtr current_routing = NULL;
 /* global parse functions */
 extern xbt_dynar_t mount_list;
 
 /* global parse functions */
 extern xbt_dynar_t mount_list;
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route, surf, "Routing part of surf");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route, surf, "Routing part of surf");
-}
 
 static void routing_parse_peer(sg_platf_peer_cbarg_t peer);     /* peer bypass */
 static void routing_parse_Srandom(void);        /* random bypass */
 
 static void routing_parse_peer(sg_platf_peer_cbarg_t peer);     /* peer bypass */
 static void routing_parse_Srandom(void);        /* random bypass */
index ec647c8..ca6288f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2009, 2010, 2011, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,9 +6,7 @@
 
 #include "surf_routing_cluster.hpp"
 
 
 #include "surf_routing_cluster.hpp"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
-}
 
 /* This routing is specifically setup to represent clusters, aka homogeneous sets of machines
  * Note that a router is created, easing the interconnexion with the rest of the world.
 
 /* This routing is specifically setup to represent clusters, aka homogeneous sets of machines
  * Note that a router is created, easing the interconnexion with the rest of the world.
index 9cececc..b535cf2 100644 (file)
@@ -10,9 +10,7 @@
 /* Global vars */
 extern routing_platf_t routing_platf;
 
 /* Global vars */
 extern routing_platf_t routing_platf;
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_dijkstra, surf, "Routing part of surf -- dijkstra routing logic");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_dijkstra, surf, "Routing part of surf -- dijkstra routing logic");
-}
 
 /* Free functions */
 
 
 /* Free functions */
 
index 9c57837..0f2bd28 100644 (file)
@@ -7,9 +7,7 @@
 #include "surf_routing_floyd.hpp"
 #include "network_interface.hpp"
 
 #include "surf_routing_floyd.hpp"
 #include "network_interface.hpp"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf");
-}
 
 #define TO_FLOYD_COST(i,j) (p_costTable)[(i)+(j)*table_size]
 #define TO_FLOYD_PRED(i,j) (p_predecessorTable)[(i)+(j)*table_size]
 
 #define TO_FLOYD_COST(i,j) (p_costTable)[(i)+(j)*table_size]
 #define TO_FLOYD_PRED(i,j) (p_predecessorTable)[(i)+(j)*table_size]
index 420f237..25f5532 100644 (file)
@@ -7,9 +7,7 @@
 #include "surf_routing_full.hpp"
 #include "network_interface.hpp"
 
 #include "surf_routing_full.hpp"
 #include "network_interface.hpp"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
-}
 
 /* Global vars */
 extern routing_platf_t routing_platf;
 
 /* Global vars */
 extern routing_platf_t routing_platf;
index 09bda40..1558ff3 100644 (file)
@@ -10,9 +10,7 @@
 #include "network_interface.hpp"
 #include "xbt/graph.h"
 
 #include "network_interface.hpp"
 #include "xbt/graph.h"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic implementation of the surf routing");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic implementation of the surf routing");
-}
 
 static int no_bypassroute_declared = 1;
 
 
 static int no_bypassroute_declared = 1;
 
index e24f244..c17e02d 100644 (file)
@@ -6,9 +6,7 @@
 
 #include "surf_routing_none.hpp"
 
 
 #include "surf_routing_none.hpp"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_none, surf, "Routing part of surf");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_none, surf, "Routing part of surf");
-}
 
 AS_t model_none_create(void)
 {
 
 AS_t model_none_create(void)
 {
index c55d9b0..6f41791 100644 (file)
@@ -1,9 +1,7 @@
 #include "surf_routing_vivaldi.hpp"
 #include "network_interface.hpp"
 
 #include "surf_routing_vivaldi.hpp"
 #include "network_interface.hpp"
 
-extern "C" {
-  XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_vivaldi, surf, "Routing part of surf");
-}
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_vivaldi, surf, "Routing part of surf");
 
 static XBT_INLINE double euclidean_dist_comp(int index, xbt_dynar_t src, xbt_dynar_t dst) {
   double src_coord, dst_coord;
 
 static XBT_INLINE double euclidean_dist_comp(int index, xbt_dynar_t src, xbt_dynar_t dst) {
   double src_coord, dst_coord;
index 4dff946..5b66145 100644 (file)
@@ -7,10 +7,8 @@
 #include "vm_workstation_interface.hpp"
 #include "cpu_cas01.hpp"
 
 #include "vm_workstation_interface.hpp"
 #include "cpu_cas01.hpp"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm_workstation, surf,
                                 "Logging specific to the SURF VM workstation module");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm_workstation, surf,
                                 "Logging specific to the SURF VM workstation module");
-}
 
 WorkstationVMModelPtr surf_vm_workstation_model = NULL;
 
 
 WorkstationVMModelPtr surf_vm_workstation_model = NULL;
 
index a834d3a..3b4341d 100644 (file)
@@ -3,10 +3,8 @@
 #include "cpu_cas01.hpp"
 #include "simgrid/sg_config.h"
 
 #include "cpu_cas01.hpp"
 #include "simgrid/sg_config.h"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf,
                                 "Logging specific to the SURF workstation module");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf,
                                 "Logging specific to the SURF workstation module");
-}
 
 WorkstationModelPtr surf_workstation_model = NULL;
 
 
 WorkstationModelPtr surf_workstation_model = NULL;