Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill the now useless type xbt::string
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 4 Nov 2022 22:37:27 +0000 (23:37 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 4 Nov 2022 23:16:57 +0000 (00:16 +0100)
18 files changed:
docs/source/conf.py
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Host.hpp
include/simgrid/s4u/Mailbox.hpp
include/xbt/string.hpp
src/bindings/python/simgrid_python.cpp
src/kernel/activity/MailboxImpl.hpp
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/ActorImpl.hpp
src/kernel/actor/CommObserver.cpp
src/kernel/resource/WifiLinkImpl.hpp
src/mc/ModelChecker.hpp
src/mc/remote/RemoteProcess.hpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Mailbox.cpp
src/surf/HostImpl.hpp
src/xbt/string.cpp

index cda228d..b84834c 100644 (file)
@@ -129,7 +129,6 @@ nitpick_ignore = [
   ('cpp:identifier', 'simgrid::s4u::Activity_T<Io>'),
   ('cpp:identifier', 'simgrid::s4u::this_actor'),
   ('cpp:identifier', 'simgrid::xbt'),
-  ('cpp:identifier', 'simgrid::xbt::string'),
   ('cpp:identifier', 'size_t'),
   ('cpp:identifier', 'ssize_t'),
   ('cpp:identifier', 'this_actor'),
@@ -161,7 +160,6 @@ nitpick_ignore = [
   ('cpp:identifier', 'xbt::signal<void(kernel::resource::NetworkAction&)>'),
   ('cpp:identifier', 'xbt::signal<void(kernel::resource::NetworkAction&, kernel::resource::Action::State)>'),
   ('cpp:identifier', 'xbt::signal<void(void)>'),
-  ('cpp:identifier', 'xbt::string'),
 ]
 
 # For cross-ref generation
index b75614c..199ac80 100644 (file)
@@ -322,7 +322,7 @@ public:
   static bool is_maestro();
 
   /** Retrieves the name of that actor as a C++ string */
-  const simgrid::xbt::string& get_name() const;
+  const std::string& get_name() const;
   /** Retrieves the name of that actor as a C string */
   const char* get_cname() const;
   /** Retrieves the host on which that actor is running */
index 8fbe494..bae7f73 100644 (file)
@@ -87,7 +87,7 @@ public:
   static Host* current();
 
   /** Retrieves the name of that host as a C++ string */
-  xbt::string const& get_name() const;
+  std::string const& get_name() const;
   /** Retrieves the name of that host as a C string */
   const char* get_cname() const;
 
index 96dab88..a885cba 100644 (file)
@@ -10,7 +10,6 @@
 #include <simgrid/s4u/Actor.hpp>
 #include <simgrid/s4u/Comm.hpp>
 #include <smpi/forward.hpp>
-#include <xbt/string.hpp>
 
 #include <memory>
 #include <string>
@@ -36,7 +35,7 @@ protected:
 
 public:
   /** @brief Retrieves the name of that mailbox as a C++ string */
-  const xbt::string& get_name() const;
+  const std::string& get_name() const;
   /** @brief Retrieves the name of that mailbox as a C string */
   const char* get_cname() const;
 
index a462448..c382100 100644 (file)
@@ -6,24 +6,12 @@
 #ifndef SIMGRID_XBT_STRING_HPP
 #define SIMGRID_XBT_STRING_HPP
 
-#include <simgrid/config.h>
+#include "xbt/base.h"
 
 #include <cstdarg>
 #include <cstdlib>
 #include <string>
 
-#if SIMGRID_HAVE_MC
-
-#include <algorithm>
-#include <cstddef>
-#include <cstring>
-#include <iterator>
-#include <stdexcept>
-
-#include <xbt/sysdep.h>
-
-#endif
-
 namespace simgrid {
 namespace xbt {
 
@@ -39,281 +27,6 @@ XBT_PUBLIC std::string string_printf(const char* fmt, ...) XBT_ATTRIB_PRINTF(1,
  */
 XBT_PUBLIC std::string string_vprintf(const char* fmt, va_list ap) XBT_ATTRIB_PRINTF(1, 0);
 
-#if SIMGRID_HAVE_MC
-
-/** POD structure representation of a string
- */
-struct string_data {
-  char* data;
-  std::size_t len;
-};
-
-/** A std::string-like with well-known representation
- *
- *  HACK, this is a (incomplete) replacement for `std::string`.
- *  It has a fixed POD representation (`simgrid::xbt::string_data`)
- *  which can be used to easily read the string content from another
- *  process.
- *
- *  The internal representation of a `std::string` is private.
- *  We could add some code to read this for a given implementation.
- *  However, even if we focus on GNU libstdc++ with Itanium ABI
- *  GNU libstdc++ currently has two different ABIs
- *
- *  * the pre-C++11 is a pointer to a ref-counted
- *    string-representation (with support for COW);
- *
- *  * the [C++11-conforming implementation](https://gcc.gnu.org/gcc-5/changes.html)
- *    does not use refcouting/COW but has a small string optimization.
- */
-class XBT_PUBLIC string {
-  static char NUL;
-  string_data str;
-
-public:
-  // Types
-  using size_type       = std::size_t;
-  using reference       = char&;
-  using const_reference = const char&;
-  using iterator        = char*;
-  using const_iterator  = const char*;
-
-  // Dtor
-  ~string()
-  {
-    if (str.data != &NUL)
-      delete[] str.data;
-  }
-
-  // Ctors
-  string(const char* s, size_t size)
-  {
-    if (size == 0) {
-      str.len  = 0;
-      str.data = &NUL;
-    } else {
-      str.len  = size;
-      str.data = new char[str.len + 1];
-      std::copy_n(s, str.len, str.data);
-      str.data[str.len] = '\0';
-    }
-  }
-  string() : string(&NUL, 0) {}
-  explicit string(const char* s) : string(s, strlen(s)) {}
-  string(string const& s) : string(s.c_str(), s.size()) {}
-  string(string&& s) noexcept : str(s.str)
-  {
-    s.str.len  = 0;
-    s.str.data = &NUL;
-  }
-  explicit string(std::string const& s) : string(s.c_str(), s.size()) {}
-
-  // Assign
-  void assign(const char* s, size_t size)
-  {
-    if (str.data != &NUL) {
-      delete[] str.data;
-      str.data = nullptr;
-      str.len  = 0;
-    }
-    if (size != 0) {
-      str.len  = size;
-      str.data = new char[str.len + 1];
-      std::copy_n(s, str.len, str.data);
-      str.data[str.len] = '\0';
-    }
-  }
-
-  // Copy
-  string& operator=(const char* s)
-  {
-    assign(s, std::strlen(s));
-    return *this;
-  }
-  string& operator=(string const& s)
-  {
-    if (this != &s)
-      assign(s.c_str(), s.size());
-    return *this;
-  }
-  string& operator=(std::string const& s)
-  {
-    assign(s.c_str(), s.size());
-    return *this;
-  }
-
-  // Capacity
-  size_t size() const { return str.len; }
-  size_t length() const { return str.len; }
-  bool empty() const { return str.len == 0; }
-  void shrink_to_fit() { /* Being there, but doing nothing */}
-
-  // Element access
-  char* data() { return str.data; }
-  const char* data() const { return str.data; }
-  char* c_str() { return str.data; }
-  const char* c_str() const { return str.data; };
-  reference at(size_type i)
-  {
-    if (i >= size())
-      throw std::out_of_range("Out of range");
-    return data()[i];
-  }
-  const_reference at(size_type i) const
-  {
-    if (i >= size())
-      throw std::out_of_range("Out of range");
-    return data()[i];
-  }
-  reference operator[](size_type i)
-  {
-    return data()[i];
-  }
-  const_reference operator[](size_type i) const
-  {
-    return data()[i];
-  }
-  // Conversion
-  static const string_data& to_string_data(const string& s) { return s.str; }
-  operator std::string() const { return std::string(this->c_str(), this->size()); }
-
-  // Iterators
-  iterator begin()               { return data(); }
-  iterator end()                 { return data() + size(); }
-  const_iterator begin() const   { return data(); }
-  const_iterator end() const     { return data() + size(); }
-  const_iterator cbegin() const  { return data(); }
-  const_iterator cend() const    { return data() + size(); }
-  // (Missing, reverse iterators)
-
-  // Operations
-  void clear()
-  {
-    str.len  = 0;
-    str.data = &NUL;
-  }
-
-  size_t copy(char* s, size_t len, size_t pos = 0) const
-  {
-    if (pos > str.len)
-      throw std::out_of_range(string_printf("xbt::string::copy with pos > size() (%zu > %zu)", pos, str.len));
-    size_t count = std::min(len, str.len - pos);
-    std::copy_n(str.data + pos, count, s);
-    return count;
-  }
-
-  bool equals(const char* data, std::size_t len) const
-  {
-    return this->size() == len
-      && std::memcmp(this->c_str(), data, len) == 0;
-  }
-
-  bool operator==(string const& that) const
-  {
-    return this->equals(that.c_str(), that.size());
-  }
-  bool operator==(std::string const& that) const
-  {
-    return this->equals(that.c_str(), that.size());
-  }
-  bool operator==(const char* that) const
-  {
-    return this->equals(that, std::strlen(that));
-  }
-
-  template<class X>
-  bool operator!=(X const& that) const
-  {
-    return not (*this == that);
-  }
-
-  // Compare:
-  int compare(const char* data, std::size_t len) const
-  {
-    size_t n = std::min(this->size(), len);
-    int res = memcmp(this->c_str(), data, n);
-    if (res != 0)
-      return res;
-    else if (this->size() == len)
-      return 0;
-    else if (this->size() < len)
-      return -1;
-    else
-      return 1;
-  }
-  int compare(string const& that) const
-  {
-    return this->compare(that.c_str(), that.size());
-  }
-  int compare(std::string const& that) const
-  {
-    return this->compare(that.c_str(), that.size());
-  }
-  int compare(const char* that) const
-  {
-    return this->compare(that, std::strlen(that));
-  }
-
-  // Define < <= >= > in term of compare():
-  template<class X>
-  bool operator<(X const& that) const
-  {
-    return this->compare(that) < 0;
-  }
-  template<class X>
-  bool operator<=(X const& that) const
-  {
-    return this->compare(that) <= 0;
-  }
-  template<class X>
-  bool operator>(X const& that) const
-  {
-    return this->compare(that) > 0;
-  }
-  template<class X>
-  bool operator>=(X const& that) const
-  {
-    return this->compare(that) >= 0;
-  }
-};
-
-inline
-bool operator==(std::string const& a, string const& b)
-{
-  return b == a;
-}
-inline
-bool operator!=(std::string const& a, string const& b)
-{
-  return b != a;
-}
-inline
-bool operator<(std::string const& a, string const& b)
-{
-  return b > a;
+} // namespace xbt
 }
-inline
-bool operator<=(std::string const& a, string const& b)
-{
-  return b >= a;
-}
-inline
-bool operator>(std::string const& a, string const& b)
-{
-  return b < a;
-}
-inline
-bool operator>=(std::string const& a, string const& b)
-{
-  return b <= a;
-}
-
-#else
-
-typedef std::string string;
-
-#endif
-}
-}
-
-#endif
+#endif
\ No newline at end of file
index e1c42ed..99e5253 100644 (file)
@@ -454,13 +454,9 @@ PYBIND11_MODULE(simgrid, m)
           },
           "The current pstate (read/write property).")
       .def_static("current", &Host::current, py::call_guard<py::gil_scoped_release>(),
-           "Retrieves the host on which the running actor is located.")
+                  "Retrieves the host on which the running actor is located.")
       .def_property_readonly(
-          "name",
-          [](const Host* self) {
-            return std::string(self->get_name().c_str()); // Convert from xbt::string because of MC
-          },
-          "The name of this host (read-only property).")
+          "name", [](const Host* self) { return self->get_name(); }, "The name of this host (read-only property).")
       .def_property_readonly("load", &Host::get_load,
                              "Returns the current computation load (in flops per second), NOT taking the external load "
                              "into account. This is the currently achieved speed (read-only property).")
@@ -603,11 +599,7 @@ PYBIND11_MODULE(simgrid, m)
       .def_static("by_name", &Link::by_name, "Retrieves a Link from its name, or dies")
       .def("seal", &Link::seal, py::call_guard<py::gil_scoped_release>(), "Seal this link")
       .def_property_readonly(
-          "name",
-          [](const Link* self) {
-            return std::string(self->get_name().c_str()); // Convert from xbt::string because of MC
-          },
-          "The name of this link")
+          "name", [](const Link* self) { return self->get_name(); }, "The name of this link")
       .def_property_readonly("bandwidth", &Link::get_bandwidth,
                              "The bandwidth (in bytes per second) (read-only property).")
       .def_property_readonly("latency", &Link::get_latency, "The latency (in seconds) (read-only property).");
@@ -656,15 +648,10 @@ PYBIND11_MODULE(simgrid, m)
       .def(
           "__str__", [](const Mailbox* self) { return std::string("Mailbox(") + self->get_cname() + ")"; },
           "Textual representation of the Mailbox`")
-      .def_static("by_name", &Mailbox::by_name,
-                  py::call_guard<py::gil_scoped_release>(),
-                  py::arg("name"),
+      .def_static("by_name", &Mailbox::by_name, py::call_guard<py::gil_scoped_release>(), py::arg("name"),
                   "Retrieve a Mailbox from its name")
       .def_property_readonly(
-          "name",
-          [](const Mailbox* self) {
-            return std::string(self->get_name().c_str()); // Convert from xbt::string because of MC
-          },
+          "name", [](const Mailbox* self) { return self->get_name(); },
           "The name of that mailbox (read-only property).")
       .def_property_readonly("ready", &Mailbox::ready, py::call_guard<py::gil_scoped_release>(),
                              "Check if there is a communication ready to be consumed from a mailbox.")
@@ -695,8 +682,7 @@ PYBIND11_MODULE(simgrid, m)
             data.inc_ref();
             return self->put_init(data.ptr(), size);
           },
-          py::call_guard<py::gil_scoped_release>(),
-          "Creates (but don’t start) a data transmission to that mailbox.")
+          py::call_guard<py::gil_scoped_release>(), "Creates (but don’t start) a data transmission to that mailbox.")
       .def(
           "get",
           [](Mailbox* self) {
index 353b963..69d65b3 100644 (file)
@@ -7,7 +7,6 @@
 #define SIMGRID_KERNEL_ACTIVITY_MAILBOX_HPP
 
 #include <boost/circular_buffer.hpp>
-#include <xbt/string.hpp>
 
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
@@ -22,7 +21,7 @@ class MailboxImpl {
   static constexpr size_t MAX_MAILBOX_SIZE = 10000000;
 
   s4u::Mailbox piface_;
-  xbt::string name_;
+  std::string name_;
   actor::ActorImplPtr permanent_receiver_; // actor to which the mailbox is attached
   boost::circular_buffer_space_optimized<CommImplPtr> comm_queue_{MAX_MAILBOX_SIZE};
   // messages already received in the permanent receive mode
@@ -48,7 +47,7 @@ public:
   const s4u::Mailbox* get_iface() const { return &piface_; }
   s4u::Mailbox* get_iface() { return &piface_; }
 
-  const xbt::string& get_name() const { return name_; }
+  const std::string& get_name() const { return name_; }
   const char* get_cname() const { return name_.c_str(); }
   void set_receiver(s4u::ActorPtr actor);
   void push(CommImplPtr comm);
index e308692..c863647 100644 (file)
@@ -34,7 +34,7 @@ ActorImpl* ActorImpl::self()
   return (self_context != nullptr) ? self_context->get_actor() : nullptr;
 }
 
-ActorImpl::ActorImpl(xbt::string name, s4u::Host* host, aid_t ppid)
+ActorImpl::ActorImpl(std::string name, s4u::Host* host, aid_t ppid)
     : ActorIDTrait(std::move(name), ppid), host_(host), piface_(this)
 {
   simcall_.issuer_ = this;
@@ -66,7 +66,7 @@ ActorImplPtr ActorImpl::attach(const std::string& name, void* data, s4u::Host* h
     throw HostFailureException(XBT_THROW_POINT, "Cannot attach actor on failed host.");
   }
 
-  auto* actor = new ActorImpl(xbt::string(name), host, /*ppid*/ -1);
+  auto* actor = new ActorImpl(std::string(name), host, /*ppid*/ -1);
   /* Actor data */
   actor->piface_.set_data(data);
   actor->code_ = nullptr;
@@ -418,7 +418,7 @@ void ActorImpl::set_host(s4u::Host* dest)
 
 ActorImplPtr ActorImpl::init(const std::string& name, s4u::Host* host) const
 {
-  auto* actor = new ActorImpl(xbt::string(name), host, get_pid());
+  auto* actor = new ActorImpl(name, host, get_pid());
 
   intrusive_ptr_add_ref(actor);
   /* The on_creation() signal must be delayed until there, where the pid and everything is set */
@@ -461,9 +461,9 @@ ActorImplPtr ActorImpl::create(const std::string& name, const ActorCode& code, v
 
   ActorImplPtr actor;
   if (parent_actor != nullptr)
-    actor = parent_actor->init(xbt::string(name), host);
+    actor = parent_actor->init(name, host);
   else
-    actor = self()->init(xbt::string(name), host);
+    actor = self()->init(name, host);
 
   actor->piface_.set_data(data); /* actor data */
 
@@ -496,7 +496,7 @@ void create_maestro(const std::function<void()>& code)
 {
   auto* engine = EngineImpl::get_instance();
   /* Create maestro actor and initialize it */
-  auto* maestro = new ActorImpl(xbt::string(""), /*host*/ nullptr, /*ppid*/ -1);
+  auto* maestro = new ActorImpl(/*name*/ "", /*host*/ nullptr, /*ppid*/ -1);
 
   if (not code) {
     maestro->context_.reset(engine->get_context_factory()->create_context(ActorCode(), maestro));
index 8f6f640..34b61de 100644 (file)
@@ -21,15 +21,15 @@ class ProcessArg;
 
 /*------------------------- [ ActorIDTrait ] -------------------------*/
 class XBT_PUBLIC ActorIDTrait {
-  xbt::string name_;
-  aid_t pid_         = 0;
-  aid_t ppid_        = -1;
+  std::string name_;
+  aid_t pid_  = 0;
+  aid_t ppid_ = -1;
 
   static unsigned long maxpid_;
 
 public:
   explicit ActorIDTrait(const std::string& name, aid_t ppid);
-  const xbt::string& get_name() const { return name_; }
+  const std::string& get_name() const { return name_; }
   const char* get_cname() const { return name_.c_str(); }
   aid_t get_pid() const { return pid_; }
   aid_t get_ppid() const { return ppid_; }
@@ -64,7 +64,7 @@ class XBT_PUBLIC ActorImpl : public xbt::PropertyHolder, public ActorIDTrait, pu
   friend activity::MailboxImpl;
 
 public:
-  ActorImpl(xbt::string name, s4u::Host* host, aid_t ppid);
+  ActorImpl(std::string name, s4u::Host* host, aid_t ppid);
   ActorImpl(const ActorImpl&) = delete;
   ActorImpl& operator=(const ActorImpl&) = delete;
   ~ActorImpl();
index 73eb450..9c55619 100644 (file)
@@ -119,7 +119,7 @@ static std::string to_string_activity_wait(const activity::ActivityImpl* act)
     return std::string("CommWait(comm_id:") + ptr_to_id<activity::CommImpl const>(comm) +
            " src:" + std::to_string(comm->src_actor_ != nullptr ? comm->src_actor_->get_pid() : -1) +
            " dst:" + std::to_string(comm->dst_actor_ != nullptr ? comm->dst_actor_->get_pid() : -1) +
-           " mbox:" + std::string(comm->get_mailbox() == nullptr ? xbt::string("-") : comm->get_mailbox()->get_name()) +
+           " mbox:" + std::string(comm->get_mailbox() == nullptr ? std::string("-") : comm->get_mailbox()->get_name()) +
            "(id:" + std::to_string(comm->get_mailbox_id()) + ") srcbuf:" + src_buff_id + " dstbuf:" + dst_buff_id +
            " bufsize:" + std::to_string(comm->src_buff_size_) + ")";
   } else {
index a875566..811734d 100644 (file)
@@ -21,7 +21,7 @@ class XBT_PRIVATE WifiLinkAction;
 
 class WifiLinkImpl : public StandardLinkImpl {
   /** @brief Hold every rates association between host and links (host name, rates id) */
-  std::map<xbt::string, int> host_rates_;
+  std::map<std::string, int> host_rates_;
 
   /** @brief A link can have several bandwidths attached to it (mostly use by wifi model) */
   std::vector<Metric> bandwidths_;
index 09fbfcb..787bd04 100644 (file)
@@ -10,7 +10,6 @@
 #include "src/mc/remote/RemotePtr.hpp"
 #include "src/mc/sosp/PageStore.hpp"
 #include "xbt/base.h"
-#include "xbt/string.hpp"
 
 #include <memory>
 #include <set>
@@ -22,7 +21,7 @@ namespace simgrid::mc {
 class ModelChecker {
   CheckerSide checker_side_;
   /** String pool for host names */
-  std::set<xbt::string, std::less<>> hostnames_;
+  std::set<std::string, std::less<>> hostnames_;
   // This is the parent snapshot of the current state:
   PageStore page_store_{500};
   std::unique_ptr<RemoteProcess> remote_process_;
@@ -41,9 +40,9 @@ public:
   Channel& channel() { return checker_side_.get_channel(); }
   PageStore& page_store() { return page_store_; }
 
-  xbt::string const& get_host_name(const char* hostname)
+  std::string const& get_host_name(const char* hostname)
   {
-    return *this->hostnames_.insert(xbt::string(hostname)).first;
+    return *this->hostnames_.insert(std::string(hostname)).first;
   }
 
   void start();
index 4dc3dfd..3fd75d8 100644 (file)
@@ -27,8 +27,8 @@ public:
   Remote<kernel::actor::ActorImpl> copy;
 
   /** Hostname (owned by `mc_model_checker->hostnames_`) */
-  const xbt::string* hostname = nullptr;
-  xbt::string name;
+  const std::string* hostname = nullptr;
+  std::string name;
 
   void clear()
   {
index e4ec4be..340126b 100644 (file)
@@ -188,7 +188,7 @@ bool Actor::is_maestro()
   return self == nullptr || kernel::EngineImpl::get_instance()->is_maestro(self);
 }
 
-const simgrid::xbt::string& Actor::get_name() const
+const std::string& Actor::get_name() const
 {
   return this->pimpl_->get_name();
 }
index 35357f8..4266d80 100644 (file)
@@ -84,7 +84,7 @@ Host* Host::current()
   return self->get_host();
 }
 
-xbt::string const& Host::get_name() const
+std::string const& Host::get_name() const
 {
   return this->pimpl_->get_name();
 }
index 4621305..2caa4ec 100644 (file)
@@ -14,7 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_channel, s4u, "S4U Communication Mailboxes")
 
 namespace simgrid::s4u {
 
-const xbt::string& Mailbox::get_name() const
+const std::string& Mailbox::get_name() const
 {
   return pimpl_->get_name();
 }
index e2533b2..13c0772 100644 (file)
@@ -50,7 +50,7 @@ class XBT_PRIVATE HostImpl : public xbt::PropertyHolder {
   s4u::Host piface_;
   std::map<std::string, DiskImpl*, std::less<>> disks_;
   std::map<std::string, VirtualMachineImpl*, std::less<>> vms_;
-  xbt::string name_{"noname"};
+  std::string name_{"noname"};
   routing::NetZoneImpl* englobing_zone_ = nullptr;
   bool sealed_ = false;
 
@@ -79,7 +79,7 @@ public:
   virtual s4u::Host* get_iface() { return &piface_; }
 
   /** Retrieves the name of that host as a C++ string */
-  xbt::string const& get_name() const { return name_; }
+  std::string const& get_name() const { return name_; }
   /** Retrieves the name of that host as a C string */
   const char* get_cname() const { return name_.c_str(); }
 
index 412b22e..68b9d6d 100644 (file)
@@ -3,21 +3,11 @@
 /* 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/config.h>
 #include <xbt/string.hpp>
 #include <xbt/sysdep.h>
 
-#include <cstdarg>
-#include <cstdio>
-
 namespace simgrid::xbt {
 
-#if SIMGRID_HAVE_MC
-
-char string::NUL = '\0';
-
-#endif
-
 std::string string_vprintf(const char *fmt, va_list ap)
 {
   // Get the size: