compatibility.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // sol2
  2. // The MIT License (MIT)
  3. // Copyright (c) 2013-2022 Rapptz, ThePhD and contributors
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy of
  5. // this software and associated documentation files (the "Software"), to deal in
  6. // the Software without restriction, including without limitation the rights to
  7. // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  8. // the Software, and to permit persons to whom the Software is furnished to do so,
  9. // subject to the following conditions:
  10. // The above copyright notice and this permission notice shall be included in all
  11. // copies or substantial portions of the Software.
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  14. // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  15. // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  16. // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  17. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  18. #ifndef SOL_COMPATIBILITY_HPP
  19. #define SOL_COMPATIBILITY_HPP
  20. // The various pieces of the compatibility layer
  21. // comes from https://github.com/keplerproject/lua-compat-5.3
  22. // but has been modified in many places for use with sol and luajit,
  23. // though the core abstractions remain the same
  24. #include <sol/version.hpp>
  25. #include <sol/compatibility/lua_version.hpp>
  26. #if SOL_IS_ON(SOL_USE_COMPATIBILITY_LAYER)
  27. // clang-format off
  28. #if SOL_IS_ON(SOL_USING_CXX_LUA) || SOL_IS_ON(SOL_USING_CXX_LUAJIT)
  29. #ifndef COMPAT53_LUA_CPP
  30. #define COMPAT53_LUA_CPP 1
  31. #endif // Build Lua Compat layer as C++
  32. #endif
  33. #ifndef COMPAT53_INCLUDE_SOURCE
  34. #define COMPAT53_INCLUDE_SOURCE 1
  35. #endif // Build Compat Layer Inline
  36. #include <sol/compatibility/compat-5.3.h>
  37. #include <sol/compatibility/compat-5.4.h>
  38. #endif
  39. // clang-format on
  40. #endif // SOL_COMPATIBILITY_HPP