Fix the return type of demangle function so that its compatible across ABIs (#1744)

Tento commit je obsažen v:
saleelk authored and Maneesh Gupta committed 2019-12-23 19:11:40 +05:30
1 rodič 150e690a3a
revize 1ca75e5f6d
2 files changed
+14 -13

No files matched your search

+5 -4
Zobrazit soubor
@@ -84,7 +84,7 @@ hiprtcResult hiprtcGetCodeSize(hiprtcProgram prog, std::size_t* codeSizeRet);
namespace hip_impl
{
std::string demangle(const char* mangled_expression);
char* demangle(const char* mangled_expression);
}
#if defined(HIPRTC_GET_TYPE_NAME)
@@ -102,10 +102,11 @@ namespace hip_impl
{
if (!result) return HIPRTC_ERROR_INVALID_INPUT;
*result = hip_impl::demangle(typeid(T).name());
char * res= hip_impl::demangle(typeid(T).name());
result->assign(res == nullptr ? "" : res);
std::free(res);
return (result->empty()) ? HIPRTC_ERROR_INTERNAL_ERROR :
HIPRTC_SUCCESS;
}
#endif
#endif
#endif