Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
In C++ files, replace SG_{BEGIN,END}+_DECL() by extern "C" { }.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 10 Oct 2017 09:29:10 +0000 (11:29 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 10 Oct 2017 11:29:22 +0000 (13:29 +0200)
58 files changed:
include/simgrid/jedule/jedule.hpp
include/simgrid/jedule/jedule_events.hpp
include/simgrid/jedule/jedule_platform.hpp
src/bindings/java/jmsg.cpp
src/bindings/java/jmsg.hpp
src/bindings/java/jmsg_as.cpp
src/bindings/java/jmsg_as.hpp
src/bindings/java/jmsg_comm.cpp
src/bindings/java/jmsg_file.cpp
src/bindings/java/jmsg_host.cpp
src/bindings/java/jmsg_process.cpp
src/bindings/java/jmsg_rngstream.cpp
src/bindings/java/jmsg_storage.cpp
src/bindings/java/jmsg_synchro.cpp
src/bindings/java/jmsg_task.cpp
src/bindings/java/jmsg_vm.cpp
src/bindings/java/jtrace.cpp
src/bindings/java/jxbt_utilities.cpp
src/bindings/java/jxbt_utilities.hpp
src/include/smpi/smpi_utils.hpp
src/include/surf/maxmin.hpp
src/instr/instr_private.hpp
src/instr/instr_smpi.hpp
src/kernel/context/Context.hpp
src/kernel/routing/RoutedZone.hpp
src/mc/checker/LivenessChecker.hpp
src/mc/mc_comm_pattern.hpp
src/mc/mc_private.hpp
src/mc/mc_record.hpp
src/mc/mc_smx.hpp
src/mc/mc_snapshot.hpp
src/msg/msg_actions.cpp
src/msg/msg_deployment.cpp
src/msg/msg_environment.cpp
src/msg/msg_global.cpp
src/msg/msg_gos.cpp
src/msg/msg_host.cpp
src/msg/msg_io.cpp
src/msg/msg_mailbox.cpp
src/msg/msg_private.hpp
src/msg/msg_process.cpp
src/msg/msg_task.cpp
src/msg/msg_vm.cpp
src/simdag/simdag_private.hpp
src/simix/ActorImpl.hpp
src/simix/popping_private.hpp
src/simix/smx_host_private.hpp
src/simix/smx_private.hpp
src/smpi/include/private.hpp
src/surf/ns3/ns3_interface.hpp
src/surf/plugins/host_energy.cpp
src/surf/plugins/host_load.cpp
src/surf/surf_private.hpp
src/surf/trace_mgr.hpp
src/surf/xml/platf.hpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_parseplatf.cpp
src/surf/xml/surfxml_sax_cb.cpp

index ebb956e..0ea9ab8 100644 (file)
@@ -36,11 +36,9 @@ public:
 }
 }
 
-SG_BEGIN_DECL()
-
+extern "C" {
 typedef simgrid::jedule::Jedule *jedule_t;
-
-SG_END_DECL()
+}
 #endif
 
 #endif /* JEDULE_HPP_ */
index aa16099..704d4f6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -40,11 +40,9 @@ XBT_PUBLIC_CLASS Event{
 }
 }
 
-SG_BEGIN_DECL()
-
+extern "C" {
 typedef simgrid::jedule::Event * jed_event_t;
-
-SG_END_DECL()
+}
 
 #endif
 
index caaf672..9510ad0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -50,12 +50,11 @@ public:
 
 }
 }
-SG_BEGIN_DECL()
+extern "C" {
 typedef simgrid::jedule::Container * jed_container_t;
 typedef simgrid::jedule::Subset * jed_subset_t;
 void get_resource_selection_by_hosts(std::vector<jed_subset_t>* subset_list, std::vector<sg_host_t> *host_list);
-
-SG_END_DECL()
+}
 
 #endif
 
index 804cc7b..971a496 100644 (file)
@@ -38,7 +38,7 @@
 #endif
 /* end of eclipse-mandated pimple */
 
-SG_BEGIN_DECL()
+extern "C" {
 
 int JAVA_HOST_LEVEL = -1;
 
@@ -243,8 +243,7 @@ Java_org_simgrid_msg_Msg_deployApplication(JNIEnv * env, jclass cls, jstring jde
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit() {
   sg_host_energy_plugin_init();
 }
-
-SG_END_DECL()
+} // extern "C"
 
 /** Run a Java org.simgrid.msg.Process
  *
index 9e6996a..afb050f 100644 (file)
@@ -11,7 +11,7 @@
 #include <simgrid/msg.h>
 #include <unordered_map>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
 #ifndef JNIEXPORT
@@ -48,6 +48,5 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_critical(JNIEnv * env, jclass cl
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv * env, jclass cls, jstring jplatformFile);
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv * env, jclass cls);
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_deployApplication(JNIEnv * env, jclass cls, jstring jdeploymentFile);
-
-SG_END_DECL()
+}
 #endif
index cdf07b7..3b5109b 100644 (file)
@@ -16,7 +16,7 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jas_method_As_constructor;
 static jfieldID jas_field_As_bind;
@@ -155,5 +155,4 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo
   }
   return jtable;
 }
-
-SG_END_DECL()
+}
index 2d9e1cb..f79ef9b 100644 (file)
@@ -10,7 +10,7 @@
 #include <jni.h>
 #include "simgrid/msg.h"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
 #ifndef JNIEXPORT
@@ -32,6 +32,5 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getName(JNIEnv * env, jobject
 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv* env, jobject jnetzone);
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobject jhost, jobject jname);
 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv* env, jobject jnetzone);
-
-SG_END_DECL()
+}
 #endif
index 011d39d..f58666a 100644 (file)
@@ -14,7 +14,7 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jfieldID jcomm_field_Comm_bind;
 static jfieldID jcomm_field_Comm_finished;
@@ -166,5 +166,4 @@ JNIEXPORT int JNICALL Java_org_simgrid_msg_Comm_waitAny(JNIEnv *env, jclass cls,
   xbt_dynar_free(&dyn);
   return rank;
 }
-
-SG_END_DECL()
+}
index b1b8377..ff8dcba 100644 (file)
@@ -8,7 +8,7 @@
 #include "jmsg_file.h"
 #include "jxbt_utilities.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd) {
   env->SetLongField(jfile, jfile_field_bind, reinterpret_cast<std::intptr_t>(fd));
@@ -53,5 +53,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_File_close(JNIEnv *env, jobject jfil
   MSG_file_close(file);
   jfile_bind(env, jfile, nullptr);
 }
-
-SG_END_DECL()
+}
index a5a8b91..98b7f09 100644 (file)
@@ -16,7 +16,7 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jhost_method_Host_constructor;
 static jfieldID jhost_field_Host_bind;
@@ -374,5 +374,4 @@ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getPowerPeakAt(JNIEnv* env,
   msg_host_t host = jhost_get_native(env, jhost);
   return MSG_host_get_power_peak_at(host, pstate);
 }
-
-SG_END_DECL()
+}
index 023e199..330a89b 100644 (file)
@@ -16,7 +16,7 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 jfieldID jprocess_field_Process_bind;
 jfieldID jprocess_field_Process_host;
@@ -289,5 +289,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , j
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
   return (jint) MSG_process_get_number();
 }
-
-SG_END_DECL()
+}
index b294843..cf069b3 100644 (file)
@@ -10,7 +10,7 @@
 #include "jmsg_rngstream.h"
 #include "jxbt_utilities.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 jfieldID jrngstream_bind;
 
@@ -145,5 +145,4 @@ JNIEXPORT jint JNICALL Java_org_simgrid_msg_RngStream_randInt(JNIEnv *env, jobje
 
   return (jint)RngStream_RandInt(rngstream, (int)i, (int)j);
 }
-
-SG_END_DECL()
+}
index f421d02..e92d050 100644 (file)
@@ -13,7 +13,7 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jstorage_method_Storage_constructor;
 static jfieldID jstorage_field_Storage_bind;
@@ -227,5 +227,4 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Storage_all(JNIEnv * env, jc
   xbt_dynar_free(&table);
   return jtable;
 }
-
-SG_END_DECL()
+}
index 51d3cba..a831b3f 100644 (file)
@@ -14,7 +14,7 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jfieldID jsynchro_field_Mutex_bind;
 
@@ -94,5 +94,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeFinalize(JNIEnv * en
   sem = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
   MSG_sem_destroy(sem);
 }
-
-SG_END_DECL()
+}
index 77f5872..77a54f0 100644 (file)
@@ -15,7 +15,7 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jtask_method_Comm_constructor;
 
@@ -525,5 +525,4 @@ JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv * env, jclass
 
   return (jint) rv;
 }
-
-SG_END_DECL()
+}
index b1cd76a..70dc62c 100644 (file)
@@ -13,7 +13,7 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 extern int JAVA_HOST_LEVEL;
 static jfieldID jvm_field_bind;
@@ -186,4 +186,4 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_VM_getVMByName(JNIEnv* env, jclas
 
   return static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
 }
-SG_END_DECL()
+}
index 667c7b4..02f22f1 100644 (file)
@@ -20,7 +20,7 @@
 // Define a new category
 XBT_LOG_NEW_DEFAULT_CATEGORY (jtrace, "TRACE for Java(TM)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclare(JNIEnv * env, jclass cls, jstring js)
 {
@@ -198,5 +198,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSet
    JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSubWithTime(JNIEnv *env, jclass cls, jdouble,
                                                                                      jstring, jstring, jstring, jdouble)
 */
-
-SG_END_DECL()
+}
index 6756075..5a285b3 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <cstdlib> /* abort */
 
-SG_BEGIN_DECL()
+extern "C" {
 
 jclass jxbt_get_class(JNIEnv * env, const char *name)
 {
@@ -211,5 +211,4 @@ void jxbt_throw_task_cancelled(JNIEnv* env, std::string details)
 {
   jxbt_throw_by_name(env, "org/simgrid/msg/TaskCancelledException", details);
 }
-
-SG_END_DECL()
+}
index 4b65d60..537167d 100644 (file)
@@ -12,7 +12,7 @@
 #include <stdint.h>
 #include <string>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Search a class and throw an exception if not found */
 jclass jxbt_get_class(JNIEnv * env, const char *name);
@@ -73,6 +73,5 @@ void jxbt_throw_time_out_failure(JNIEnv* env, std::string details);
 void jxbt_throw_task_cancelled(JNIEnv* env, std::string details);
 /** Thrown when looking for a storage from name does not lead to anything */
 void jxbt_throw_storage_not_found(JNIEnv* env, std::string invalid_name);
-
-SG_END_DECL()
+}
 #endif
index 0f98f38..8af0b0a 100644 (file)
@@ -9,7 +9,7 @@
 #include <cstddef>
 #include <vector>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 // Methods used to parse and store the values for timing injections in smpi
 typedef struct s_smpi_factor *smpi_os_factor_t;
@@ -17,8 +17,7 @@ typedef struct s_smpi_factor{
   size_t factor=0;
   std::vector<double> values;
 } s_smpi_factor_t;
-
-SG_END_DECL()
+}
 
 XBT_PUBLIC(std::vector<s_smpi_factor_t>) parse_factor(const char *smpi_coef_string);
 
index d635efd..55b4f60 100644 (file)
@@ -153,7 +153,7 @@ static inline int double_equals(double value1, double value2, double precision)
   return (fabs(value1 - value2) < precision);
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @{ @ingroup SURF_lmm */
 /**
@@ -459,6 +459,6 @@ XBT_PUBLIC(double func_vegas_fp) (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_vegas_fpi) (lmm_variable_t var, double x);
 
 /** @} */
-SG_END_DECL()
+}
 
 #endif
index 98b34ce..50a189a 100644 (file)
@@ -263,7 +263,7 @@ class NewEvent : public PajeEvent  {
 } // namespace simgrid::instr
 typedef simgrid::instr::Container* container_t;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 extern XBT_PRIVATE std::set<std::string> created_categories;
 extern XBT_PRIVATE std::set<std::string> declared_marks;
@@ -406,8 +406,7 @@ typedef struct s_instr_extra_data {
  */
 typedef enum { instr_fmt_paje, instr_fmt_TI } instr_fmt_type_t;
 extern instr_fmt_type_t instr_fmt_type;
-
-SG_END_DECL()
+}
 
 void LogContainerTypeDefinition(simgrid::instr::Type* type);
 void LogVariableTypeDefinition(simgrid::instr::Type* type);
index 77951ef..4abfe02 100644 (file)
@@ -10,7 +10,7 @@
 #include "src/instr/instr_private.hpp"
 #include <string>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PRIVATE void TRACE_internal_smpi_set_category(const char* category);
 XBT_PRIVATE const char* TRACE_internal_smpi_get_category();
@@ -48,7 +48,6 @@ typedef struct smpi_trace_call_location {
   }
 
 } smpi_trace_call_location_t;
-
-SG_END_DECL()
+}
 
 #endif
index c2ac93e..c467f05 100644 (file)
@@ -148,8 +148,7 @@ XBT_PRIVATE ContextFactory* boost_factory();
 
 typedef simgrid::kernel::context::ContextFactory *smx_context_factory_t;
 
-SG_BEGIN_DECL()
-
+extern "C" {
 
 XBT_PRIVATE void SIMIX_context_mod_init();
 XBT_PRIVATE void SIMIX_context_mod_exit();
@@ -185,8 +184,7 @@ XBT_PRIVATE smx_context_t SIMIX_context_get_current();
 XBT_PUBLIC(int) SIMIX_process_get_maxpid();
 
 XBT_PRIVATE void SIMIX_post_create_environment();
-
-SG_END_DECL()
+}
 
 XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const char *name);
 
index 3904232..74e655b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2017. 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. */
@@ -64,9 +64,9 @@ protected:
 }
 } // namespace
 
-SG_BEGIN_DECL()
+extern "C" {
 XBT_PRIVATE xbt_node_t new_xbt_graph_node(xbt_graph_t graph, const char* name, xbt_dict_t nodes);
 XBT_PRIVATE xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges);
-SG_END_DECL()
+}
 
 #endif /* SIMGRID_ROUTING_GENERIC_HPP_ */
index 93dc6cb..a6c6f42 100644 (file)
 #include "src/mc/mc_state.hpp"
 #include "src/mc/checker/Checker.hpp"
 
-SG_BEGIN_DECL()
-
-SG_END_DECL()
-
 namespace simgrid {
 namespace mc {
 
index afd3aa2..feac5b4 100644 (file)
@@ -23,7 +23,7 @@ struct PatternCommunicationList {
 }
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /**
  *  Type: `xbt_dynar_t<mc_list_comm_pattern_t>`
@@ -77,7 +77,6 @@ XBT_PRIVATE void MC_restore_communications_pattern(simgrid::mc::State* state);
 
 XBT_PRIVATE void MC_state_copy_incomplete_communications_pattern(simgrid::mc::State* state);
 XBT_PRIVATE void MC_state_copy_index_communications_pattern(simgrid::mc::State* state);
-
-SG_END_DECL()
+}
 
 #endif
index 09d17dc..8869643 100644 (file)
@@ -26,7 +26,7 @@ struct DerefAndCompareByActorsCountAndUsedHeap {
 }
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /********************************* MC Global **********************************/
 
@@ -42,8 +42,7 @@ XBT_PRIVATE void MC_show_deadlock(void);
 #define MC_VERBOSE 1
 
 /********************************** Miscellaneous **********************************/
-
-SG_END_DECL()
+}
 
 namespace simgrid {
 namespace mc {
index 698d824..2b7bfff 100644 (file)
@@ -39,8 +39,6 @@ XBT_PRIVATE void replay(const char* trace);
 }
 }
 
-SG_BEGIN_DECL()
-
 /** Whether the MC record mode is enabled
  *
  *  The behaviour is not changed. The only real difference is that
@@ -50,6 +48,4 @@ SG_BEGIN_DECL()
 
 // **** Data conversion
 
-SG_END_DECL()
-
 #endif
index d9ca09d..cebb749 100644 (file)
@@ -28,7 +28,7 @@
  * MCed code.
  */
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** Get the issuer of  a simcall (`req->issuer`)
  *
@@ -47,7 +47,6 @@ XBT_PRIVATE const char* MC_smx_actor_get_host_name(smx_actor_t p);
 XBT_PRIVATE int MC_smpi_process_count(void);
 
 XBT_PRIVATE unsigned long MC_smx_get_maxpid(void);
-
-SG_END_DECL()
+}
 
 #endif
index b0a19d0..eab2acf 100644 (file)
@@ -16,7 +16,7 @@
 #include "src/mc/mc_forward.hpp"
 #include "src/mc/mc_unw.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 // ***** Snapshot region
 
@@ -231,7 +231,6 @@ static XBT_ALWAYS_INLINE void* MC_region_read_pointer(mc_mem_region_t region, co
   void* res;
   return *(void**) MC_region_read(region, &res, addr, sizeof(void*));
 }
-
-SG_END_DECL()
+}
 
 #endif
index dd9f3a9..82619ee 100644 (file)
@@ -10,7 +10,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_action, msg, "MSG actions for trace driven simulation");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 void MSG_action_init()
 {
@@ -52,5 +52,4 @@ msg_error_t MSG_action_trace_run(char *path)
 
   return res;
 }
-
-SG_END_DECL()
+}
index d8ddde4..ae3d87a 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "src/msg/msg_private.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup msg_simulation
  * \brief An application deployer.
@@ -59,5 +59,4 @@ void MSG_set_function(const char *host_id, const char *function_name, xbt_dynar_
 {
   SIMIX_process_set_function(host_id, function_name, arguments, -1, -1);
 }
-
-SG_END_DECL()
+}
index 4392d98..92d67e9 100644 (file)
@@ -13,7 +13,7 @@
 #include <lualib.h>
 #endif
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /********************************* MSG **************************************/
 
@@ -76,5 +76,4 @@ void MSG_zone_get_hosts(msg_netzone_t netzone, xbt_dynar_t whereto)
   for (auto const& host : hosts)
     xbt_dynar_push(whereto, &host);
 }
-
-SG_END_DECL()
+}
index 8d1aca6..5651178 100644 (file)
@@ -13,7 +13,7 @@
 XBT_LOG_NEW_CATEGORY(msg, "All MSG categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg, "Logging specific to MSG (kernel)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 MSG_Global_t msg_global = nullptr;
 static void MSG_exit();
@@ -130,5 +130,4 @@ unsigned long int MSG_get_sent_msg()
 {
   return msg_global->sent_msg;
 }
-
-SG_END_DECL()
+}
index c1faa1e..3846e9e 100644 (file)
@@ -11,7 +11,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_gos, msg, "Logging specific to MSG (gos)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup msg_task_usage
  * \brief Executes a task and waits for its termination.
@@ -907,5 +907,4 @@ const char *MSG_task_get_category (msg_task_t task)
 {
   return task->category;
 }
-
-SG_END_DECL()
+}
index 844fb88..7605967 100644 (file)
@@ -13,7 +13,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg);
 
 simgrid::xbt::Extension<simgrid::s4u::Host, simgrid::MsgHostExt> simgrid::MsgHostExt::EXTENSION_ID;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 int sg_storage_max_file_descriptors = 1024;
 
@@ -266,5 +266,4 @@ xbt_dict_t MSG_host_get_storage_content(msg_host_t host)
 
   return contents;
 }
-
-SG_END_DECL()
+}
index 269ae90..592312a 100644 (file)
@@ -11,7 +11,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, msg, "Logging specific to MSG (io)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @addtogroup msg_file
  * (#msg_file_t) and the functions for managing it.
@@ -510,5 +510,4 @@ const char* MSG_storage_get_host(msg_storage_t storage)
   xbt_assert((storage != nullptr), "Invalid parameters");
   return storage->getHost()->getCname();
 }
-
-SG_END_DECL()
+}
index 394e409..791e59d 100644 (file)
@@ -10,7 +10,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_mailbox, msg, "Logging specific to MSG (mailbox)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup msg_mailbox_management
  * \brief Set the mailbox to receive in asynchronous mode
@@ -26,5 +26,4 @@ void MSG_mailbox_set_async(const char *alias){
   mailbox->setReceiver(simgrid::s4u::Actor::self());
   XBT_VERB("%s mailbox set to receive eagerly for myself\n",alias);
 }
-
-SG_END_DECL()
+}
index 614994e..6516a84 100644 (file)
@@ -98,7 +98,7 @@ typedef struct MSG_Global {
 } s_MSG_Global_t;
 typedef s_MSG_Global_t* MSG_Global_t;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PUBLIC_DATA(MSG_Global_t) msg_global;
 
@@ -135,8 +135,7 @@ XBT_PRIVATE void TRACE_msg_process_suspend(msg_process_t process);
 XBT_PRIVATE void TRACE_msg_process_resume(msg_process_t process);
 XBT_PRIVATE void TRACE_msg_process_sleep_in(msg_process_t process);   //called from msg/gos.c
 XBT_PRIVATE void TRACE_msg_process_sleep_out(msg_process_t process);
-
-SG_END_DECL()
+}
 
 inline void simdata_task::setUsed()
 {
index 27bef10..465e4cf 100644 (file)
@@ -10,7 +10,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (process)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @addtogroup m_process_management
  *
@@ -138,8 +138,7 @@ msg_process_t MSG_process_create_with_environment(const char *name, xbt_main_fun
   xbt_free(argv);
   return res;
 }
-
-SG_END_DECL()
+}
 
 msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<void()> code, void* data, msg_host_t host,
                                               std::map<std::string, std::string>* properties)
@@ -158,7 +157,7 @@ msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<vo
   return process->ciface();
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Become a process in the simulation
  *
@@ -524,5 +523,4 @@ XBT_PUBLIC(void) MSG_process_unref(msg_process_t process)
 {
   intrusive_ptr_release(process);
 }
-
-SG_END_DECL()
+}
index 6d925d0..814282b 100644 (file)
@@ -6,7 +6,7 @@
 #include "msg_private.hpp"
 #include "src/simix/smx_private.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @addtogroup m_task_management
  *
@@ -304,5 +304,4 @@ void MSG_task_set_bound(msg_task_t task, double bound)
   if (task->simdata->compute)
     simcall_execution_set_bound(task->simdata->compute, task->simdata->bound);
 }
-
-SG_END_DECL()
+}
index de4310d..50f0f47 100644 (file)
@@ -19,7 +19,7 @@
 #include "simgrid/host.h"
 #include "simgrid/simix.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 struct dirty_page {
   double prev_clock;
@@ -830,5 +830,4 @@ void MSG_vm_set_bound(msg_vm_t vm, double bound)
 {
   simgrid::simix::kernelImmediate([vm, bound]() { vm->pimpl_vm_->setBound(bound); });
 }
-
-SG_END_DECL()
+}
index b5e52f0..84cb5ee 100644 (file)
@@ -34,7 +34,7 @@ std::set<SD_task_t>* simulate (double how_long);
 }
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 extern XBT_PRIVATE simgrid::sd::Global *sd_global;
 
 /* Task */
@@ -71,5 +71,5 @@ XBT_PRIVATE void SD_task_run(SD_task_t task);
 XBT_PRIVATE bool acyclic_graph_detail(xbt_dynar_t dag);
 XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
 XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state);
-SG_END_DECL()
+}
 #endif
index a75c24e..5e9b5c2 100644 (file)
@@ -122,7 +122,7 @@ typedef simgrid::simix::ProcessArg *smx_process_arg_t;
 
 typedef simgrid::simix::ActorImpl* smx_actor_t;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PRIVATE smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, void* data, sg_host_t host,
                                              std::map<std::string, std::string>* properties,
@@ -142,8 +142,7 @@ XBT_PRIVATE smx_actor_t SIMIX_process_get_by_name(const char* name);
 XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart);
 
 extern void (*SMPI_switch_data_segment)(int dest);
-
-SG_END_DECL()
+}
 
 XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_activity_t synchro);
 XBT_PRIVATE smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, double timeout);
index f02bba8..71b1050 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <boost/intrusive_ptr.hpp>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /********************************* Simcalls *********************************/
 XBT_PUBLIC_DATA(const char*) simcall_names[]; /* Name of each simcall */
@@ -67,8 +67,7 @@ XBT_PRIVATE void SIMIX_simcall_exit(smx_activity_t synchro);
 XBT_PRIVATE const char *SIMIX_simcall_name(e_smx_simcall_t kind);
 XBT_PRIVATE void SIMIX_run_kernel(std::function<void()> const* code);
 XBT_PRIVATE void SIMIX_run_blocking(std::function<void()> const* code);
-
-SG_END_DECL()
+}
 
 /* Defines the marshal/unmarshal functions for each type of parameters.
  *
index 3b45cbf..ab59350 100644 (file)
@@ -39,7 +39,7 @@ namespace simgrid {
   }
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host, const char* name, std::function<void()> code,
                                                      void* data, double kill_time,
                                                      std::map<std::string, std::string>* properties, int auto_restart);
@@ -49,8 +49,7 @@ XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
 XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::ExecImplPtr exec);
 
 XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char *category);
-
-SG_END_DECL()
+}
 
 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
 SIMIX_execution_start(smx_actor_t issuer, const char* name, double flops_amount, double priority, double bound);
index 1f20d83..8fd641f 100644 (file)
@@ -60,7 +60,7 @@ public:
 }
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PUBLIC_DATA(std::unique_ptr<simgrid::simix::Global>) simix_global;
 
@@ -76,7 +76,6 @@ XBT_PUBLIC(void) SIMIX_clean();
   e.value = val; \
   _smx_throw_issuer->exception = std::make_exception_ptr(e); \
   } else ((void)0)
-
-SG_END_DECL()
+}
 
 #endif
index f85d4f2..9504e94 100644 (file)
@@ -13,7 +13,7 @@
 #include <unordered_map>
 #include <vector>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 #define PERSISTENT 0x1
 #define NON_PERSISTENT 0x2
@@ -413,8 +413,7 @@ typedef s_smpi_privatization_region_t* smpi_privatization_region_t;
 extern XBT_PRIVATE smpi_privatization_region_t smpi_privatization_regions;
 extern XBT_PRIVATE int smpi_loaded_page;
 extern XBT_PRIVATE int smpi_universe_size;
-
-SG_END_DECL()
+}
 
 /**
  * Get the address of the beginning of the memory page where addr is located.
index 58ed7d1..e9966b5 100644 (file)
@@ -22,7 +22,7 @@ public:
   int node_num;
 };
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PUBLIC(void) ns3_initialize(const char* TcpProtocol);
 XBT_PUBLIC(void)
@@ -32,7 +32,6 @@ XBT_PUBLIC(void) ns3_simulator(double maxSeconds);
 XBT_PUBLIC(void*) ns3_add_router(const char* id);
 XBT_PUBLIC(void) ns3_add_link(NetPointNs3* src, NetPointNs3* dst, double bw, double lat);
 XBT_PUBLIC(void) ns3_add_cluster(const char* id, double bw, double lat);
-
-SG_END_DECL()
+}
 
 #endif
index 6e102e4..1ff949d 100644 (file)
@@ -432,7 +432,7 @@ static void onSimulationEnd()
 }
 
 /* **************************** Public interface *************************** */
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup plugin_energy
  * \brief Enable host energy plugin
@@ -513,5 +513,4 @@ double sg_host_get_current_consumption(sg_host_t host)
   double cpu_load = lmm_constraint_get_usage(host->pimpl_cpu->constraint()) / host->getSpeed();
   return host->extension<HostEnergy>()->getCurrentWattsValue(cpu_load);
 }
-
-SG_END_DECL()
+}
index 99e7a39..f1e039a 100644 (file)
@@ -139,7 +139,7 @@ static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf:
 }
 
 /* **************************** Public interface *************************** */
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup plugin_load
  * \brief Initializes the HostLoad plugin
@@ -185,5 +185,4 @@ void sg_host_load_reset(sg_host_t host)
 
   host->extension<HostLoad>()->reset();
 }
-
-SG_END_DECL()
+}
index 3278c2f..f42b8c5 100644 (file)
@@ -12,7 +12,7 @@
 
 #define NO_MAX_DURATION -1.0
 
-SG_BEGIN_DECL()
+extern "C" {
 
 extern XBT_PRIVATE const char *surf_action_state_names[6];
 
@@ -51,7 +51,6 @@ XBT_PRIVATE void parse_after_config();
 /* from surf_instr.c */
 void TRACE_surf_host_set_speed(double date, const char *resource, double power);
 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth);
-
-SG_END_DECL()
+}
 
 #endif
index 89bfc16..625db04 100644 (file)
@@ -11,7 +11,7 @@
 #include "xbt/sysdep.h"
 #include <vector>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Iterator within a trace */
 typedef struct tmgr_trace_event {
@@ -35,8 +35,7 @@ XBT_PUBLIC(void) tmgr_finalize();
 
 XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_file(std::string filename);
 XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(std::string id, std::string input, double periodicity);
-
-SG_END_DECL()
+}
 
 namespace simgrid {
 /** @brief Modeling of the availability profile (due to an external load) or the churn
index 17c6f9e..bd5c32f 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <xbt/signal.hpp>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Module management functions */
 XBT_PUBLIC(void) sg_platf_init();;
@@ -29,7 +29,6 @@ XBT_PUBLIC(double) surf_parse_get_bandwidth(const char* string, const char* enti
 XBT_PUBLIC(double) surf_parse_get_speed(const char* string, const char* entity_kind, std::string name);
 
 XBT_PUBLIC(int) surf_parse(); /* Entry-point to the parser */
-
-SG_END_DECL()
+}
 
 #endif
index 9395880..a4f9047 100644 (file)
@@ -15,7 +15,7 @@
 #include <string>
 #include <vector>
 
-SG_BEGIN_DECL()
+extern "C" {
 #include "src/surf/xml/simgrid_dtd.h"
 
 #ifndef YY_TYPEDEF_YY_SIZE_T
@@ -237,8 +237,7 @@ XBT_PUBLIC(void) surf_parse_set_debug(int bdebug);
 XBT_PUBLIC(int) surf_parse_lex_destroy();
 
 XBT_PUBLIC(void) routing_route_free(sg_platf_route_cbarg_t route);
-
-SG_END_DECL()
+}
 
 namespace simgrid {
 namespace surf {
index 7b6e4c1..38e43ad 100644 (file)
@@ -33,7 +33,7 @@ XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_bw;
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_lat;
 
-SG_BEGIN_DECL()
+extern "C" {
 void sg_platf_trace_connect(TraceConnectCreationArgs* trace_connect)
 {
   xbt_assert(traces_set_list.find(trace_connect->trace) != traces_set_list.end(),
@@ -170,5 +170,4 @@ void parse_platform_file(const char *file)
       surf_parse_error(std::string("Parse error in ") + file);
   }
 }
-
-SG_END_DECL()
+}
index b7f147c..2b16c03 100644 (file)
@@ -17,7 +17,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF parsing module");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 int ETag_surfxml_include_state();
 
@@ -1124,5 +1124,4 @@ int surf_parse()
 {
   return surf_parse_lex();
 }
-
-SG_END_DECL()
+}