lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 26ed20eb 4/6: Get rid of another macro


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 26ed20eb 4/6: Get rid of another macro
Date: Sun, 22 May 2022 11:33:06 -0400 (EDT)

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

    Get rid of another macro
---
 md5.cpp                   | 11 ++++-------
 md5.hpp                   |  5 -----
 test_coding_rules.cpp     |  1 -
 test_coding_rules_test.sh |  2 --
 4 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/md5.cpp b/md5.cpp
index 6324ca1f..0fac6f8c 100644
--- a/md5.cpp
+++ b/md5.cpp
@@ -51,8 +51,7 @@
 
 #include <sys/types.h>
 
-/* GWC: Nullify this condition
- * #if STDC_HEADERS || defined _LIBC
+/* GWC: Suppress code conditional on glibc.
  * The gnu project preserves compatibility with ancient *nix compilers,
  * and doesn't assume conformance even with the 1989 C standard. My
  * preference is standard conformance. The C standard library has no
@@ -73,11 +72,9 @@
 /* GWC: File renamed md5.h --> md5.hpp . */
 #include "md5.hpp"
 
-#if defined _LIBC
-# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-#endif // defined _LIBC
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 
 /* intel x86 is little-endian */
 #if defined WORDS_BIGENDIAN
diff --git a/md5.hpp b/md5.hpp
index f414c01c..53457da9 100644
--- a/md5.hpp
+++ b/md5.hpp
@@ -56,11 +56,6 @@
 extern "C" {
 #endif // defined __cplusplus
 
-/* GWC: Unconditionally assume we have the standard C headers.
- * #if defined HAVE_LIMITS_H || _LIBC
- * # include <limits.h>
- * #endif // defined HAVE_LIMITS_H || _LIBC
- */
 #include <limits.h>
 
 typedef std::uint32_t md5_uint32;
diff --git a/test_coding_rules.cpp b/test_coding_rules.cpp
index 622b69fd..c46b0344 100644
--- a/test_coding_rules.cpp
+++ b/test_coding_rules.cpp
@@ -997,7 +997,6 @@ bool check_reserved_name_exception(std::string const& s)
         ,"_get_output_format"
     // Compiler specific: glibc.
         ,"_GLIBCXX_DEBUG"
-        ,"_LIBC"
     // Compiler specific: EDG; hence, como, and also libcomo.
         ,"__asm"
         ,"__COMO__"
diff --git a/test_coding_rules_test.sh b/test_coding_rules_test.sh
index 41105c5c..62380bd8 100755
--- a/test_coding_rules_test.sh
+++ b/test_coding_rules_test.sh
@@ -276,8 +276,6 @@ EOF
 
 cat >eraseme_cpp_008.cpp <<EOF
 $boilerplate
-#if defined _LIBC // Specifically allowed.
-#endif // defined _LIBC
 #if defined __GNUC__ // Specifically allowed.
 #endif // defined __GNUC__
 int  _Forbidden;



reply via email to

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