Add endian test to autoconf and convert crypt to use it.
This commit is contained in:
parent
6cb47f18b5
commit
d0c759a857
|
@ -40,6 +40,7 @@ AM_MAINTAINER_MODE
|
||||||
AC_ISC_POSIX
|
AC_ISC_POSIX
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
|
AC_C_BIGENDIAN
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PATH_PROG(AUTOMAKE, automake)
|
AC_PATH_PROG(AUTOMAKE, automake)
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
/* include/libratbox_config.h.in. Generated from configure.ac by autoheader. */
|
/* include/libratbox_config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
|
/* Define if building universal (internal helper macro) */
|
||||||
|
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||||
|
|
||||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||||
systems. This function is required for `alloca.c' support on those systems.
|
systems. This function is required for `alloca.c' support on those systems.
|
||||||
*/
|
*/
|
||||||
|
@ -229,9 +232,6 @@
|
||||||
/* Define this to disable debugging support. */
|
/* Define this to disable debugging support. */
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
|
|
||||||
/* Define if your system needs crypt. */
|
|
||||||
#undef NEED_CRYPT
|
|
||||||
|
|
||||||
/* Define to 1 if you wish to disable the block allocator. */
|
/* Define to 1 if you wish to disable the block allocator. */
|
||||||
#undef NOBALLOC
|
#undef NOBALLOC
|
||||||
|
|
||||||
|
@ -310,6 +310,18 @@
|
||||||
/* This is a Windows system */
|
/* This is a Windows system */
|
||||||
#undef WINDOWS
|
#undef WINDOWS
|
||||||
|
|
||||||
|
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||||
|
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||||
|
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||||
|
# if defined __BIG_ENDIAN__
|
||||||
|
# define WORDS_BIGENDIAN 1
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# ifndef WORDS_BIGENDIAN
|
||||||
|
# undef WORDS_BIGENDIAN
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if on MINIX. */
|
/* Define to 1 if on MINIX. */
|
||||||
#undef _MINIX
|
#undef _MINIX
|
||||||
|
|
||||||
|
|
|
@ -779,7 +779,7 @@ static void MD5Init (MD5_CTX *);
|
||||||
static void MD5Update (MD5_CTX *, const void *, unsigned int);
|
static void MD5Update (MD5_CTX *, const void *, unsigned int);
|
||||||
static void MD5Final (unsigned char [16], MD5_CTX *);
|
static void MD5Final (unsigned char [16], MD5_CTX *);
|
||||||
|
|
||||||
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
#ifndef WORDS_BIGENDIAN
|
||||||
#define Encode memcpy
|
#define Encode memcpy
|
||||||
#define Decode memcpy
|
#define Decode memcpy
|
||||||
#else
|
#else
|
||||||
|
@ -1196,7 +1196,7 @@ struct sha256_ctx
|
||||||
char buffer[128]; /* NB: always correctly aligned for uint32_t. */
|
char buffer[128]; /* NB: always correctly aligned for uint32_t. */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
#ifndef WORDS_BIGENDIAN
|
||||||
# define SHA256_SWAP(n) \
|
# define SHA256_SWAP(n) \
|
||||||
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
||||||
#else
|
#else
|
||||||
|
@ -1738,7 +1738,7 @@ struct sha512_ctx
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
#ifndef WORDS_BIGENDIAN
|
||||||
# define SHA512_SWAP(n) \
|
# define SHA512_SWAP(n) \
|
||||||
(((n) << 56) \
|
(((n) << 56) \
|
||||||
| (((n) & 0xff00) << 40) \
|
| (((n) & 0xff00) << 40) \
|
||||||
|
|
Loading…
Reference in New Issue