Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Convert to C++, and call get_pid() directly.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 17 Oct 2019 09:47:45 +0000 (11:47 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 17 Oct 2019 10:02:34 +0000 (12:02 +0200)
MANIFEST.in
src/xbt/xbt_virtu.cpp [moved from src/xbt/xbt_virtu.c with 78% similarity]
tools/cmake/DefinePackages.cmake

index 13b9e4e..85d7b34 100644 (file)
@@ -2604,7 +2604,7 @@ include src/xbt/xbt_os_time.c
 include src/xbt/xbt_replay.cpp
 include src/xbt/xbt_str.cpp
 include src/xbt/xbt_str_test.cpp
 include src/xbt/xbt_replay.cpp
 include src/xbt/xbt_str.cpp
 include src/xbt/xbt_str_test.cpp
-include src/xbt/xbt_virtu.c
+include src/xbt/xbt_virtu.cpp
 include src/xbt_modinter.h
 include teshsuite/java/CMakeLists.txt
 include teshsuite/lua/CMakeLists.txt
 include src/xbt_modinter.h
 include teshsuite/java/CMakeLists.txt
 include teshsuite/lua/CMakeLists.txt
similarity index 78%
rename from src/xbt/xbt_virtu.c
rename to src/xbt/xbt_virtu.cpp
index 9032b78..557a2d3 100644 (file)
@@ -5,17 +5,17 @@
 /* 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. */
 
 /* 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. */
 
-#include "simgrid/actor.h"
 #include "simgrid/simix.h"
 #include "simgrid/simix.h"
+#include "src/kernel/actor/ActorImpl.hpp"
 #include "xbt/virtu.h"
 
 int xbt_getpid()
 {
   smx_actor_t self = SIMIX_process_self();
 #include "xbt/virtu.h"
 
 int xbt_getpid()
 {
   smx_actor_t self = SIMIX_process_self();
-  return self == NULL ? 0 : sg_actor_self_get_pid();
+  return self == nullptr ? 0 : self->get_pid();
 }
 
 }
 
-const char *xbt_procname(void)
+const charxbt_procname(void)
 {
   return SIMIX_process_self_get_name();
 }
 {
   return SIMIX_process_self_get_name();
 }
index e54e32d..b987e4a 100644 (file)
@@ -294,7 +294,7 @@ set(XBT_SRC
   src/xbt/xbt_os_time.c
   src/xbt/xbt_replay.cpp
   src/xbt/xbt_str.cpp
   src/xbt/xbt_os_time.c
   src/xbt/xbt_replay.cpp
   src/xbt/xbt_str.cpp
-  src/xbt/xbt_virtu.c
+  src/xbt/xbt_virtu.cpp
   src/xbt_modinter.h
   )
 
   src/xbt_modinter.h
   )