]> AND Public Git Repository - simgrid.git/blobdiff - src/bindings/lua/lua_private.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make single argument constructor LinkInRoute::LinkInRoute(const Link*) explicit.
[simgrid.git] / src / bindings / lua / lua_private.hpp
index 3243ec367f84a6f2391017053948bcef119e8c5f..7200558a766f70cd739b3946f0f7915fcba7f25e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2021. 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. */
@@ -8,19 +8,20 @@
 #ifndef LUA_PRIVATE_HPP
 #define LUA_PRIVATE_HPP
 
-#include "simgrid/msg.h"
+#include "simgrid/host.h"
 #include "simgrid_lua.hpp"
+#include "xbt/log.h"
 
 void sglua_register_host_functions(lua_State* L);
-msg_host_t sglua_check_host(lua_State* L, int index);
+sg_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)
+#define _lua_ensure_ARG1(cond) _lua_ensure_ARGN((cond), "Assertion " _XBT_STRINGIFY(cond) " failed")
 #define _lua_ensure_ARGN(cond, ...)                                                                                    \
   do {                                                                                                                 \
-    if (!(cond)) {                                                                                                     \
+    if (not(cond)) {                                                                                                   \
       luaL_error(L, __VA_ARGS__);                                                                                      \
       return -1;                                                                                                       \
     }                                                                                                                  \