Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Switch sg_platf to C++
authorGabriel Corona <gabriel.corona@loria.fr>
Wed, 25 Nov 2015 08:42:08 +0000 (09:42 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Wed, 25 Nov 2015 09:16:59 +0000 (10:16 +0100)
Because we need it for the next commit.

src/surf/sg_platf.cpp [moved from src/surf/sg_platf.c with 99% similarity]
tools/cmake/DefinePackages.cmake

similarity index 99%
rename from src/surf/sg_platf.c
rename to src/surf/sg_platf.cpp
index 504e9e3..5425bc1 100644 (file)
 #include "xbt/RngStream.h"
 #include "simgrid/platf_interface.h"
 
+extern "C" {
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
+}
+
 xbt_dynar_t sg_platf_host_cb_list = NULL;   // of sg_platf_host_cb_t
 xbt_dynar_t sg_platf_host_link_cb_list = NULL;   // of sg_platf_host_link_cb_t
 xbt_dynar_t sg_platf_link_cb_list = NULL;   // of sg_platf_link_cb_t
@@ -46,7 +49,7 @@ xbt_dynar_t sg_platf_gpu_cb_list = NULL;
 /* ***************************************** */
 
 
-static int surf_parse_models_setup_already_called;
+static int surf_parse_models_setup_already_called = 0;
 
 /* one RngStream for the platform, to respect some statistic rules */
 static RngStream sg_platf_rng_stream = NULL;
@@ -299,8 +302,6 @@ void sg_platf_end() {
   }
 }
 
-static int surf_parse_models_setup_already_called = 0;
-
 void sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS) {
   unsigned int iterator;
   sg_platf_AS_cb_t fun;
index e0bcf1f..a1d50a3 100644 (file)
@@ -323,7 +323,7 @@ set(SURF_SRC
   src/surf/platf_generator.c
   src/surf/plugins/energy.cpp
   src/surf/random_mgr.c
-  src/surf/sg_platf.c
+  src/surf/sg_platf.cpp
   src/surf/storage_interface.cpp
   src/surf/storage_n11.cpp
   src/surf/surf_c_bindings.cpp