Browse Source

nan.h: define NAN only if not already defined

Clang-19 defines NAN in <float.h>. Check if NAN is already defined to
prevent a compiler warning.

Change-Id: I29ebcb2a7a0c1eade46a73074a1701ea67869128
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
Frank Mehnert 3 months ago
parent
commit
4e53564f45
1 changed files with 3 additions and 1 deletions
  1. 3 1
      libc/sysdeps/linux/common/bits/nan.h

+ 3 - 1
libc/sysdeps/linux/common/bits/nan.h

@@ -25,7 +25,9 @@
 
 #if __GNUC_PREREQ(3,3)
 
-# define NAN	(__builtin_nanf (""))
+# ifndef NAN
+#  define NAN	(__builtin_nanf (""))
+# endif
 
 #elif defined __GNUC__