lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 697c4e34 1/5: Define endianness macros when u


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 697c4e34 1/5: Define endianness macros when using MSVC to fix building with it
Date: Fri, 3 Jun 2022 09:45:12 -0400 (EDT)

branch: master
commit 697c4e346cc9f402a073ee3345bdb4e5c2e591c1
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Define endianness macros when using MSVC to fix building with it
    
    This compiler doesn't define the standard endianness macros, but it only
    targets little endian platforms, so we can just hard code their
    definitions ourselves to allow building this code with it.
---
 fdlibm.hpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fdlibm.hpp b/fdlibm.hpp
index 28cac313..4c99b1da 100644
--- a/fdlibm.hpp
+++ b/fdlibm.hpp
@@ -51,6 +51,14 @@
 #   endif // !defined __FLOAT_WORD_ORDER__ && defined __BYTE_ORDER__
 #endif // defined __clang__
 
+// 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__
+#endif // defined LMI_MSC
+
 #if !defined __FLOAT_WORD_ORDER__ || \
     !defined __ORDER_BIG_ENDIAN__ || \
     !defined __ORDER_LITTLE_ENDIAN__



reply via email to

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