31 |
#include <assert.h> |
#include <assert.h> |
32 |
#include <string.h> // for memcpy() |
#include <string.h> // for memcpy() |
33 |
#include <stdlib.h> // for atof() |
#include <stdlib.h> // for atof() |
34 |
#include <cxxabi.h> |
#ifdef _MSC_VER |
35 |
|
# include <windows.h> |
36 |
|
# include <dbghelp.h> |
37 |
|
#else |
38 |
|
# include <cxxabi.h> |
39 |
|
#endif |
40 |
#include "helper.h" |
#include "helper.h" |
41 |
|
|
42 |
#define LIBGIG_EPOCH_TIME ((time_t)0) |
#define LIBGIG_EPOCH_TIME ((time_t)0) |
407 |
*/ |
*/ |
408 |
String DataType::customTypeName(bool demangle) const { |
String DataType::customTypeName(bool demangle) const { |
409 |
if (!demangle) return m_customTypeName; |
if (!demangle) return m_customTypeName; |
410 |
|
#ifdef _MSC_VER |
411 |
|
const size_t MAXLENGTH = 1024; |
412 |
|
char result[MAXLENGTH]; |
413 |
|
|
414 |
|
//Skip the first char |
415 |
|
size_t size = UnDecorateSymbolName(m_customTypeName.c_str() +1, result, MAXLENGTH, UNDNAME_32_BIT_DECODE | UNDNAME_NO_ARGUMENTS); |
416 |
|
if (size) |
417 |
|
{ |
418 |
|
return result; |
419 |
|
} |
420 |
|
return m_customTypeName; |
421 |
|
#else |
422 |
int status; |
int status; |
423 |
char* result = |
char* result = |
424 |
abi::__cxa_demangle(m_customTypeName.c_str(), 0, 0, &status); |
abi::__cxa_demangle(m_customTypeName.c_str(), 0, 0, &status); |
425 |
String sResult = result; |
String sResult = result; |
426 |
free(result); |
free(result); |
427 |
return (status == 0) ? sResult : m_customTypeName; |
return (status == 0) ? sResult : m_customTypeName; |
428 |
|
#endif |
429 |
} |
} |
430 |
|
|
431 |
// *************** Member *************** |
// *************** Member *************** |