Prefix *_ENDIAN macros with RADIUS_
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Wed, 1 Oct 2014 12:11:12 +0000 (15:11 +0300)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 1 Oct 2014 16:04:53 +0000 (12:04 -0400)
Rename LITTLE_ENDIAN and BIG_ENDIAN macros to RADIUS_LITTLE_ENDIAN and
RADIUS_BIG_ENDIAN respectively to avoid clashes with
/usr/include/endian.h defines, which result in always assuming
little-endian architecture.

configure
configure.ac
src/include/autoconf.h.in
src/include/build.h
src/include/missing-h
src/lib/missing.c
src/main/version.c

index f15072d..1b54efd 100755 (executable)
--- a/configure
+++ b/configure
@@ -4771,11 +4771,11 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
  case $ac_cv_c_bigendian in #(
    yes)
 
-$as_echo "#define BIG_ENDIAN 1" >>confdefs.h
+$as_echo "#define RADIUS_BIG_ENDIAN 1" >>confdefs.h
 ;; #(
    no)
 
-$as_echo "#define LITTLE_ENDIAN 1" >>confdefs.h
+$as_echo "#define RADIUS_LITTLE_ENDIAN 1" >>confdefs.h
 
  ;; #(
    universal)
index 76466ec..30b226b 100644 (file)
@@ -167,8 +167,8 @@ dnl #  check for system bytesex
 dnl #  AC_DEFINES WORDS_BIGENDIAN
 dnl #
 AC_C_BIGENDIAN(
-  [AC_DEFINE(BIG_ENDIAN, 1, [Define if your processor stores words with the most significant byte first])],
-  [AC_DEFINE(LITTLE_ENDIAN, 1, [Define if your processor stores words with the least significant byte first])]
+  [AC_DEFINE(RADIUS_BIG_ENDIAN, 1, [Define if your processor stores words with the most significant byte first])],
+  [AC_DEFINE(RADIUS_LITTLE_ENDIAN, 1, [Define if your processor stores words with the least significant byte first])]
 )
 
 dnl #
index 6e6e355..c313bca 100644 (file)
@@ -3,10 +3,6 @@
 /* Define if building universal (internal helper macro) */
 #undef AC_APPLE_UNIVERSAL_BUILD
 
-/* Define if your processor stores words with the most significant byte first
-   */
-#undef BIG_ENDIAN
-
 /* BSD-Style get*byaddr_r */
 #undef BSDSTYLE
 
 /* compiler specific 128 bit unsigned integer */
 #undef HAVE___UINT128_T
 
-/* Define if your processor stores words with the least significant byte first
-   */
-#undef LITTLE_ENDIAN
-
 /* define if you have OSFC2 authentication */
 #undef OSFC2
 
 /* Raw version string from VERSION file */
 #undef RADIUSD_VERSION_STRING
 
+/* Define if your processor stores words with the most significant byte first
+   */
+#undef RADIUS_BIG_ENDIAN
+
+/* Define if your processor stores words with the least significant byte first
+   */
+#undef RADIUS_LITTLE_ENDIAN
+
 /* Define as the return type of signal handlers (`int' or `void'). */
 #undef RETSIGTYPE
 
index 66c3087..4c1bf1a 100644 (file)
@@ -105,13 +105,13 @@ extern "C" {
  *     Here at least the endianess can be set explicitly with
  *     -DLITTLE_ENDIAN or -DBIG_ENDIAN.
  */
-#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)
+#if !defined(RADIUS_LITTLE_ENDIAN) && !defined(RADIUS_BIG_ENDIAN)
 #  if defined(__LITTLE_ENDIAN__) || \
       (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
-#    define LITTLE_ENDIAN 1
+#    define RADIUS_LITTLE_ENDIAN 1
 #  elif defined(__BIG_ENDIAN__) || \
       (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
-#    define BIG_ENDIAN 1
+#    define RADIUS_BIG_ENDIAN 1
 #  else
 #    error Failed determining endianness of system
 #  endif
index 3f286a4..7136172 100644 (file)
@@ -424,7 +424,7 @@ typedef struct int128_t { uint8_t v[16]; } int128_t;
 
 /* abcd efgh -> dcba hgfe -> hgfe dcba */
 #ifndef HAVE_HTON_LL
-#  ifdef LITTLE_ENDIAN
+#  ifdef RADIUS_LITTLE_ENDIAN
 #    ifdef HAVE_BUILTIN_BSWAP64
 #      define ntohll(x) __builtin_bswap64(x)
 #    else
@@ -437,7 +437,7 @@ typedef struct int128_t { uint8_t v[16]; } int128_t;
 #endif
 
 #ifndef HAVE_HTON_LLL
-#  ifdef LITTLE_ENDIAN
+#  ifdef RADIUS_LITTLE_ENDIAN
 #    ifdef HAVE_128BIT_INTEGERS
 #      define ntohlll(x) (((uint128_t)ntohll((uint64_t)(x >> 64))) | (((uint128_t)ntohll(((uint64_t) x)) << 64)))
 #    else
index 4598c8f..efd5461 100644 (file)
@@ -273,7 +273,7 @@ ntp2timeval(struct timeval *tv, char const *ntp)
        tv->tv_usec = usec / 4295; /* close enough */
 }
 
-#if !defined(HAVE_128BIT_INTEGERS) && defined(LITTLE_ENDIAN)
+#if !defined(HAVE_128BIT_INTEGERS) && defined(RADIUS_LITTLE_ENDIAN)
 /** Swap byte order of 128 bit integer
  *
  * @param num 128bit integer to swap.
index 0aba383..8b56ffa 100644 (file)
@@ -276,9 +276,9 @@ void version(void)
        DEBUG3("  0x%llx", (unsigned long long) libmagic);
 
        DEBUG3("Endianess:");
-#if defined(LITTLE_ENDIAN)
+#if defined(RADIUS_LITTLE_ENDIAN)
        DEBUG3("  little");
-#elif defined(BIG_ENDIAN)
+#elif defined(RADIUS_BIG_ENDIAN)
        DEBUG3("  big");
 #else
        DEBUG3("  unknown");