lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master d7249cec 1/8: Test whether macros were alread


From: Greg Chicares
Subject: [lmi-commits] [lmi] master d7249cec 1/8: Test whether macros were already defined
Date: Mon, 6 Jun 2022 18:40:33 -0400 (EDT)

branch: master
commit d7249cec76f1653ff62b16dc0d75c80d56970e32
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Test whether macros were already defined
    
    The assumption is that these macros are not already defined.
    Added a condition to test whether that assumption was correct.
    Even though no header other than 'config.hpp' has been included,
    conceivably that header might someday define one or more of them.
---
 fdlibm.hpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/fdlibm.hpp b/fdlibm.hpp
index 64f5d4e7..89c61588 100644
--- a/fdlibm.hpp
+++ b/fdlibm.hpp
@@ -54,9 +54,13 @@
 // And MSVC maintainers don't believe in having different endianness
 // values at all, so the compiler never predefines these symbols.
 #if defined LMI_MSC
-#   define __ORDER_BIG_ENDIAN__ 4321
-#   define __ORDER_LITTLE_ENDIAN__ 1234
-#   define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
+#   if !defined __ORDER_BIG_ENDIAN__ \
+    && !defined __ORDER_LITTLE_ENDIAN__ \
+    && !defined __FLOAT_WORD_ORDER__
+#       define __ORDER_BIG_ENDIAN__ 4321
+#       define __ORDER_LITTLE_ENDIAN__ 1234
+#       define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
+#   endif // none of those macros were defined
 #endif // defined LMI_MSC
 
 #if !defined __FLOAT_WORD_ORDER__ || \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]