[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__ || \
- [lmi-commits] [lmi] master updated (a0472892 -> 9be3fe4e), Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 43c26210 2/8: Make a unit test more thorough, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 9be3fe4e 8/8: Update dotfiles, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 4d1b7487 3/8: Improve a local name, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master d7249cec 1/8: Test whether macros were already defined,
Greg Chicares <=
- [lmi-commits] [lmi] master 8f25a9bd 5/8: Resolve an issue identified by UBSAN, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master fe203b1e 4/8: Use undefined-behavior sanitizer, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master cc85be94 6/8: Resolve another issue identified by UBSAN, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 7ae73fae 7/8: Localize an 'f2c' global, Greg Chicares, 2022/06/06