summaryrefslogtreecommitdiff
path: root/src/classlibnative/float
diff options
context:
space:
mode:
authordotnet-bot <dotnet-bot@microsoft.com>2016-10-20 16:18:59 -0700
committerdotnet-bot <dotnet-bot@microsoft.com>2016-10-20 16:18:59 -0700
commit890e5f93914396ac2cdd502809d15984d2d4db15 (patch)
tree850e0e687aa8c83c5d5926c284fbef64cb4501d6 /src/classlibnative/float
parent347cc35af5e5676ab57ba23a16624a6d6ce002d6 (diff)
downloadcoreclr-890e5f93914396ac2cdd502809d15984d2d4db15.tar.gz
coreclr-890e5f93914396ac2cdd502809d15984d2d4db15.tar.bz2
coreclr-890e5f93914396ac2cdd502809d15984d2d4db15.zip
Updating the macro redefinition for _isnanf and _copysignf in floatsingle.cpp. This is required for the scenario when the system CRT header files are used instead of the newer MSVCRT header files.
[tfs-changeset: 1634419]
Diffstat (limited to 'src/classlibnative/float')
-rw-r--r--src/classlibnative/float/floatsingle.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/classlibnative/float/floatsingle.cpp b/src/classlibnative/float/floatsingle.cpp
index ebae724dbb..7e2ea0adc6 100644
--- a/src/classlibnative/float/floatsingle.cpp
+++ b/src/classlibnative/float/floatsingle.cpp
@@ -11,16 +11,21 @@
#define IS_FLT_INFINITY(x) (((*((INT32*)((void*)&x))) & 0x7FFFFFFF) == 0x7F800000)
-// Windows x86 and Windows ARM don't define _isnanf() but they do define a generic macro isnan()
-#if (defined(_TARGET_X86_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)) && !defined(FEATURE_PAL) && !defined(_isnanf)
-#if defined(_TARGET_ARM64_) || defined(_TARGET_ARM_)
+// Windows x86 and Windows ARM/ARM64 may not define _isnanf() or _copysignf() but they do
+// define _isnan() and _copysign(). We will redirect the macros to these other functions if
+// the macro is not defined for the platform. This has the side effect of a possible implicit
+// upcasting for arguments passed in and an explicit downcasting for the _copysign() call.
+#if (defined(_TARGET_X86_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)) && !defined(FEATURE_PAL)
+
+#if !defined(_isnanf)
#define _isnanf _isnan
-#else
-#define _isnanf isnan
#endif
+
+#if !defined(_copysignf)
+#define _copysignf (float)_copysign
#endif
-#
+#endif
// The default compilation mode is /fp:precise, which disables floating-point intrinsics. This
// default compilation mode has previously caused performance regressions in floating-point code.