Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/libcxxrt/typeinfo.cc
Show All 29 Lines | |||||
#include <stdio.h> | #include <stdio.h> | ||||
using std::type_info; | using std::type_info; | ||||
type_info::~type_info() {} | type_info::~type_info() {} | ||||
bool type_info::operator==(const type_info &other) const | bool type_info::operator==(const type_info &other) const | ||||
{ | { | ||||
#ifdef LIBCXXRT_MERGED_TYPEINFO | #ifdef LIBCXXRT_MERGED_TYPEINFO | ||||
return __type_name == other.__type_name; | return __type_name == other.__type_name; | ||||
#else | #else | ||||
return __type_name == other.__type_name || strcmp(__type_name, other.__type_name) == 0; | return __type_name == other.__type_name || strcmp(__type_name, other.__type_name) == 0; | ||||
#endif | #endif | ||||
} | } | ||||
bool type_info::operator!=(const type_info &other) const | bool type_info::operator!=(const type_info &other) const | ||||
{ | { | ||||
return !operator==(other); | return !operator==(other); | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | if (buf == NULL) | ||||
if (n) | if (n) | ||||
{ | { | ||||
*n = len; | *n = len; | ||||
} | } | ||||
return demangled; | return demangled; | ||||
} | } | ||||
if (*n < len+1) | if (*n < len+1) | ||||
{ | { | ||||
buf = (char*)realloc(buf, len+1); | buf = static_cast<char*>(realloc(buf, len+1)); | ||||
} | } | ||||
if (0 != buf) | if (0 != buf) | ||||
{ | { | ||||
memcpy(buf, demangled, len); | memcpy(buf, demangled, len); | ||||
buf[len] = 0; | buf[len] = 0; | ||||
if (n) | if (n) | ||||
{ | { | ||||
*n = len; | *n = len; | ||||
Show All 25 Lines |