Blame SOURCES/freeradius-prefix-endian-macros.patch

75e927
From 4a906c702ac31da5977eba6698fa5435474cb47f Mon Sep 17 00:00:00 2001
75e927
From: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
75e927
Date: Wed, 1 Oct 2014 15:11:12 +0300
75e927
Subject: [PATCH 3/4] Prefix *_ENDIAN macros with RADIUS_
75e927
75e927
Rename LITTLE_ENDIAN and BIG_ENDIAN macros to RADIUS_LITTLE_ENDIAN and
75e927
RADIUS_BIG_ENDIAN respectively to avoid clashes with
75e927
/usr/include/endian.h defines, which result in always assuming
75e927
little-endian architecture.
75e927
---
75e927
 configure                 |  4 ++--
75e927
 configure.ac              |  4 ++--
75e927
 src/include/autoconf.h.in | 16 ++++++++--------
75e927
 src/include/build.h       |  6 +++---
75e927
 src/include/missing-h     |  4 ++--
75e927
 src/lib/missing.c         |  2 +-
75e927
 src/main/version.c        |  4 ++--
75e927
 7 files changed, 20 insertions(+), 20 deletions(-)
75e927
75e927
diff --git a/configure b/configure
75e927
index f15072d..1b54efd 100755
75e927
--- a/configure
75e927
+++ b/configure
75e927
@@ -4771,11 +4771,11 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
75e927
  case $ac_cv_c_bigendian in #(
75e927
    yes)
75e927
 
75e927
-$as_echo "#define BIG_ENDIAN 1" >>confdefs.h
75e927
+$as_echo "#define RADIUS_BIG_ENDIAN 1" >>confdefs.h
75e927
 ;; #(
75e927
    no)
75e927
 
75e927
-$as_echo "#define LITTLE_ENDIAN 1" >>confdefs.h
75e927
+$as_echo "#define RADIUS_LITTLE_ENDIAN 1" >>confdefs.h
75e927
 
75e927
  ;; #(
75e927
    universal)
75e927
diff --git a/configure.ac b/configure.ac
75e927
index 76466ec..30b226b 100644
75e927
--- a/configure.ac
75e927
+++ b/configure.ac
75e927
@@ -167,8 +167,8 @@ dnl #  check for system bytesex
75e927
 dnl #  AC_DEFINES WORDS_BIGENDIAN
75e927
 dnl #
75e927
 AC_C_BIGENDIAN(
75e927
-  [AC_DEFINE(BIG_ENDIAN, 1, [Define if your processor stores words with the most significant byte first])],
75e927
-  [AC_DEFINE(LITTLE_ENDIAN, 1, [Define if your processor stores words with the least significant byte first])]
75e927
+  [AC_DEFINE(RADIUS_BIG_ENDIAN, 1, [Define if your processor stores words with the most significant byte first])],
75e927
+  [AC_DEFINE(RADIUS_LITTLE_ENDIAN, 1, [Define if your processor stores words with the least significant byte first])]
75e927
 )
75e927
 
75e927
 dnl #
75e927
diff --git a/src/include/autoconf.h.in b/src/include/autoconf.h.in
75e927
index 6e6e355..c313bca 100644
75e927
--- a/src/include/autoconf.h.in
75e927
+++ b/src/include/autoconf.h.in
75e927
@@ -3,10 +3,6 @@
75e927
 /* Define if building universal (internal helper macro) */
75e927
 #undef AC_APPLE_UNIVERSAL_BUILD
75e927
 
75e927
-/* Define if your processor stores words with the most significant byte first
75e927
-   */
75e927
-#undef BIG_ENDIAN
75e927
-
75e927
 /* BSD-Style get*byaddr_r */
75e927
 #undef BSDSTYLE
75e927
 
75e927
@@ -443,10 +439,6 @@
75e927
 /* compiler specific 128 bit unsigned integer */
75e927
 #undef HAVE___UINT128_T
75e927
 
75e927
-/* Define if your processor stores words with the least significant byte first
75e927
-   */
75e927
-#undef LITTLE_ENDIAN
75e927
-
75e927
 /* define if you have OSFC2 authentication */
75e927
 #undef OSFC2
75e927
 
75e927
@@ -483,6 +475,14 @@
75e927
 /* Raw version string from VERSION file */
75e927
 #undef RADIUSD_VERSION_STRING
75e927
 
75e927
+/* Define if your processor stores words with the most significant byte first
75e927
+   */
75e927
+#undef RADIUS_BIG_ENDIAN
75e927
+
75e927
+/* Define if your processor stores words with the least significant byte first
75e927
+   */
75e927
+#undef RADIUS_LITTLE_ENDIAN
75e927
+
75e927
 /* Define as the return type of signal handlers (`int' or `void'). */
75e927
 #undef RETSIGTYPE
75e927
 
75e927
diff --git a/src/include/build.h b/src/include/build.h
75e927
index 66c3087..4c1bf1a 100644
75e927
--- a/src/include/build.h
75e927
+++ b/src/include/build.h
75e927
@@ -105,13 +105,13 @@ extern "C" {
75e927
  *	Here at least the endianess can be set explicitly with
75e927
  *	-DLITTLE_ENDIAN or -DBIG_ENDIAN.
75e927
  */
75e927
-#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)
75e927
+#if !defined(RADIUS_LITTLE_ENDIAN) && !defined(RADIUS_BIG_ENDIAN)
75e927
 #  if defined(__LITTLE_ENDIAN__) || \
75e927
       (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
75e927
-#    define LITTLE_ENDIAN 1
75e927
+#    define RADIUS_LITTLE_ENDIAN 1
75e927
 #  elif defined(__BIG_ENDIAN__) || \
75e927
       (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
75e927
-#    define BIG_ENDIAN 1
75e927
+#    define RADIUS_BIG_ENDIAN 1
75e927
 #  else
75e927
 #    error Failed determining endianness of system
75e927
 #  endif
75e927
diff --git a/src/include/missing-h b/src/include/missing-h
75e927
index 3f286a4..7136172 100644
75e927
--- a/src/include/missing-h
75e927
+++ b/src/include/missing-h
75e927
@@ -424,7 +424,7 @@ typedef struct int128_t { uint8_t v[16]; } int128_t;
75e927
 
75e927
 /* abcd efgh -> dcba hgfe -> hgfe dcba */
75e927
 #ifndef HAVE_HTON_LL
75e927
-#  ifdef LITTLE_ENDIAN
75e927
+#  ifdef RADIUS_LITTLE_ENDIAN
75e927
 #    ifdef HAVE_BUILTIN_BSWAP64
75e927
 #      define ntohll(x) __builtin_bswap64(x)
75e927
 #    else
75e927
@@ -437,7 +437,7 @@ typedef struct int128_t { uint8_t v[16]; } int128_t;
75e927
 #endif
75e927
 
75e927
 #ifndef HAVE_HTON_LLL
75e927
-#  ifdef LITTLE_ENDIAN
75e927
+#  ifdef RADIUS_LITTLE_ENDIAN
75e927
 #    ifdef HAVE_128BIT_INTEGERS
75e927
 #      define ntohlll(x) (((uint128_t)ntohll((uint64_t)(x >> 64))) | (((uint128_t)ntohll(((uint64_t) x)) << 64)))
75e927
 #    else
75e927
diff --git a/src/lib/missing.c b/src/lib/missing.c
75e927
index 4598c8f..efd5461 100644
75e927
--- a/src/lib/missing.c
75e927
+++ b/src/lib/missing.c
75e927
@@ -273,7 +273,7 @@ ntp2timeval(struct timeval *tv, char const *ntp)
75e927
 	tv->tv_usec = usec / 4295; /* close enough */
75e927
 }
75e927
 
75e927
-#if !defined(HAVE_128BIT_INTEGERS) && defined(LITTLE_ENDIAN)
75e927
+#if !defined(HAVE_128BIT_INTEGERS) && defined(RADIUS_LITTLE_ENDIAN)
75e927
 /** Swap byte order of 128 bit integer
75e927
  *
75e927
  * @param num 128bit integer to swap.
75e927
diff --git a/src/main/version.c b/src/main/version.c
75e927
index 0aba383..8b56ffa 100644
75e927
--- a/src/main/version.c
75e927
+++ b/src/main/version.c
75e927
@@ -276,9 +276,9 @@ void version(void)
75e927
 	DEBUG3("  0x%llx", (unsigned long long) libmagic);
75e927
 
75e927
 	DEBUG3("Endianess:");
75e927
-#if defined(LITTLE_ENDIAN)
75e927
+#if defined(RADIUS_LITTLE_ENDIAN)
75e927
 	DEBUG3("  little");
75e927
-#elif defined(BIG_ENDIAN)
75e927
+#elif defined(RADIUS_BIG_ENDIAN)
75e927
 	DEBUG3("  big");
75e927
 #else
75e927
 	DEBUG3("  unknown");
75e927
-- 
75e927
2.1.0
75e927