From bda4d20a5836c20da0a161b3e24bee767379dbb8 Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 10 Sep 2018 15:02:41 -0400
Subject: [PATCH] P4 to Git Change 1603686 by lmoriche@lmoriche_opencl_dev2 on
2018/09/10 14:36:15
SWDEV-1 - Cleanups required to build with gcc-5.4
- Fix the Windows build
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprintf.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprintf.hpp#5 edit
---
rocclr/runtime/device/pal/palprintf.cpp | 4 ++--
rocclr/runtime/device/pal/palprintf.hpp | 8 ++++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/rocclr/runtime/device/pal/palprintf.cpp b/rocclr/runtime/device/pal/palprintf.cpp
index c1b761f65e..7268a65747 100644
--- a/rocclr/runtime/device/pal/palprintf.cpp
+++ b/rocclr/runtime/device/pal/palprintf.cpp
@@ -275,13 +275,13 @@ size_t PrintfDbg::outputArgument(const std::string& fmt, bool printFloat, size_t
}
float fArg = *(reinterpret_cast(argument));
float fSign = copysign(1.0, fArg);
- if (std::isinf(fArg) && !std::isnan(fArg)) {
+ if (isinf(fArg) && !isnan(fArg)) {
if (fSign < 0) {
amd::Os::printf(fmtF.data(), "-infinity");
} else {
amd::Os::printf(fmtF.data(), "infinity");
}
- } else if (std::isnan(fArg)) {
+ } else if (isnan(fArg)) {
if (fSign < 0) {
amd::Os::printf(fmtF.data(), "-nan");
} else {
diff --git a/rocclr/runtime/device/pal/palprintf.hpp b/rocclr/runtime/device/pal/palprintf.hpp
index 964dc524ea..edb8077161 100644
--- a/rocclr/runtime/device/pal/palprintf.hpp
+++ b/rocclr/runtime/device/pal/palprintf.hpp
@@ -11,13 +11,17 @@
#ifndef isinf
#ifdef _MSC_VER
#define isinf(X) (!_finite(X) && !_isnan(X))
-#endif //_MSC_VER
+#else //!_MSC_VER
+#define isinf(X) (std::isinf(X))
+#endif //!_MSC_VER
#endif // isinf
#ifndef isnan
#ifdef _MSC_VER
#define isnan(X) (_isnan(X))
-#endif //_MSC_VER
+#else //!_MSC_VER
+#define isnan(X) (std::isnan(X))
+#endif //!_MSC_VER
#endif // isnan
#ifndef copysign