From acf2b39680257539be054b863f0a1951b527a4fc Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Fri, 23 Apr 2021 20:06:48 +0200 Subject: [PATCH] Fix cross-platform archiving This is a non-backward compatible change for archives on Windows! --- libsrc/core/utils.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libsrc/core/utils.cpp b/libsrc/core/utils.cpp index bf355bc1..cfa3fef8 100644 --- a/libsrc/core/utils.cpp +++ b/libsrc/core/utils.cpp @@ -13,7 +13,15 @@ namespace ngcore #ifdef WIN32 // windows does demangling in typeid(T).name() - NGCORE_API std::string Demangle(const char* typeinfo) { return typeinfo; } + NGCORE_API std::string Demangle(const char* typeinfo) { + std::string name = typeinfo; + // remove "class " and "struct " at beginning of type names to be consistent with demangled names of gcc/clang + if(name.find("class ") == 0) + name.erase(0,6); + if(name.find("struct ") == 0) + name.erase(0,7); + return name; + } #else NGCORE_API std::string Demangle(const char* typeinfo) {