diff UnitTestsSources/LuaTests.cpp @ 2947:11f8d72f366f

Lua 5.3.5
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 29 Nov 2018 18:40:51 +0100
parents 878b59270859
children 4e43e67f8ecf
line wrap: on
line diff
--- a/UnitTestsSources/LuaTests.cpp	Thu Nov 29 17:15:29 2018 +0100
+++ b/UnitTestsSources/LuaTests.cpp	Thu Nov 29 18:40:51 2018 +0100
@@ -293,7 +293,13 @@
   // OpenSSL/HTTPS support is disabled in curl
   const std::string BASE = "http://www.orthanc-server.com/downloads/third-party/";
 
+#if LUA_VERSION_NUM >= 502
+  // Since Lua >= 5.2.0, the function "loadstring" has been replaced by "load"
+  lua.Execute("JSON = load(HttpGet('" + BASE + "JSON.lua')) ()");
+#else
   lua.Execute("JSON = loadstring(HttpGet('" + BASE + "JSON.lua')) ()");
+#endif
+
   const std::string url(BASE + "Product.json");
 #endif