Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove unneeded extern "C".
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 16 Apr 2018 09:29:14 +0000 (11:29 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 16 Apr 2018 12:10:47 +0000 (14:10 +0200)
24 files changed:
include/simgrid/jedule/jedule.hpp
include/simgrid/jedule/jedule_events.hpp
include/simgrid/jedule/jedule_platform.hpp
include/simgrid/kernel/routing/RoutedZone.hpp
src/bindings/java/jxbt_utilities.hpp
src/bindings/lua/lua_private.hpp
src/bindings/lua/lua_utils.hpp
src/instr/instr_smpi.hpp
src/kernel/context/Context.hpp
src/mc/mc_comm_pattern.hpp
src/mc/mc_private.hpp
src/mc/mc_smx.hpp
src/mc/mc_snapshot.hpp
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/smpi/include/smpi_utils.hpp
src/surf/ns3/ns3_simulator.hpp
src/surf/surf_private.hpp
src/surf/xml/platf.hpp
src/surf/xml/platf_private.hpp

index dcc32d4..5381697 100644 (file)
@@ -32,9 +32,7 @@ public:
 }
 }
 
-extern "C" {
 typedef simgrid::jedule::Jedule *jedule_t;
-}
 #endif
 
 #endif /* JEDULE_HPP_ */
index 4362ffe..5ab0f8f 100644 (file)
@@ -40,10 +40,7 @@ private:
 }
 }
 
-extern "C" {
 typedef simgrid::jedule::Event* jed_event_t;
-}
-
 #endif
 
 #endif /* JEDULE_EVENTS_H_ */
index 9d02ade..e076f29 100644 (file)
@@ -51,11 +51,9 @@ public:
 
 }
 }
-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);
-}
 
 #endif
 
index 60bb1d5..443cd4e 100644 (file)
@@ -67,11 +67,9 @@ protected:
 } // namespace kernel
 } // namespace simgrid
 
-extern "C" {
 XBT_PRIVATE xbt_node_t new_xbt_graph_node(xbt_graph_t graph, const char* name,
                                           std::map<std::string, xbt_node_t>* nodes);
 XBT_PRIVATE xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d,
                                           std::map<std::string, xbt_edge_t>* edges);
-}
 
 #endif /* SIMGRID_ROUTING_GENERIC_HPP_ */
index 964d57a..3a9a64c 100644 (file)
@@ -12,8 +12,6 @@
 #include <jni.h>
 #include <string>
 
-extern "C" {
-
 /* Search a class and throw an exception if not found */
 jclass jxbt_get_class(JNIEnv* env, const char* name);
 
@@ -75,5 +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);
-}
+
 #endif
index 9b6110f..3243ec3 100644 (file)
 #include "simgrid/msg.h"
 #include "simgrid_lua.hpp"
 
-extern "C" {
-
 void sglua_register_host_functions(lua_State* L);
 msg_host_t sglua_check_host(lua_State* L, int index);
 
 void sglua_register_platf_functions(lua_State* L);
-}
 
 #define lua_ensure(...) _XBT_IF_ONE_ARG(_lua_ensure_ARG1, _lua_ensure_ARGN, __VA_ARGS__)(__VA_ARGS__)
 #define _lua_ensure_ARG1(cond) _lua_ensure_ARGN(cond, "Assertion %s failed", #cond)
index 11e0a89..5b23cfb 100644 (file)
@@ -8,8 +8,6 @@
 #ifndef LUA_UTILS_HPP
 #define LUA_UTILS_HPP
 
-extern "C" {
-
 #include <lua.h>
 
 /**
@@ -31,6 +29,5 @@ static int sglua_dump_table(lua_State* L);
 void* sglua_checkudata_debug(lua_State* L, int ud, const char* tname);
 const char* sglua_get_spaces(int length);
 int sglua_memory_writer(lua_State* L, const void* source, size_t size, void* userdata);
-}
 
 #endif
index 6100097..9e3c1c4 100644 (file)
@@ -12,8 +12,6 @@
 
 XBT_PRIVATE container_t smpi_container(int rank);
 
-extern "C" {
-
 XBT_PRIVATE void TRACE_internal_smpi_set_category(const char* category);
 XBT_PRIVATE const char* TRACE_internal_smpi_get_category();
 XBT_PRIVATE void TRACE_smpi_computing_init(int rank);
@@ -46,6 +44,5 @@ public:
            std::to_string(linenumber);
   }
 };
-}
 
 #endif
index 443aa52..9b788b2 100644 (file)
@@ -108,8 +108,6 @@ XBT_PRIVATE ContextFactory* boost_factory();
 
 typedef simgrid::kernel::context::ContextFactory *smx_context_factory_t;
 
-extern "C" {
-
 XBT_PRIVATE void SIMIX_context_mod_init();
 XBT_PRIVATE void SIMIX_context_mod_exit();
 
@@ -144,7 +142,6 @@ XBT_PRIVATE smx_context_t SIMIX_context_get_current();
 XBT_PUBLIC int SIMIX_process_get_maxpid();
 
 XBT_PRIVATE void SIMIX_post_create_environment();
-}
 
 XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const char *name);
 
index 5512139..7a9b45f 100644 (file)
@@ -23,8 +23,6 @@ struct PatternCommunicationList {
 }
 }
 
-extern "C" {
-
 /**
  *  Type: `xbt_dynar_t<mc_list_comm_pattern_t>`
  */
@@ -77,6 +75,5 @@ 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);
-}
 
 #endif
index 7ddc1d6..b8d4f1b 100644 (file)
@@ -24,8 +24,6 @@ struct DerefAndCompareByActorsCountAndUsedHeap {
 }
 }
 
-extern "C" {
-
 /********************************* MC Global **********************************/
 
 XBT_PRIVATE void MC_init_dot_output();
@@ -40,8 +38,6 @@ XBT_PRIVATE void MC_show_deadlock(void);
 #define MC_VERBOSE 1
 
 /********************************** Miscellaneous **********************************/
-}
-
 namespace simgrid {
 namespace mc {
 
index 19e76fc..a2ac591 100644 (file)
@@ -28,8 +28,6 @@
  * MCed code.
  */
 
-extern "C" {
-
 /** Get the issuer of  a simcall (`req->issuer`)
  *
  *  In split-process mode, it does the black magic necessary to get an address
@@ -47,6 +45,5 @@ 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);
-}
 
 #endif
index d8d3b0c..62a18fe 100644 (file)
@@ -16,8 +16,6 @@
 #include "src/mc/mc_forward.hpp"
 #include "src/mc/mc_unw.hpp"
 
-extern "C" {
-
 // ***** Snapshot region
 
 XBT_PRIVATE void mc_region_restore_sparse(simgrid::mc::RemoteClient* process, mc_mem_region_t reg);
@@ -53,7 +51,6 @@ static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, mc_me
 
 XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(const void* addr, const simgrid::mc::Snapshot* snapshot,
                                                    int process_index);
-}
 
 // ***** MC Snapshot
 
@@ -131,8 +128,6 @@ public:
 }
 }
 
-extern "C" {
-
 static XBT_ALWAYS_INLINE mc_mem_region_t mc_get_region_hinted(void* addr, simgrid::mc::Snapshot* snapshot,
                                                               int process_index, mc_mem_region_t region)
 {
@@ -143,7 +138,6 @@ static XBT_ALWAYS_INLINE mc_mem_region_t mc_get_region_hinted(void* addr, simgri
 }
 
 static const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot);
-}
 
 namespace simgrid {
 namespace mc {
@@ -153,8 +147,6 @@ XBT_PRIVATE void restore_snapshot(std::shared_ptr<simgrid::mc::Snapshot> snapsho
 }
 }
 
-extern "C" {
-
 XBT_PRIVATE void mc_restore_page_snapshot_region(simgrid::mc::RemoteClient* process, void* start_addr,
                                                  simgrid::mc::ChunkedData const& pagenos);
 
@@ -214,6 +206,5 @@ 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*));
 }
-}
 
 #endif
index b18dc47..fc9403f 100644 (file)
@@ -35,7 +35,6 @@ std::set<SD_task_t>* simulate (double how_long);
 }
 }
 
-extern "C" {
 extern XBT_PRIVATE simgrid::sd::Global *sd_global;
 
 /* Task */
@@ -72,5 +71,4 @@ 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);
-}
 #endif
index f0fc0bc..16dca7c 100644 (file)
@@ -135,8 +135,6 @@ XBT_PUBLIC void create_maestro(std::function<void()> code);
 
 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
 
-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,
                                              smx_actor_t parent_process);
@@ -152,7 +150,6 @@ XBT_PRIVATE void SIMIX_process_change_host(smx_actor_t process, sg_host_t dest);
 XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart);
 
 extern void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr actor);
-}
 
 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 b83beb9..8561f7d 100644 (file)
@@ -15,8 +15,6 @@
 
 #include <boost/intrusive_ptr.hpp>
 
-extern "C" {
-
 /********************************* Simcalls *********************************/
 XBT_PUBLIC_DATA const char* simcall_names[]; /* Name of each simcall */
 
@@ -67,7 +65,6 @@ 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);
-}
 
 /* Defines the marshal/unmarshal functions for each type of parameters.
  *
index 9f1acbc..17a0a39 100644 (file)
@@ -38,7 +38,6 @@ public:
 }
 }
 
-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);
@@ -48,7 +47,6 @@ XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
 XBT_PRIVATE void SIMIX_execution_finish(smx_activity_t synchro);
 
 XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char* category);
-}
 
 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
 SIMIX_execution_start(const char* name, double flops_amount, double priority, double bound, sg_host_t host);
index 3609c1f..d8c2e13 100644 (file)
@@ -63,8 +63,6 @@ public:
 }
 }
 
-extern "C" {
-
 XBT_PUBLIC_DATA std::unique_ptr<simgrid::simix::Global> simix_global;
 
 XBT_PUBLIC void SIMIX_clean();
@@ -80,6 +78,5 @@ XBT_PUBLIC void SIMIX_clean();
     _smx_throw_issuer->exception = std::make_exception_ptr(e);                                                         \
   } else                                                                                                               \
     ((void)0)
-}
 
 #endif
index 5115f85..42ad749 100644 (file)
@@ -17,8 +17,6 @@
 #include <time.h>
 #endif
 
-extern "C" {
-
 #define PERSISTENT 0x1
 #define NON_PERSISTENT 0x2
 #define SEND 0x4
@@ -110,7 +108,9 @@ XBT_PRIVATE void* smpi_get_tmp_recvbuffer(int size);
 XBT_PRIVATE void smpi_free_tmp_buffer(void* buf);
 XBT_PRIVATE void smpi_free_replay_tmp_buffers();
 
+extern "C" {
 // f77 wrappers
+
 void mpi_init_(int* ierr);
 void mpi_finalize_(int* ierr);
 void mpi_abort_(int* comm, int* errorcode, int* ierr);
@@ -422,6 +422,8 @@ struct option;
 XBT_PUBLIC int smpi_getopt_long (int argc,  char *const *argv,  const char *options,  const struct option *long_options, int *opt_index);
 XBT_PUBLIC int smpi_getopt (int argc,  char *const *argv,  const char *options);
 
+} // extern "C"
+
 struct s_smpi_privatization_region_t {
   void* address;
   int file_descriptor;
@@ -431,7 +433,6 @@ typedef s_smpi_privatization_region_t* smpi_privatization_region_t;
 extern XBT_PRIVATE int smpi_loaded_page;
 extern XBT_PRIVATE int smpi_universe_size;
 XBT_PRIVATE smpi_privatization_region_t smpi_init_global_memory_segment_process();
-}
 
 /**
  * Get the address of the beginning of the memory page where addr is located.
@@ -448,9 +449,7 @@ typedef std::vector<std::pair</* counter name */ std::string, /* counter value *
 extern std::unordered_map<std::string, double> location2speedup;
 
 /** @brief Returns the last call location (filename, linenumber). Process-specific. */
-extern "C" {
 XBT_PUBLIC smpi_trace_call_location_t* smpi_trace_get_call_location();
-}
 
 enum class SmpiPrivStrategies { None = 0, Mmap = 1, Dlopen = 2, Default = Dlopen };
 
index dca417d..b2c4e51 100644 (file)
 #include <string>
 #include <vector>
 
-extern "C" {
-
 // Methods used to parse and store the values for timing injections in smpi
 struct s_smpi_factor_t {
   size_t factor = 0;
   std::vector<double> values;
 };
-}
 
 XBT_PUBLIC std::vector<s_smpi_factor_t> parse_factor(std::string smpi_coef_string);
 
index db1236a..93ea87c 100644 (file)
@@ -24,11 +24,9 @@ public:
 };
 
 XBT_PUBLIC void ns3_initialize(std::string TcpProtocol);
-extern "C" {
 XBT_PUBLIC void ns3_simulator(double maxSeconds);
 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);
-}
 
 class XBT_PRIVATE SgFlow {
 public:
index e45589f..7fb470d 100644 (file)
@@ -9,8 +9,6 @@
 #include "simgrid/forward.h"
 #include "xbt/sysdep.h"
 
-extern "C" {
-
 /* Generic functions common to all models */
 
 XBT_PRIVATE FILE* surf_fopen(const char* name, const char* mode);
@@ -30,6 +28,5 @@ 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);
-}
 
 #endif
index c30139c..1e095b6 100644 (file)
@@ -8,8 +8,6 @@
 
 #include <xbt/signal.hpp>
 
-extern "C" {
-
 /* Module management functions */
 XBT_PUBLIC void sg_platf_init();
 XBT_PUBLIC void sg_platf_exit();
@@ -28,6 +26,5 @@ XBT_PUBLIC double surf_parse_get_bandwidth(const char* string, const char* entit
 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 */
-}
 
 #endif
index 0871cd4..b1c9fab 100644 (file)
@@ -181,8 +181,6 @@ public:
 };
 }}}
 
-extern "C" {
-
 /********** Routing **********/
 void routing_cluster_add_backbone(simgrid::kernel::resource::LinkImpl* bb);
 /*** END of the parsing cruft ***/
@@ -227,7 +225,6 @@ XBT_PUBLIC void surf_parse_set_out(FILE* out_str);
 XBT_PUBLIC int surf_parse_get_debug();
 XBT_PUBLIC void surf_parse_set_debug(int bdebug);
 XBT_PUBLIC int surf_parse_lex_destroy();
-}
 
 namespace simgrid {
 namespace surf {