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

Tento commit je obsažen v:
saleelk
2019-12-23 05:41:40 -08:00
odevzdal Maneesh Gupta
rodič 150e690a3a
revize 1ca75e5f6d
2 změnil soubory, kde provedl 14 přidání a 13 odebrání
+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