Преглед изворни кода

Check for C++14 and Lua version properly

Ole Krüger пре 10 година
родитељ
комит
fe45ca036f
1 измењених фајлова са 8 додато и 7 уклоњено
  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 {