common.hpp 845 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* Luwra
  2. * Minimal-overhead Lua wrapper for C++
  3. *
  4. * Copyright (C) 2015, Ole Krüger <ole@vprsm.de>
  5. */
  6. #ifndef LUWRA_COMMON_H_
  7. #define LUWRA_COMMON_H_
  8. // Check C++ version
  9. #if !defined(__cplusplus) || __cplusplus < 201103L
  10. #error You need a C++11 compliant compiler
  11. #endif
  12. extern "C" {
  13. #include <lua.h>
  14. #include <lualib.h>
  15. #include <lauxlib.h>
  16. }
  17. // Check for proper Lua version
  18. #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM >= 600
  19. #error Luwra has not been tested against your installed version of Lua
  20. #endif
  21. // LUA_OK does not exist in Lua 5.1 and earlier
  22. #ifndef LUA_OK
  23. #define LUA_OK 0
  24. #endif
  25. // Namespaces
  26. #define LUWRA_NS_BEGIN namespace luwra {
  27. #define LUWRA_NS_END }
  28. // Version MAJOR.MINOR.PATCH
  29. #define LUWRA_VERSION_MAJOR 0
  30. #define LUWRA_VERSION_MINOR 2
  31. #define LUWRA_VERSION_PATCH 0
  32. #endif