diff options
Diffstat (limited to 'devel/intel-graphics-compiler/files/patch-strerror_r')
-rw-r--r-- | devel/intel-graphics-compiler/files/patch-strerror_r | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/devel/intel-graphics-compiler/files/patch-strerror_r b/devel/intel-graphics-compiler/files/patch-strerror_r new file mode 100644 index 000000000000..d5996876448f --- /dev/null +++ b/devel/intel-graphics-compiler/files/patch-strerror_r @@ -0,0 +1,23 @@ +POSIX version of strerror_r returns int + +visa/iga/IGALibrary/system.cpp:263:14: error: assigning to 'char *' from incompatible type 'int' + errMsg = strerror_r(errCode, buf, sizeof(buf)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +--- visa/iga/IGALibrary/system.cpp.orig 2021-09-11 19:03:27 UTC ++++ visa/iga/IGALibrary/system.cpp +@@ -259,8 +259,13 @@ std::string iga::FormatLastError(unsigned errCode) + NULL); + if (errMsg) + msg = errMsg; +-#else ++#elif defined(__GLIBC__) + errMsg = strerror_r(errCode, buf, sizeof(buf)); ++#else ++ if (strerror_r(errCode, buf, sizeof(buf))) ++ errMsg = nullptr; ++ else ++ errMsg = buf; + #endif // _WIN32 + if (errMsg == nullptr || errMsg[0] == 0) + return "???"; |