forward.hpp 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. // The MIT License (MIT)
  2. // Copyright (c) 2013-2020 Rapptz, ThePhD and contributors
  3. // Permission is hereby granted, free of charge, to any person obtaining a copy of
  4. // this software and associated documentation files (the "Software"), to deal in
  5. // the Software without restriction, including without limitation the rights to
  6. // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  7. // the Software, and to permit persons to whom the Software is furnished to do so,
  8. // subject to the following conditions:
  9. // The above copyright notice and this permission notice shall be included in all
  10. // copies or substantial portions of the Software.
  11. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  13. // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  14. // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  15. // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. // This file was generated with a script.
  18. // Generated 2020-10-03 21:34:25.022965 UTC
  19. // This header was generated with sol v3.2.1 (revision 48eea7b5)
  20. // https://github.com/ThePhD/sol2
  21. #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
  22. #define SOL_SINGLE_INCLUDE_FORWARD_HPP
  23. // beginning of sol/forward.hpp
  24. #ifndef SOL_FORWARD_HPP
  25. #define SOL_FORWARD_HPP
  26. // beginning of sol/version.hpp
  27. #include <sol/config.hpp>
  28. #include <cstdint>
  29. #define SOL_VERSION_MAJOR 3
  30. #define SOL_VERSION_MINOR 5
  31. #define SOL_VERSION_PATCH 0
  32. #define SOL_VERSION_STRING "3.5.0"
  33. #define SOL_VERSION ((SOL_VERSION_MAJOR * 100000) + (SOL_VERSION_MINOR * 100) + (SOL_VERSION_PATCH))
  34. #define SOL_IS_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) != 0)
  35. #define SOL_IS_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3) == 0)
  36. #define SOL_IS_DEFAULT_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) > 3)
  37. #define SOL_IS_DEFAULT_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3 OP_SYMBOL 3) < 0)
  38. #define SOL_ON |
  39. #define SOL_OFF ^
  40. #define SOL_DEFAULT_ON +
  41. #define SOL_DEFAULT_OFF -
  42. #if defined(_MSC_VER)
  43. #define SOL_COMPILER_CLANG_I_ SOL_OFF
  44. #define SOL_COMPILER_GCC_I_ SOL_OFF
  45. #define SOL_COMPILER_EDG_I_ SOL_OFF
  46. #define SOL_COMPILER_VCXX_I_ SOL_ON
  47. #elif defined(__clang__)
  48. #define SOL_COMPILER_CLANG_I_ SOL_ON
  49. #define SOL_COMPILER_GCC_I_ SOL_OFF
  50. #define SOL_COMPILER_EDG_I_ SOL_OFF
  51. #define SOL_COMPILER_VCXX_I_ SOL_OFF
  52. #elif defined(__GNUC__)
  53. #define SOL_COMPILER_CLANG_I_ SOL_OFF
  54. #define SOL_COMPILER_GCC_I_ SOL_ON
  55. #define SOL_COMPILER_EDG_I_ SOL_OFF
  56. #define SOL_COMPILER_VCXX_I_ SOL_OFF
  57. #else
  58. #define SOL_COMPILER_CLANG_I_ SOL_OFF
  59. #define SOL_COMPILER_GCC_I_ SOL_OFF
  60. #define SOL_COMPILER_EDG_I_ SOL_OFF
  61. #define SOL_COMPILER_VCXX_I_ SOL_OFF
  62. #endif
  63. #if defined(__MINGW32__)
  64. #define SOL_COMPILER_FRONTEND_MINGW_I_ SOL_ON
  65. #else
  66. #define SOL_COMPILER_FRONTEND_MINGW_I_ SOL_OFF
  67. #endif
  68. #if SIZE_MAX <= 0xFFFFULL
  69. #define SOL_PLATFORM_X16_I_ SOL_ON
  70. #define SOL_PLATFORM_X86_I_ SOL_OFF
  71. #define SOL_PLATFORM_X64_I_ SOL_OFF
  72. #elif SIZE_MAX <= 0xFFFFFFFFULL
  73. #define SOL_PLATFORM_X16_I_ SOL_OFF
  74. #define SOL_PLATFORM_X86_I_ SOL_ON
  75. #define SOL_PLATFORM_X64_I_ SOL_OFF
  76. #else
  77. #define SOL_PLATFORM_X16_I_ SOL_OFF
  78. #define SOL_PLATFORM_X86_I_ SOL_OFF
  79. #define SOL_PLATFORM_X64_I_ SOL_ON
  80. #endif
  81. #define SOL_PLATFORM_ARM32_I_ SOL_OFF
  82. #define SOL_PLATFORM_ARM64_I_ SOL_OFF
  83. #if defined(_WIN32)
  84. #define SOL_PLATFORM_WINDOWS_I_ SOL_ON
  85. #else
  86. #define SOL_PLATFORM_WINDOWS_I_ SOL_OFF
  87. #endif
  88. #if defined(__APPLE__)
  89. #define SOL_PLATFORM_APPLE_I_ SOL_ON
  90. #else
  91. #define SOL_PLATFORM_APPLE_I_ SOL_OFF
  92. #endif
  93. #if defined(__unix__)
  94. #define SOL_PLATFORM_UNIXLIKE_I_ SOL_ON
  95. #else
  96. #define SOL_PLATFORM_UNIXLIKE_I_ SOL_OFF
  97. #endif
  98. #if defined(__linux__)
  99. #define SOL_PLATFORM_LINUXLIKE_I_ SOL_ON
  100. #else
  101. #define SOL_PLATFORM_LINUXLIKE_I_ SOL_OFF
  102. #endif
  103. #define SOL_PLATFORM_APPLE_IPHONE_I_ SOL_OFF
  104. #define SOL_PLATFORM_BSDLIKE_I_ SOL_OFF
  105. #if defined(SOL_IN_DEBUG_DETECTED)
  106. #if SOL_IN_DEBUG_DETECTED != 0
  107. #define SOL_DEBUG_BUILD_I_ SOL_ON
  108. #else
  109. #define SOL_DEBUG_BUILD_I_ SOL_OFF
  110. #endif
  111. #elif !defined(NDEBUG)
  112. #if SOL_IS_ON(SOL_COMPILER_VCXX_I_) && defined(_DEBUG)
  113. #define SOL_DEBUG_BUILD_I_ SOL_ON
  114. #elif (SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_)) && !defined(__OPTIMIZE__)
  115. #define SOL_DEBUG_BUILD_I_ SOL_ON
  116. #else
  117. #define SOL_DEBUG_BUILD_I_ SOL_OFF
  118. #endif
  119. #else
  120. #define SOL_DEBUG_BUILD_I_ SOL_DEFAULT_OFF
  121. #endif // We are in a debug mode of some sort
  122. #if defined(SOL_NO_EXCEPTIONS)
  123. #if (SOL_NO_EXCEPTIONS != 0)
  124. #define SOL_EXCEPTIONS_I_ SOL_OFF
  125. #else
  126. #define SOL_EXCEPTIONS_I_ SOL_ON
  127. #endif
  128. #elif SOL_IS_ON(SOL_COMPILER_VCXX_I_)
  129. #if !defined(_CPPUNWIND)
  130. #define SOL_EXCEPTIONS_I_ SOL_OFF
  131. #else
  132. #define SOL_EXCEPTIONS_I_ SOL_ON
  133. #endif
  134. #elif SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_)
  135. #if !defined(__EXCEPTIONS)
  136. #define SOL_EXCEPTIONS_I_ SOL_OFF
  137. #else
  138. #define SOL_EXCEPTIONS_I_ SOL_ON
  139. #endif
  140. #else
  141. #define SOL_EXCEPTIONS_I_ SOL_DEFAULT_ON
  142. #endif
  143. #if defined(SOL_NO_RTTI)
  144. #if (SOL_NO_RTTI != 0)
  145. #define SOL_RTTI_I_ SOL_OFF
  146. #else
  147. #define SOL_RTTI_I_ SOL_ON
  148. #endif
  149. #elif SOL_IS_ON(SOL_COMPILER_VCXX_I_)
  150. #if !defined(_CPPRTTI)
  151. #define SOL_RTTI_I_ SOL_OFF
  152. #else
  153. #define SOL_RTTI_I_ SOL_ON
  154. #endif
  155. #elif SOL_IS_ON(SOL_COMPILER_CLANG_I_) || SOL_IS_ON(SOL_COMPILER_GCC_I_)
  156. #if !defined(__GXX_RTTI)
  157. #define SOL_RTTI_I_ SOL_OFF
  158. #else
  159. #define SOL_RTTI_I_ SOL_ON
  160. #endif
  161. #else
  162. #define SOL_RTTI_I_ SOL_DEFAULT_ON
  163. #endif
  164. #if defined(SOL_NO_THREAD_LOCAL) && (SOL_NO_THREAD_LOCAL != 0)
  165. #define SOL_USE_THREAD_LOCAL_I_ SOL_OFF
  166. #else
  167. #define SOL_USE_THREAD_LOCAL_I_ SOL_DEFAULT_ON
  168. #endif // thread_local keyword is bjorked on some platforms
  169. #if defined(SOL_ALL_SAFETIES_ON) && (SOL_ALL_SAFETIES_ON != 0)
  170. #define SOL_ALL_SAFETIES_ON_I_ SOL_ON
  171. #else
  172. #define SOL_ALL_SAFETIES_ON_I_ SOL_DEFAULT_OFF
  173. #endif
  174. #if defined(SOL_SAFE_GETTER) && (SOL_SAFE_GETTER != 0)
  175. #define SOL_SAFE_GETTER_I_ SOL_ON
  176. #else
  177. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  178. #define SOL_SAFE_GETTER_I_ SOL_ON
  179. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  180. #define SOL_SAFE_GETTER_I_ SOL_DEFAULT_ON
  181. #else
  182. #define SOL_SAFE_GETTER_I_ SOL_DEFAULT_OFF
  183. #endif
  184. #endif
  185. #if defined(SOL_SAFE_USERTYPE) && (SOL_SAFE_USERTYPE != 0)
  186. #define SOL_SAFE_USERTYPE_I_ SOL_ON
  187. #else
  188. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  189. #define SOL_SAFE_USERTYPE_I_ SOL_ON
  190. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  191. #define SOL_SAFE_USERTYPE_I_ SOL_DEFAULT_ON
  192. #else
  193. #define SOL_SAFE_USERTYPE_I_ SOL_DEFAULT_OFF
  194. #endif
  195. #endif
  196. #if defined(SOL_SAFE_REFERENCES) && (SOL_SAFE_REFERENCES != 0)
  197. #define SOL_SAFE_REFERENCES_I_ SOL_ON
  198. #else
  199. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  200. #define SOL_SAFE_REFERENCES_I_ SOL_ON
  201. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  202. #define SOL_SAFE_REFERENCES_I_ SOL_DEFAULT_ON
  203. #else
  204. #define SOL_SAFE_REFERENCES_I_ SOL_DEFAULT_OFF
  205. #endif
  206. #endif
  207. #if (defined(SOL_SAFE_FUNCTIONS) && (SOL_SAFE_FUNCTIONS != 0)) \
  208. || (defined(SOL_SAFE_FUNCTION_OBJECTS) && (SOL_SAFE_FUNCTION_OBJECTS != 0))
  209. #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_ON
  210. #else
  211. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  212. #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_ON
  213. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  214. #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_DEFAULT_ON
  215. #else
  216. #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_DEFAULT_OFF
  217. #endif
  218. #endif
  219. #if defined(SOL_SAFE_FUNCTION_CALLS) && (SOL_SAFE_FUNCTION_CALLS != 0)
  220. #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_ON
  221. #else
  222. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  223. #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_ON
  224. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  225. #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_DEFAULT_ON
  226. #else
  227. #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_DEFAULT_OFF
  228. #endif
  229. #endif
  230. #if defined(SOL_SAFE_PROXIES) && (SOL_SAFE_PROXIES != 0)
  231. #define SOL_SAFE_PROXIES_I_ SOL_ON
  232. #else
  233. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  234. #define SOL_SAFE_PROXIES_I_ SOL_ON
  235. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  236. #define SOL_SAFE_PROXIES_I_ SOL_DEFAULT_ON
  237. #else
  238. #define SOL_SAFE_PROXIES_I_ SOL_DEFAULT_OFF
  239. #endif
  240. #endif
  241. #if defined(SOL_SAFE_NUMERICS) && (SOL_SAFE_NUMERICS != 0)
  242. #define SOL_SAFE_NUMERICS_I_ SOL_ON
  243. #else
  244. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  245. #define SOL_SAFE_NUMERICS_I_ SOL_ON
  246. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  247. #define SOL_SAFE_NUMERICS_I_ SOL_DEFAULT_ON
  248. #else
  249. #define SOL_SAFE_NUMERICS_I_ SOL_DEFAULT_OFF
  250. #endif
  251. #endif
  252. #if defined(SOL_SAFE_STACK_CHECK) && (SOL_SAFE_STACK_CHECK != 0)
  253. #define SOL_SAFE_STACK_CHECK_I_ SOL_ON
  254. #else
  255. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  256. #define SOL_SAFE_STACK_CHECK_I_ SOL_ON
  257. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  258. #define SOL_SAFE_STACK_CHECK_I_ SOL_DEFAULT_ON
  259. #else
  260. #define SOL_SAFE_STACK_CHECK_I_ SOL_DEFAULT_OFF
  261. #endif
  262. #endif
  263. #if (defined(SOL_NO_CHECK_NUMBER_PRECISION) && (SOL_NO_CHECK_NUMBER_PRECISION != 0)) \
  264. || (defined(SOL_NO_CHECKING_NUMBER_PRECISION) && (SOL_NO_CHECKING_NUMBER_PRECISION != 0))
  265. #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_OFF
  266. #else
  267. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  268. #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON
  269. #elif SOL_IS_ON(SOL_SAFE_NUMERICS_I_)
  270. #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON
  271. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  272. #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_DEFAULT_ON
  273. #else
  274. #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_DEFAULT_OFF
  275. #endif
  276. #endif
  277. #if defined(SOL_STRINGS_ARE_NUMBERS)
  278. #if (SOL_STRINGS_ARE_NUMBERS != 0)
  279. #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_ON
  280. #else
  281. #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_OFF
  282. #endif
  283. #else
  284. #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_DEFAULT_OFF
  285. #endif
  286. #if defined(SOL_ENABLE_INTEROP) && (SOL_ENABLE_INTEROP != 0) \
  287. || defined(SOL_USE_INTEROP) && (SOL_USE_INTEROP != 0)
  288. #define SOL_USE_INTEROP_I_ SOL_ON
  289. #else
  290. #define SOL_USE_INTEROP_I_ SOL_DEFAULT_OFF
  291. #endif
  292. #if defined(SOL_NO_NIL)
  293. #if (SOL_NO_NIL != 0)
  294. #define SOL_NIL_I_ SOL_OFF
  295. #else
  296. #define SOL_NIL_I_ SOL_ON
  297. #endif
  298. #elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil)
  299. #define SOL_NIL_I_ SOL_DEFAULT_OFF
  300. #else
  301. #define SOL_NIL_I_ SOL_DEFAULT_ON
  302. #endif
  303. #if defined(SOL_USERTYPE_TYPE_BINDING_INFO)
  304. #if (SOL_USERTYPE_TYPE_BINDING_INFO != 0)
  305. #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_ON
  306. #else
  307. #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_OFF
  308. #endif
  309. #else
  310. #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_DEFAULT_ON
  311. #endif // We should generate a my_type.__type table with lots of class information for usertypes
  312. #if defined(SOL_AUTOMAGICAL_TYPES_BY_DEFAULT)
  313. #if (SOL_AUTOMAGICAL_TYPES_BY_DEFAULT != 0)
  314. #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_ON
  315. #else
  316. #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_OFF
  317. #endif
  318. #elif defined(SOL_DEFAULT_AUTOMAGICAL_USERTYPES)
  319. #if (SOL_DEFAULT_AUTOMAGICAL_USERTYPES != 0)
  320. #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_ON
  321. #else
  322. #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_OFF
  323. #endif
  324. #else
  325. #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_DEFAULT_ON
  326. #endif // make is_automagical on/off by default
  327. #if defined(SOL_STD_VARIANT)
  328. #if (SOL_STD_VARIANT != 0)
  329. #define SOL_STD_VARIANT_I_ SOL_ON
  330. #else
  331. #define SOL_STD_VARIANT_I_ SOL_OFF
  332. #endif
  333. #else
  334. #if SOL_IS_ON(SOL_COMPILER_CLANG_I_) && SOL_IS_ON(SOL_PLATFORM_APPLE_I_)
  335. #if defined(__has_include)
  336. #if __has_include(<variant>)
  337. #define SOL_STD_VARIANT_I_ SOL_ON
  338. #else
  339. #define SOL_STD_VARIANT_I_ SOL_OFF
  340. #endif
  341. #else
  342. #define SOL_STD_VARIANT_I_ SOL_OFF
  343. #endif
  344. #else
  345. #define SOL_STD_VARIANT_I_ SOL_DEFAULT_ON
  346. #endif
  347. #endif // make is_automagical on/off by default
  348. #if defined(SOL_NOEXCEPT_FUNCTION_TYPE)
  349. #if (SOL_NOEXCEPT_FUNCTION_TYPE != 0)
  350. #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_ON
  351. #else
  352. #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_OFF
  353. #endif
  354. #else
  355. #if defined(__cpp_noexcept_function_type)
  356. #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_ON
  357. #elif SOL_IS_ON(SOL_COMPILER_VCXX_I_) && (defined(_MSVC_LANG) && (_MSVC_LANG < 201403L))
  358. // There is a bug in the VC++ compiler??
  359. // on /std:c++latest under x86 conditions (VS 15.5.2),
  360. // compiler errors are tossed for noexcept markings being on function types
  361. // that are identical in every other way to their non-noexcept marked types function types...
  362. // VS 2019: There is absolutely a bug.
  363. #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_OFF
  364. #else
  365. #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_DEFAULT_ON
  366. #endif
  367. #endif // noexcept is part of a function's type
  368. #if defined(SOL_STACK_STRING_OPTIMIZATION_SIZE) && SOL_STACK_STRING_OPTIMIZATION_SIZE > 0
  369. #define SOL_OPTIMIZATION_STRING_CONVERSION_STACK_SIZE_I_ SOL_STACK_STRING_OPTIMIZATION_SIZE
  370. #else
  371. #define SOL_OPTIMIZATION_STRING_CONVERSION_STACK_SIZE_I_ 1024
  372. #endif
  373. #if defined(SOL_ID_SIZE) && SOL_ID_SIZE > 0
  374. #define SOL_ID_SIZE_I_ SOL_ID_SIZE
  375. #else
  376. #define SOL_ID_SIZE_I_ 512
  377. #endif
  378. #if defined(LUA_IDSIZE) && LUA_IDSIZE > 0
  379. #define SOL_FILE_ID_SIZE_I_ LUA_IDSIZE
  380. #elif defined(SOL_ID_SIZE) && SOL_ID_SIZE > 0
  381. #define SOL_FILE_ID_SIZE_I_ SOL_FILE_ID_SIZE
  382. #else
  383. #define SOL_FILE_ID_SIZE_I_ 2048
  384. #endif
  385. #if defined(SOL_PRINT_ERRORS)
  386. #if (SOL_PRINT_ERRORS != 0)
  387. #define SOL_PRINT_ERRORS_I_ SOL_ON
  388. #else
  389. #define SOL_PRINT_ERRORS_I_ SOL_OFF
  390. #endif
  391. #else
  392. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  393. #define SOL_PRINT_ERRORS_I_ SOL_ON
  394. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  395. #define SOL_PRINT_ERRORS_I_ SOL_DEFAULT_ON
  396. #else
  397. #define SOL_PRINT_ERRORS_I_ SOL_OFF
  398. #endif
  399. #endif
  400. #if defined(SOL_DEFAULT_PASS_ON_ERROR) && (SOL_DEFAULT_PASS_ON_ERROR != 0)
  401. #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_ON
  402. #else
  403. #if SOL_IS_ON(SOL_ALL_SAFETIES_ON_I_)
  404. #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_ON
  405. #elif SOL_IS_ON(SOL_DEBUG_BUILD_I_)
  406. #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_DEFAULT_ON
  407. #else
  408. #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_OFF
  409. #endif
  410. #endif
  411. #if defined(SOL_USING_CXX_LUA)
  412. #if (SOL_USING_CXX_LUA != 0)
  413. #define SOL_USE_CXX_LUA_I_ SOL_ON
  414. #else
  415. #define SOL_USE_CXX_LUA_I_ SOL_OFF
  416. #endif
  417. #elif defined(SOL_USE_CXX_LUA)
  418. #if (SOL_USE_CXX_LUA != 0)
  419. #define SOL_USE_CXX_LUA_I_ SOL_ON
  420. #else
  421. #define SOL_USE_CXX_LUA_I_ SOL_OFF
  422. #endif
  423. #else
  424. #define SOL_USE_CXX_LUA_I_ SOL_OFF
  425. #endif
  426. #if defined(SOL_USING_CXX_LUAJIT)
  427. #if (SOL_USING_CXX_LUA != 0)
  428. #define SOL_USE_CXX_LUAJIT_I_ SOL_ON
  429. #else
  430. #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF
  431. #endif
  432. #elif defined(SOL_USE_CXX_LUAJIT)
  433. #if (SOL_USE_CXX_LUA != 0)
  434. #define SOL_USE_CXX_LUAJIT_I_ SOL_ON
  435. #else
  436. #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF
  437. #endif
  438. #else
  439. #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF
  440. #endif
  441. #if defined(SOL_NO_LUA_HPP)
  442. #if (SOL_NO_LUA_HPP != 0)
  443. #define SOL_USE_LUA_HPP_I_ SOL_OFF
  444. #else
  445. #define SOL_USE_LUA_HPP_I_ SOL_ON
  446. #endif
  447. #elif defined(SOL_USING_CXX_LUA)
  448. #define SOL_USE_LUA_HPP_I_ SOL_OFF
  449. #elif defined(__has_include)
  450. #if __has_include(<lua.hpp>)
  451. #define SOL_USE_LUA_HPP_I_ SOL_ON
  452. #else
  453. #define SOL_USE_LUA_HPP_I_ SOL_OFF
  454. #endif
  455. #else
  456. #define SOL_USE_LUA_HPP_I_ SOL_DEFAULT_ON
  457. #endif
  458. #if defined(SOL_CONTAINERS_START)
  459. #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINERS_START
  460. #elif defined(SOL_CONTAINERS_START_INDEX)
  461. #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINERS_START_INDEX
  462. #elif defined(SOL_CONTAINER_START_INDEX)
  463. #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINER_START_INDEX
  464. #else
  465. #define SOL_CONTAINER_START_INDEX_I_ 1
  466. #endif
  467. #if defined (SOL_NO_MEMORY_ALIGNMENT)
  468. #if (SOL_NO_MEMORY_ALIGNMENT != 0)
  469. #define SOL_ALIGN_MEMORY_I_ SOL_OFF
  470. #else
  471. #define SOL_ALIGN_MEMORY_I_ SOL_ON
  472. #endif
  473. #else
  474. #define SOL_ALIGN_MEMORY_I_ SOL_DEFAULT_ON
  475. #endif
  476. #if defined(SOL_USE_BOOST)
  477. #if (SOL_USE_BOOST != 0)
  478. #define SOL_USE_BOOST_I_ SOL_ON
  479. #else
  480. #define SOL_USE_BOOST_I_ SOL_OFF
  481. #endif
  482. #else
  483. #define SOL_USE_BOOST_I_ SOL_OFF
  484. #endif
  485. #if defined(SOL_USE_UNSAFE_BASE_LOOKUP)
  486. #if (SOL_USE_UNSAFE_BASE_LOOKUP != 0)
  487. #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_ON
  488. #else
  489. #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_OFF
  490. #endif
  491. #else
  492. #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_OFF
  493. #endif
  494. #if defined(SOL_INSIDE_UNREAL)
  495. #if (SOL_INSIDE_UNREAL != 0)
  496. #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_ON
  497. #else
  498. #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_OFF
  499. #endif
  500. #else
  501. #if defined(UE_BUILD_DEBUG) || defined(UE_BUILD_DEVELOPMENT) || defined(UE_BUILD_TEST) || defined(UE_BUILD_SHIPPING) || defined(UE_SERVER)
  502. #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_ON
  503. #else
  504. #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_DEFAULT_OFF
  505. #endif
  506. #endif
  507. #if defined(SOL_NO_COMPAT)
  508. #if (SOL_NO_COMPAT != 0)
  509. #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_OFF
  510. #else
  511. #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_ON
  512. #endif
  513. #else
  514. #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_DEFAULT_ON
  515. #endif
  516. #if defined(SOL_GET_FUNCTION_POINTER_UNSAFE)
  517. #if (SOL_GET_FUNCTION_POINTER_UNSAFE != 0)
  518. #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_ON
  519. #else
  520. #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_OFF
  521. #endif
  522. #else
  523. #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_DEFAULT_OFF
  524. #endif
  525. #if SOL_IS_ON(SOL_COMPILER_FRONTEND_MINGW_I_) && defined(__GNUC__) && (__GNUC__ < 6)
  526. // MinGW is off its rocker in some places...
  527. #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_ON
  528. #else
  529. #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_DEFAULT_OFF
  530. #endif
  531. // end of sol/version.hpp
  532. #include <utility>
  533. #include <type_traits>
  534. #include <string_view>
  535. #if SOL_IS_ON(SOL_USE_CXX_LUA_I_) || SOL_IS_ON(SOL_USE_CXX_LUAJIT_I_)
  536. struct lua_State;
  537. #else
  538. extern "C" {
  539. struct lua_State;
  540. }
  541. #endif // C++ Mangling for Lua vs. Not
  542. namespace sol {
  543. enum class type;
  544. class stateless_reference;
  545. template <bool b>
  546. class basic_reference;
  547. using reference = basic_reference<false>;
  548. using main_reference = basic_reference<true>;
  549. class stateless_stack_reference;
  550. class stack_reference;
  551. template <typename A>
  552. class basic_bytecode;
  553. struct lua_value;
  554. struct proxy_base_tag;
  555. template <typename>
  556. struct proxy_base;
  557. template <typename, typename>
  558. struct table_proxy;
  559. template <bool, typename>
  560. class basic_table_core;
  561. template <bool b>
  562. using table_core = basic_table_core<b, reference>;
  563. template <bool b>
  564. using main_table_core = basic_table_core<b, main_reference>;
  565. template <bool b>
  566. using stack_table_core = basic_table_core<b, stack_reference>;
  567. template <typename base_type>
  568. using basic_table = basic_table_core<false, base_type>;
  569. using table = table_core<false>;
  570. using global_table = table_core<true>;
  571. using main_table = main_table_core<false>;
  572. using main_global_table = main_table_core<true>;
  573. using stack_table = stack_table_core<false>;
  574. using stack_global_table = stack_table_core<true>;
  575. template <typename>
  576. struct basic_lua_table;
  577. using lua_table = basic_lua_table<reference>;
  578. using stack_lua_table = basic_lua_table<stack_reference>;
  579. template <typename T, typename base_type>
  580. class basic_usertype;
  581. template <typename T>
  582. using usertype = basic_usertype<T, reference>;
  583. template <typename T>
  584. using stack_usertype = basic_usertype<T, stack_reference>;
  585. template <typename base_type>
  586. class basic_metatable;
  587. using metatable = basic_metatable<reference>;
  588. using stack_metatable = basic_metatable<stack_reference>;
  589. template <typename base_t>
  590. struct basic_environment;
  591. using environment = basic_environment<reference>;
  592. using main_environment = basic_environment<main_reference>;
  593. using stack_environment = basic_environment<stack_reference>;
  594. template <typename T, bool>
  595. class basic_function;
  596. template <typename T, bool, typename H>
  597. class basic_protected_function;
  598. using unsafe_function = basic_function<reference, false>;
  599. using safe_function = basic_protected_function<reference, false, reference>;
  600. using main_unsafe_function = basic_function<main_reference, false>;
  601. using main_safe_function = basic_protected_function<main_reference, false, reference>;
  602. using stack_unsafe_function = basic_function<stack_reference, false>;
  603. using stack_safe_function = basic_protected_function<stack_reference, false, reference>;
  604. using stack_aligned_unsafe_function = basic_function<stack_reference, true>;
  605. using stack_aligned_safe_function = basic_protected_function<stack_reference, true, reference>;
  606. using protected_function = safe_function;
  607. using main_protected_function = main_safe_function;
  608. using stack_protected_function = stack_safe_function;
  609. using stack_aligned_protected_function = stack_aligned_safe_function;
  610. #if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS_I_)
  611. using function = protected_function;
  612. using main_function = main_protected_function;
  613. using stack_function = stack_protected_function;
  614. using stack_aligned_function = stack_aligned_safe_function;
  615. #else
  616. using function = unsafe_function;
  617. using main_function = main_unsafe_function;
  618. using stack_function = stack_unsafe_function;
  619. using stack_aligned_function = stack_aligned_unsafe_function;
  620. #endif
  621. using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
  622. struct unsafe_function_result;
  623. struct protected_function_result;
  624. using safe_function_result = protected_function_result;
  625. #if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS_I_)
  626. using function_result = safe_function_result;
  627. #else
  628. using function_result = unsafe_function_result;
  629. #endif
  630. template <typename base_t>
  631. class basic_object_base;
  632. template <typename base_t>
  633. class basic_object;
  634. template <typename base_t>
  635. class basic_userdata;
  636. template <typename base_t>
  637. class basic_lightuserdata;
  638. template <typename base_t>
  639. class basic_coroutine;
  640. template <typename base_t>
  641. class basic_thread;
  642. using object = basic_object<reference>;
  643. using userdata = basic_userdata<reference>;
  644. using lightuserdata = basic_lightuserdata<reference>;
  645. using thread = basic_thread<reference>;
  646. using coroutine = basic_coroutine<reference>;
  647. using main_object = basic_object<main_reference>;
  648. using main_userdata = basic_userdata<main_reference>;
  649. using main_lightuserdata = basic_lightuserdata<main_reference>;
  650. using main_coroutine = basic_coroutine<main_reference>;
  651. using stack_object = basic_object<stack_reference>;
  652. using stack_userdata = basic_userdata<stack_reference>;
  653. using stack_lightuserdata = basic_lightuserdata<stack_reference>;
  654. using stack_thread = basic_thread<stack_reference>;
  655. using stack_coroutine = basic_coroutine<stack_reference>;
  656. struct stack_proxy_base;
  657. struct stack_proxy;
  658. struct variadic_args;
  659. struct variadic_results;
  660. struct stack_count;
  661. struct this_state;
  662. struct this_main_state;
  663. struct this_environment;
  664. class state_view;
  665. class state;
  666. template <typename T>
  667. struct as_table_t;
  668. template <typename T>
  669. struct as_container_t;
  670. template <typename T>
  671. struct nested;
  672. template <typename T>
  673. struct light;
  674. template <typename T>
  675. struct user;
  676. template <typename T>
  677. struct as_args_t;
  678. template <typename T>
  679. struct protect_t;
  680. template <typename F, typename... Policies>
  681. struct policy_wrapper;
  682. template <typename T>
  683. struct usertype_traits;
  684. template <typename T>
  685. struct unique_usertype_traits;
  686. template <typename... Args>
  687. struct types {
  688. typedef std::make_index_sequence<sizeof...(Args)> indices;
  689. static constexpr std::size_t size() {
  690. return sizeof...(Args);
  691. }
  692. };
  693. template <typename T>
  694. struct derive : std::false_type {
  695. typedef types<> type;
  696. };
  697. template <typename T>
  698. struct base : std::false_type {
  699. typedef types<> type;
  700. };
  701. template <typename T>
  702. struct weak_derive {
  703. static bool value;
  704. };
  705. template <typename T>
  706. bool weak_derive<T>::value = false;
  707. namespace stack {
  708. struct record;
  709. }
  710. #if SOL_IS_OFF(SOL_USE_BOOST_I_)
  711. template <class T>
  712. class optional;
  713. template <class T>
  714. class optional<T&>;
  715. #endif
  716. using check_handler_type = int(lua_State*, int, type, type, const char*);
  717. } // namespace sol
  718. #define SOL_BASE_CLASSES(T, ...) \
  719. namespace sol { \
  720. template <> \
  721. struct base<T> : std::true_type { \
  722. typedef ::sol::types<__VA_ARGS__> type; \
  723. }; \
  724. } \
  725. void a_sol3_detail_function_decl_please_no_collide()
  726. #define SOL_DERIVED_CLASSES(T, ...) \
  727. namespace sol { \
  728. template <> \
  729. struct derive<T> : std::true_type { \
  730. typedef ::sol::types<__VA_ARGS__> type; \
  731. }; \
  732. } \
  733. void a_sol3_detail_function_decl_please_no_collide()
  734. #endif // SOL_FORWARD_HPP
  735. // end of sol/forward.hpp
  736. #endif // SOL_SINGLE_INCLUDE_FORWARD_HPP