Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-08-13 14:40:23 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-13 14:40:23 +0400
commit5096beb4a56f601c696aeab5e19c8e171a9b6cb3 (patch)
tree29e53305dc307fbbeb8e652ba3d51cfd3b496a64 /source/blender/blenlib/BLI_math_base.h
parenta8d1c893e8cea727d24f0bd8c64732fadcbcbcf2 (diff)
use __builtin_nanf with gcc and clang.
Diffstat (limited to 'source/blender/blenlib/BLI_math_base.h')
-rw-r--r--source/blender/blenlib/BLI_math_base.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h
index 8e8a7f1fef6..69dbd3253f0 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -80,9 +80,13 @@
#define MAXFLOAT ((float)3.40282347e+38)
#endif
+#if defined(__GNUC__)
+# define NAN_FLT __builtin_nanf("")
+#else
/* evil quiet NaN definition */
static const int NAN_INT = 0x7FC00000;
-#define NAN_FLT *((float *)(&NAN_INT))
+# define NAN_FLT (*((float *)(&NAN_INT)))
+#endif
/* do not redefine functions from C99 or POSIX.1-2001 */
#if !(defined(_ISOC99_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L))