Parcourir la Source

Check for C++14 and Lua version properly

Ole Krüger il y a 10 ans
Parent
commit
fe45ca036f
1 fichiers modifiés avec 8 ajouts et 7 suppressions
  1. 8 7
      lib/luwra/common.h

+ 8 - 7
lib/luwra/common.h

@@ -7,16 +7,17 @@
 #ifndef LUWRA_COMMON_H_
 #define LUWRA_COMMON_H_
 
+// Check C++ version
+#if !defined(__cplusplus) || __cplusplus < 201402L
+	#error "You need a C++14 compliant compiler"
+#endif
+
 #include <lua.hpp>
 
 // Check for proper Lua version
-#if defined(LUA_VERSION_NUM)
-	#if LUA_VERSION_NUM < 503 || LUA_VERSION >= 600
-		#warning "Luwra has not been tested against your installed version of Lua"
-	#end
-#else
-	#error "Your Lua library does not define LUA_VERSION_NUM"
-#end
+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 503 || LUA_VERSION >= 600
+	#warning "Luwra has not been tested against your installed version of Lua"
+#endif
 
 #define LUWRA_NS_BEGIN namespace luwra {