Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ffcbd7e

Browse files
saleelkGerrit Code Review
authored andcommitted
Merge "Fix P4 linux make builds" into amd-master-next
2 parents edce444 + aa04b96 commit ffcbd7e

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

vdi/hip_rtc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ char* demangle(const char* loweredName) {
105105
if (!loweredName) {
106106
return nullptr;
107107
}
108-
#if HIPRTC_USE_CXXABI || __linux__
108+
#if __linux__
109109
int status = 0;
110-
char* demangledName = abi::__cxa_demangle(loweredName, nullptr, nullptr, &status);
110+
char* demangledName = DEMANGLE(loweredName, nullptr, nullptr, &status);
111111
if (status != 0) {
112112
return nullptr;
113113
}
@@ -122,7 +122,7 @@ char* demangle(const char* loweredName) {
122122
}
123123
#else
124124
#error "Only Linux and Windows are supported"
125-
#endif // HIPRTC_USE_CXXABI || __linux__
125+
#endif // __linux__
126126
return demangledName;
127127
}
128128

vdi/hiprtc_internal.hpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,28 @@
2323

2424
#include "hip_internal.hpp"
2525

26-
#if HIPRTC_USE_CXXABI || __linux__
27-
#include <cxxabi.h>
26+
#if __linux__
2827
#include <cstdlib>
2928

29+
#if HIPRTC_USE_CXXABI
30+
#include <cxxabi.h>
31+
32+
#define DEMANGLE abi::__cxa_demangle
33+
34+
#else
35+
extern "C" char * __cxa_demangle(const char *mangled_name, char *output_buffer,
36+
size_t *length, int *status);
37+
38+
#define DEMANGLE __cxa_demangle
39+
#endif //HIPRTC_USE_CXXABI
40+
3041
#elif defined(_WIN32)
3142
#include <Windows.h>
3243
#include <DbgHelp.h>
3344

3445
#define UNDECORATED_SIZE 4096
3546

36-
#endif // HIPRTC_USE_CXXABI || __linux__
47+
#endif // __linux__
3748

3849
// This macro should be called at the beginning of every HIP RTC API.
3950
#define HIPRTC_INIT_API(...) \

0 commit comments

Comments
 (0)