diff --git a/sol/state_handling.hpp b/sol/state_handling.hpp index bb0922f8..66cc515e 100644 --- a/sol/state_handling.hpp +++ b/sol/state_handling.hpp @@ -29,7 +29,7 @@ #include "function.hpp" #include "object.hpp" -#ifdef SOL_PRINT_ERRORS +#if defined(SOL_PRINT_ERRORS) && SOL_PRINT_ERRORS #include #endif diff --git a/sol/trampoline.hpp b/sol/trampoline.hpp index 4041349d..cf1fe823 100644 --- a/sol/trampoline.hpp +++ b/sol/trampoline.hpp @@ -29,7 +29,7 @@ #include #include -#ifdef SOL_PRINT_ERRORS +#if defined(SOL_PRINT_ERRORS) && SOL_PRINT_ERRORS #include #endif @@ -47,7 +47,7 @@ namespace sol { // must push at least 1 object on the stack inline int default_exception_handler(lua_State* L, optional, string_view what) { -#ifdef SOL_PRINT_ERRORS +#if defined(SOL_PRINT_ERRORS) && SOL_PRINT_ERRORS std::cerr << "[sol2] An exception occurred: "; std::cerr.write(what.data(), what.size()); std::cerr << std::endl;