From 16c6f62fe3914b84805b18e7a5ff486d9cbcf986 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Mon, 22 Feb 2016 02:44:27 -0500 Subject: [PATCH] Remove strerror deprecation remark --- sol/compatibility/5.x.x.inl | 6 ++++-- tests.cpp | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sol/compatibility/5.x.x.inl b/sol/compatibility/5.x.x.inl index 04f66215..30154e74 100644 --- a/sol/compatibility/5.x.x.inl +++ b/sol/compatibility/5.x.x.inl @@ -307,11 +307,13 @@ inline int luaL_fileresult(lua_State *L, int stat, const char *fname) { return 1; } else { + char buf[1024]; + strerror_s(buf, 1024, en); lua_pushnil(L); if (fname) - lua_pushfstring(L, "%s: %s", fname, strerror(en)); + lua_pushfstring(L, "%s: %s", fname, buf); else - lua_pushstring(L, strerror(en)); + lua_pushstring(L, buf); lua_pushnumber(L, (lua_Number)en); return 3; } diff --git a/tests.cpp b/tests.cpp index 311c5f60..7ddfaa80 100644 --- a/tests.cpp +++ b/tests.cpp @@ -504,7 +504,6 @@ TEST_CASE("advanced/call_lambdas", "A C++ lambda is exposed to lua and called") REQUIRE(x == 9); } - TEST_CASE("advanced/call_referenced_obj", "A C++ object is passed by pointer/reference_wrapper to lua and invoked") { sol::state lua;