lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master adc03db3 2/6: Replace a macro with an equival


From: Greg Chicares
Subject: [lmi-commits] [lmi] master adc03db3 2/6: Replace a macro with an equivalent predefined by gcc
Date: Sun, 22 May 2022 11:33:05 -0400 (EDT)

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

    Replace a macro with an equivalent predefined by gcc
    
    This change made inclusion of <endian.h> unnecessary. See:
      https://lists.nongnu.org/archive/html/lmi/2022-05/msg00031.html
---
 md5.cpp               | 7 +++----
 test_coding_rules.cpp | 1 -
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/md5.cpp b/md5.cpp
index 2f39b35d..7807acbc 100644
--- a/md5.cpp
+++ b/md5.cpp
@@ -74,13 +74,12 @@
 #include "md5.hpp"
 
 #if defined _LIBC
-# include <endian.h>
-# if __BYTE_ORDER == __BIG_ENDIAN
+# if __BYTE_ORDER__ == __BIG_ENDIAN
 #  define WORDS_BIGENDIAN 1
-# endif // __BYTE_ORDER == __BIG_ENDIAN
+# endif // __BYTE_ORDER__ == __BIG_ENDIAN
 #endif // defined _LIBC
 
-/* intel x86 is litte-endian */
+/* intel x86 is little-endian */
 #if defined WORDS_BIGENDIAN
 # define SWAP(n)                            \
     (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
diff --git a/test_coding_rules.cpp b/test_coding_rules.cpp
index 37303b52..fc17b618 100644
--- a/test_coding_rules.cpp
+++ b/test_coding_rules.cpp
@@ -999,7 +999,6 @@ bool check_reserved_name_exception(std::string const& s)
         ,"_GLIBCXX_DEBUG"
         ,"_LIBC"
         ,"__BIG_ENDIAN"
-        ,"__BYTE_ORDER"
         ,"__FLOAT_WORD_ORDER"
         ,"__LITTLE_ENDIAN"
     // Compiler specific: EDG; hence, como, and also libcomo.



reply via email to

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