From 7be51ebbef6719b6a99bdd7315acbb3ebe1b4c6c Mon Sep 17 00:00:00 2001 From: ThePhD Date: Thu, 16 Jul 2020 19:46:15 -0400 Subject: [PATCH] Add tons of redundant includes in the single, since they may be conditionally compiled out, and add a note to see if this can be looked into more closely later... --- include/sol/compatibility/compat-5.3.h | 4 +- single/include/sol/forward.hpp | 4 +- single/include/sol/sol.hpp | 149 ++++++++++++++++++++++++- single/single.py | 17 ++- 4 files changed, 160 insertions(+), 14 deletions(-) diff --git a/include/sol/compatibility/compat-5.3.h b/include/sol/compatibility/compat-5.3.h index 1aebf292..c2ac0331 100644 --- a/include/sol/compatibility/compat-5.3.h +++ b/include/sol/compatibility/compat-5.3.h @@ -401,9 +401,9 @@ COMPAT53_API void luaL_requiref(lua_State *L, const char *modname, /* other Lua versions */ #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 504 -# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, or 5.3)" +# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, 5.3, or 5.4)" -#endif /* other Lua versions except 5.1, 5.2, and 5.3 */ +#endif /* other Lua versions except 5.1, 5.2, 5.3, and 5.4 */ diff --git a/single/include/sol/forward.hpp b/single/include/sol/forward.hpp index cb023041..2d2e87e5 100644 --- a/single/include/sol/forward.hpp +++ b/single/include/sol/forward.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2020-07-15 13:23:11.320974 UTC -// This header was generated with sol v3.2.1 (revision 6869ad3) +// Generated 2020-07-16 23:44:56.005352 UTC +// This header was generated with sol v3.2.1 (revision 4a16979) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/single/include/sol/sol.hpp b/single/include/sol/sol.hpp index a1344fec..01897352 100644 --- a/single/include/sol/sol.hpp +++ b/single/include/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2020-07-15 13:23:10.917866 UTC -// This header was generated with sol v3.2.1 (revision 6869ad3) +// Generated 2020-07-16 23:44:55.472351 UTC +// This header was generated with sol v3.2.1 (revision 4a16979) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -524,6 +524,8 @@ namespace sol { // beginning of sol/base_traits.hpp +#include + namespace sol { namespace detail { struct unchecked_t {}; @@ -1189,6 +1191,9 @@ namespace meta { // beginning of sol/pointer_like.hpp +#include +#include + namespace sol { namespace meta { @@ -1262,7 +1267,9 @@ namespace sol { // beginning of sol/string_view.hpp +#include #include +#include #include #if defined(SOL_USE_BOOST) && SOL_USE_BOOST #include @@ -1281,8 +1288,10 @@ namespace sol { // end of sol/string_view.hpp +#include #include #include +#include #include #include #include @@ -1987,7 +1996,11 @@ namespace sol { #else #if defined(SOL_NO_LUA_HPP) && SOL_NO_LUA_HPP extern "C" { + #include + #include + #include #if defined(LUAJIT_VERSION) && LUAJIT_VERSION + #include #endif } #else @@ -1996,11 +2009,16 @@ namespace sol { #include #else extern "C" { + #include + #include + #include #if defined(LUAJIT_VERSION) && LUAJIT_VERSION + #include #endif } #endif // lua.hpp exists or does not #else + #include #endif // check for lua.hpp safely for Lua 5.1 derps #endif // Manual - have lua.hpp or not #endif // C++ Mangling for Lua vs. Not @@ -2058,6 +2076,9 @@ namespace sol { #if defined(__cplusplus) && !defined(COMPAT53_LUA_CPP) extern "C" { #endif +#include +#include +#include #if defined(__cplusplus) && !defined(COMPAT53_LUA_CPP) } #endif @@ -2440,9 +2461,9 @@ COMPAT53_API void luaL_requiref(lua_State *L, const char *modname, /* other Lua versions */ #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 504 -# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, or 5.3)" +# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, 5.3, or 5.4)" -#endif /* other Lua versions except 5.1, 5.2, and 5.3 */ +#endif /* other Lua versions except 5.1, 5.2, 5.3, and 5.4 */ /* helper macro for defining continuation functions (for every version * *except* Lua 5.2) */ @@ -2454,7 +2475,9 @@ COMPAT53_API void luaL_requiref(lua_State *L, const char *modname, #if defined(COMPAT53_INCLUDE_SOURCE) && COMPAT53_INCLUDE_SOURCE == 1 // beginning of sol/compatibility/compat-5.3.c.h +#include #include +#include #include #include #include @@ -3304,6 +3327,9 @@ COMPAT53_API void luaL_requiref(lua_State *L, const char *modname, #if defined(__cplusplus) && !defined(COMPAT53_LUA_CPP) extern "C" { #endif +#include +#include +#include #if defined(__cplusplus) && !defined(COMPAT53_LUA_CPP) } #endif @@ -3326,6 +3352,8 @@ extern "C" { // end of sol/compatibility.hpp #include +#include +#include namespace sol { @@ -3425,6 +3453,8 @@ namespace sol { // beginning of sol/error.hpp #include +#include +#include namespace sol { namespace detail { @@ -3488,6 +3518,9 @@ namespace sol { // beginning of sol/in_place.hpp +#include +#include + namespace sol { using in_place_t = std::in_place_t; @@ -3517,7 +3550,10 @@ namespace sol { #define SOL_TL_OPTIONAL_VERSION_MINOR 5 #include +#include #include +#include +#include #include #include @@ -5741,6 +5777,8 @@ namespace std { #endif // Boost vs. Better optional +#include + namespace sol { #if defined(SOL_USE_BOOST) && SOL_USE_BOOST @@ -5780,6 +5818,8 @@ namespace sol { // beginning of sol/raii.hpp +#include + namespace sol { namespace detail { struct default_construct { @@ -5918,6 +5958,8 @@ namespace sol { // beginning of sol/policies.hpp +#include + namespace sol { namespace detail { struct policy_base_tag {}; @@ -5989,6 +6031,9 @@ namespace sol { // beginning of sol/ebco.hpp +#include +#include + namespace sol { namespace detail { template @@ -6139,8 +6184,13 @@ namespace sol { namespace detail { // end of sol/map.hpp +#include #include +#include +#include +#include #if SOL_ON(SOL_STD_VARIANT_) +#include #endif // variant shenanigans (thanks, Mac OSX) namespace sol { @@ -7468,6 +7518,7 @@ namespace sol { // end of sol/types.hpp +#include #include #if defined(SOL_PRINT_ERRORS) && SOL_PRINT_ERRORS @@ -7669,9 +7720,12 @@ namespace sol { // beginning of sol/demangle.hpp +#include +#include #include #if defined(__GNUC__) && defined(__MINGW32__) && (__GNUC__ < 6) extern "C" { +#include } #endif // MinGW is on some stuff #include @@ -7867,6 +7921,8 @@ namespace sol { // beginning of sol/unique_usertype_traits.hpp +#include + namespace sol { template @@ -8489,6 +8545,8 @@ namespace sol { // end of sol/stack_reference.hpp +#include + namespace sol { namespace detail { inline const char (&default_main_thread_name())[9] { @@ -9284,6 +9342,8 @@ namespace sol { // beginning of sol/stack_guard.hpp +#include + namespace sol { namespace detail { inline void stack_fail(int, int) { @@ -9322,10 +9382,13 @@ namespace sol { // end of sol/stack_guard.hpp +#include #include #include +#include #include #include +#include namespace sol { namespace detail { @@ -10732,8 +10795,13 @@ namespace sol { // beginning of sol/stack_check_unqualified.hpp +#include +#include +#include #include +#include #if SOL_ON(SOL_STD_VARIANT_) +#include #endif // variant shenanigans namespace sol { namespace stack { @@ -11387,6 +11455,8 @@ namespace stack { // beginning of sol/overload.hpp +#include + namespace sol { template struct overload_set { @@ -11411,6 +11481,9 @@ namespace sol { // beginning of sol/unicode.hpp +#include +#include + namespace sol { // Everything here was lifted pretty much straight out of // ogonek, because fuck figuring it out= @@ -11719,7 +11792,14 @@ namespace sol { } // end of sol/unicode.hpp +#include +#include +#include +#include +#include +#include #if SOL_ON(SOL_STD_VARIANT_) +#include #endif // Apple clang screwed up namespace sol { namespace stack { @@ -12728,7 +12808,11 @@ namespace stack { // beginning of sol/stack_check_get_unqualified.hpp +#include +#include +#include #if SOL_ON(SOL_STD_VARIANT_) +#include #endif // variant shenanigans (thanks, Mac OSX) namespace sol { namespace stack { @@ -12934,9 +13018,14 @@ namespace sol { namespace stack { // beginning of sol/stack_push.hpp +#include +#include #include #include +#include +#include #if SOL_ON(SOL_STD_VARIANT_) +#include #endif // Can use variant namespace sol { namespace stack { @@ -14122,6 +14211,9 @@ namespace sol { namespace stack { // beginning of sol/stack_pop.hpp +#include +#include + namespace sol { namespace stack { template @@ -14434,6 +14526,9 @@ namespace stack { // end of sol/stack_probe.hpp +#include +#include + namespace sol { namespace detail { using typical_chunk_name_t = char[SOL_ID_SIZE_]; @@ -14990,6 +15085,9 @@ namespace sol { // beginning of sol/stack_iterator.hpp +#include +#include + namespace sol { template struct stack_iterator { @@ -15227,6 +15325,8 @@ namespace sol { // end of sol/stack_proxy.hpp +#include + namespace sol { struct protected_function_result : public proxy_base { private: @@ -15419,6 +15519,8 @@ namespace sol { // beginning of sol/unsafe_function_result.hpp +#include + namespace sol { struct unsafe_function_result : public proxy_base { private: @@ -15561,6 +15663,8 @@ namespace sol { // end of sol/unsafe_function_result.hpp +#include + namespace sol { namespace detail { @@ -15895,6 +15999,8 @@ namespace sol { // end of sol/wrapper.hpp +#include + namespace sol { namespace function_detail { template @@ -15919,6 +16025,9 @@ namespace function_detail { // beginning of sol/property.hpp +#include +#include + namespace sol { namespace detail { struct no_prop {}; @@ -16040,6 +16149,8 @@ namespace sol { // beginning of sol/protect.hpp +#include + namespace sol { template @@ -18279,6 +18390,9 @@ namespace sol { // beginning of sol/dump_handler.hpp +#include +#include + namespace sol { class dump_error : public error { @@ -18326,6 +18440,8 @@ namespace sol { // end of sol/dump_handler.hpp +#include + namespace sol { template class basic_function : public basic_object { @@ -18471,6 +18587,8 @@ namespace sol { // beginning of sol/protected_handler.hpp +#include + namespace sol { namespace detail { inline const char(&default_handler_name())[9]{ @@ -18553,6 +18671,9 @@ namespace sol { // end of sol/protected_handler.hpp +#include +#include + namespace sol { namespace detail { @@ -18867,6 +18988,8 @@ namespace sol { // end of sol/protected_function.hpp +#include + namespace sol { template decltype(auto) stack_proxy::call(Args&&... args) { @@ -20928,6 +21051,9 @@ namespace sol { // end of sol/usertype_container_launch.hpp +#include +#include + namespace sol { namespace u_detail { constexpr const lua_Integer toplevel_magic = static_cast(0xCCC2CCC1); @@ -21094,6 +21220,8 @@ namespace sol { // beginning of sol/usertype_storage.hpp +#include + namespace sol { namespace u_detail { struct usertype_storage_base; @@ -22652,6 +22780,8 @@ namespace sol { // beginning of sol/table_iterator.hpp +#include + namespace sol { template @@ -23966,6 +24096,8 @@ namespace sol { // beginning of sol/load_result.hpp +#include + namespace sol { struct load_result : public proxy_base { private: @@ -24223,6 +24355,7 @@ namespace sol { // end of sol/lua_value.hpp #if defined(SOL_PRINT_ERRORS) && SOL_PRINT_ERRORS +#include #endif namespace sol { @@ -24381,6 +24514,9 @@ namespace sol { // end of sol/state_handling.hpp +#include +#include + namespace sol { class state_view { @@ -25670,6 +25806,9 @@ namespace sol { // beginning of sol/variadic_args.hpp +#include +#include + namespace sol { struct variadic_args { private: @@ -25855,6 +25994,8 @@ namespace sol { // end of sol/as_returns.hpp +#include + namespace sol { template > diff --git a/single/single.py b/single/single.py index 5f96df1e..cb7a3dc8 100644 --- a/single/single.py +++ b/single/single.py @@ -171,12 +171,17 @@ def process_file(filename, out): base_path = os.path.dirname(filename) # check if it's a standard file - std = standard_include.search(line) - if std: - std_file = os.path.join('std', std.group(0)) - if std_file in includes: - continue - includes.add(std_file) + # TODO: this is FAR too aggressive and catches + # includes and files not part of the standard (C includes) + # and friends. + # we should add a list of standard includes here?? + # or handle behavior differently... + #std = standard_include.search(line) + #if std: + # std_file = os.path.join('std', std.group(0)) + # if std_file in includes: + # continue + # includes.add(std_file) # see if it's an include file name = get_include(line, base_path)