From 93c8beeb914dc3624c3818b21f17567345b4d36c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 5 Dec 2013 21:49:55 +0100 Subject: [PATCH] In XBT_LOG_NEW_SUBCATEGORY_helper, protect function declaration with SG_{BEGIN,END}_DECL(). Also remove now useless extern "C" specifications. --- include/xbt/log.h | 2 ++ src/surf/cpu_cas01.cpp | 2 -- src/surf/cpu_interface.cpp | 2 -- src/surf/cpu_ti.cpp | 2 -- src/surf/network_interface.cpp | 2 -- src/surf/storage_interface.cpp | 2 -- src/surf/surf_interface.cpp | 4 ---- src/surf/surf_routing.cpp | 2 -- src/surf/surf_routing_cluster.cpp | 4 +--- src/surf/surf_routing_dijkstra.cpp | 2 -- src/surf/surf_routing_floyd.cpp | 2 -- src/surf/surf_routing_full.cpp | 2 -- src/surf/surf_routing_generic.cpp | 2 -- src/surf/surf_routing_none.cpp | 2 -- src/surf/surf_routing_vivaldi.cpp | 4 +--- src/surf/vm_workstation_interface.cpp | 2 -- src/surf/workstation_interface.cpp | 2 -- 17 files changed, 4 insertions(+), 36 deletions(-) diff --git a/include/xbt/log.h b/include/xbt/log.h index 697cb50dd2..48013600da 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -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) \ + SG_BEGIN_DECL() \ 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); \ } \ } \ + SG_END_DECL() \ XBT_EXPORT_NO_IMPORT(s_xbt_log_category_t) _XBT_LOGV(catName) = { \ &_XBT_LOGV(parent), \ NULL /* firstChild */, \ diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index 2e71b1343e..648e0c4ec6 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -9,10 +9,8 @@ #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"); -} /************* * CallBacks * diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index c80c77abde..57d285af19 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -1,10 +1,8 @@ #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"); -} CpuModelPtr surf_cpu_model_pm; CpuModelPtr surf_cpu_model_vm; diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 568dd75612..f7b25dd11c 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -5,10 +5,8 @@ #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"); -} static void cpu_ti_action_update_index_heap(void *action, int i); diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 3e7130da4f..a7767aaf60 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -10,10 +10,8 @@ #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"); -} NetworkModelPtr surf_network_model = NULL; diff --git a/src/surf/storage_interface.cpp b/src/surf/storage_interface.cpp index bf6a106d61..f39a1184d1 100644 --- a/src/surf/storage_interface.cpp +++ b/src/surf/storage_interface.cpp @@ -1,10 +1,8 @@ #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_lib_t storage_lib; int ROUTING_STORAGE_LEVEL; //Routing for storagelevel diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index b87f73c348..ea208ec3c5 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -9,13 +9,9 @@ #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)"); -} - - /********* * Utils * diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index cb3672ceff..e27742595d 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -66,9 +66,7 @@ AsPtr current_routing = NULL; /* global parse functions */ extern xbt_dynar_t mount_list; -extern "C" { 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 */ diff --git a/src/surf/surf_routing_cluster.cpp b/src/surf/surf_routing_cluster.cpp index ec647c837b..ca6288f902 100644 --- a/src/surf/surf_routing_cluster.cpp +++ b/src/surf/surf_routing_cluster.cpp @@ -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 @@ -6,9 +6,7 @@ #include "surf_routing_cluster.hpp" -extern "C" { 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. diff --git a/src/surf/surf_routing_dijkstra.cpp b/src/surf/surf_routing_dijkstra.cpp index 9cececcbce..b535cf2e4d 100644 --- a/src/surf/surf_routing_dijkstra.cpp +++ b/src/surf/surf_routing_dijkstra.cpp @@ -10,9 +10,7 @@ /* 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"); -} /* Free functions */ diff --git a/src/surf/surf_routing_floyd.cpp b/src/surf/surf_routing_floyd.cpp index 9c578379b0..0f2bd28770 100644 --- a/src/surf/surf_routing_floyd.cpp +++ b/src/surf/surf_routing_floyd.cpp @@ -7,9 +7,7 @@ #include "surf_routing_floyd.hpp" #include "network_interface.hpp" -extern "C" { 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] diff --git a/src/surf/surf_routing_full.cpp b/src/surf/surf_routing_full.cpp index 420f237a4b..25f5532ddf 100644 --- a/src/surf/surf_routing_full.cpp +++ b/src/surf/surf_routing_full.cpp @@ -7,9 +7,7 @@ #include "surf_routing_full.hpp" #include "network_interface.hpp" -extern "C" { XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf"); -} /* Global vars */ extern routing_platf_t routing_platf; diff --git a/src/surf/surf_routing_generic.cpp b/src/surf/surf_routing_generic.cpp index 09bda40bd2..1558ff339f 100644 --- a/src/surf/surf_routing_generic.cpp +++ b/src/surf/surf_routing_generic.cpp @@ -10,9 +10,7 @@ #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"); -} static int no_bypassroute_declared = 1; diff --git a/src/surf/surf_routing_none.cpp b/src/surf/surf_routing_none.cpp index e24f244039..c17e02d854 100644 --- a/src/surf/surf_routing_none.cpp +++ b/src/surf/surf_routing_none.cpp @@ -6,9 +6,7 @@ #include "surf_routing_none.hpp" -extern "C" { XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_none, surf, "Routing part of surf"); -} AS_t model_none_create(void) { diff --git a/src/surf/surf_routing_vivaldi.cpp b/src/surf/surf_routing_vivaldi.cpp index c55d9b035a..6f4179198c 100644 --- a/src/surf/surf_routing_vivaldi.cpp +++ b/src/surf/surf_routing_vivaldi.cpp @@ -1,9 +1,7 @@ #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; diff --git a/src/surf/vm_workstation_interface.cpp b/src/surf/vm_workstation_interface.cpp index 4dff946e5b..5b66145f11 100644 --- a/src/surf/vm_workstation_interface.cpp +++ b/src/surf/vm_workstation_interface.cpp @@ -7,10 +7,8 @@ #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"); -} WorkstationVMModelPtr surf_vm_workstation_model = NULL; diff --git a/src/surf/workstation_interface.cpp b/src/surf/workstation_interface.cpp index a834d3a7f9..3b4341d010 100644 --- a/src/surf/workstation_interface.cpp +++ b/src/surf/workstation_interface.cpp @@ -3,10 +3,8 @@ #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"); -} WorkstationModelPtr surf_workstation_model = NULL; -- 2.20.1