From cdd4d20278cbee5a9f11f9f455bff8836410568c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 17 Oct 2019 11:47:45 +0200 Subject: [PATCH] Convert to C++, and call get_pid() directly. --- MANIFEST.in | 2 +- src/xbt/{xbt_virtu.c => xbt_virtu.cpp} | 6 +++--- tools/cmake/DefinePackages.cmake | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/xbt/{xbt_virtu.c => xbt_virtu.cpp} (78%) diff --git a/MANIFEST.in b/MANIFEST.in index 13b9e4e711..85d7b34c28 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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_virtu.c +include src/xbt/xbt_virtu.cpp include src/xbt_modinter.h include teshsuite/java/CMakeLists.txt include teshsuite/lua/CMakeLists.txt diff --git a/src/xbt/xbt_virtu.c b/src/xbt/xbt_virtu.cpp similarity index 78% rename from src/xbt/xbt_virtu.c rename to src/xbt/xbt_virtu.cpp index 9032b7820c..557a2d3e03 100644 --- a/src/xbt/xbt_virtu.c +++ b/src/xbt/xbt_virtu.cpp @@ -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. */ -#include "simgrid/actor.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(); - return self == NULL ? 0 : sg_actor_self_get_pid(); + return self == nullptr ? 0 : self->get_pid(); } -const char *xbt_procname(void) +const char* xbt_procname(void) { return SIMIX_process_self_get_name(); } diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index e54e32d5e7..b987e4a9a0 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -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_virtu.c + src/xbt/xbt_virtu.cpp src/xbt_modinter.h ) -- 2.20.1