1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-08-01 12:17:06 +01:00

demangle moves to logging

This commit is contained in:
paboyle
2016-09-26 09:36:51 +01:00
parent 296396646d
commit 567b6cf23f
2 changed files with 17 additions and 1 deletions

View File

@@ -31,8 +31,23 @@ directory
/* END LEGAL */
#include <Grid.h>
#include <cxxabi.h>
namespace Grid {
std::string demangle(const char* name) {
int status = -4; // some arbitrary value to eliminate the compiler warning
// enable c++11 by passing the flag -std=c++11 to g++
std::unique_ptr<char, void(*)(void*)> res {
abi::__cxa_demangle(name, NULL, NULL, &status),
std::free
};
return (status==0) ? res.get() : name ;
}
GridStopWatch Logger::StopWatch;
std::ostream Logger::devnull(0);