diff --git a/sol/demangle.hpp b/sol/demangle.hpp index 77de1311..694a2be2 100644 --- a/sol/demangle.hpp +++ b/sol/demangle.hpp @@ -24,6 +24,7 @@ #include #include +#include #if defined(__GNUC__) || defined(__clang__) #include @@ -41,7 +42,7 @@ std::string get_type_name(const std::type_info& id) { int status; char* unmangled = abi::__cxa_demangle(id.name(), 0, 0, &status); std::string realname = unmangled; - free(unmangled); + std::free(unmangled); return realname; }