X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/77bbf3027c4240a2e833209a3a3f186589da8577..c533259777a80ef9daddc0a5f9d0e265a289f1b0:/src/xbt/config.cpp diff --git a/src/xbt/config.cpp b/src/xbt/config.cpp index cb26929e8c..5ca3c34908 100644 --- a/src/xbt/config.cpp +++ b/src/xbt/config.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -29,10 +29,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support"); -XBT_EXPORT_NO_IMPORT(xbt_cfg_t) simgrid_config = nullptr; -extern "C" { - XBT_PUBLIC(void) sg_config_finalize(); -} +XBT_EXPORT_NO_IMPORT xbt_cfg_t simgrid_config = nullptr; +extern "C" XBT_PUBLIC void sg_config_finalize(); namespace simgrid { namespace config { @@ -379,16 +377,15 @@ void Config::help() // ***** getConfig ***** -template -XBT_PUBLIC(T const&) getConfig(const char* name) +template XBT_PUBLIC T const& getConfig(const char* name) { return (*simgrid_config)[name].getValue(); } -template XBT_PUBLIC(int const&) getConfig(const char* name); -template XBT_PUBLIC(double const&) getConfig(const char* name); -template XBT_PUBLIC(bool const&) getConfig(const char* name); -template XBT_PUBLIC(std::string const&) getConfig(const char* name); +template XBT_PUBLIC int const& getConfig(const char* name); +template XBT_PUBLIC double const& getConfig(const char* name); +template XBT_PUBLIC bool const& getConfig(const char* name); +template XBT_PUBLIC std::string const& getConfig(const char* name); // ***** alias ***** @@ -399,9 +396,8 @@ void alias(const char* realname, const char* aliasname) // ***** declareFlag ***** -template -XBT_PUBLIC(void) declareFlag(const char* name, const char* description, - T value, std::function callback) +template +XBT_PUBLIC void declareFlag(const char* name, const char* description, T value, std::function callback) { if (simgrid_config == nullptr) { simgrid_config = xbt_cfg_new(); @@ -411,15 +407,14 @@ XBT_PUBLIC(void) declareFlag(const char* name, const char* description, name, description, std::move(value), std::move(callback)); } -template XBT_PUBLIC(void) declareFlag(const char* name, - const char* description, int value, std::function callback); -template XBT_PUBLIC(void) declareFlag(const char* name, - const char* description, double value, std::function callback); -template XBT_PUBLIC(void) declareFlag(const char* name, - const char* description, bool value, std::function callback); -template XBT_PUBLIC(void) declareFlag(const char* name, - const char* description, std::string value, std::function callback); - +template XBT_PUBLIC void declareFlag(const char* name, const char* description, int value, + std::function callback); +template XBT_PUBLIC void declareFlag(const char* name, const char* description, double value, + std::function callback); +template XBT_PUBLIC void declareFlag(const char* name, const char* description, bool value, + std::function callback); +template XBT_PUBLIC void declareFlag(const char* name, const char* description, std::string value, + std::function callback); } } @@ -765,7 +760,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_cfg); XBT_TEST_SUITE("config", "Configuration support"); -XBT_PUBLIC_DATA(xbt_cfg_t) simgrid_config; +XBT_PUBLIC_DATA xbt_cfg_t simgrid_config; static void make_set() {