From db4871e8437dd0067614b4dfd9183cab3425e836 Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Wed, 7 Jun 2000 01:14:26 +0000 Subject: [PATCH] complain if BYTE_ORDER isn't defined --- lib/isc/md5.c | 10 ++++++++++ lib/isc/sha1.c | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/isc/md5.c b/lib/isc/md5.c index 730198dc21..65e1725a09 100644 --- a/lib/isc/md5.c +++ b/lib/isc/md5.c @@ -41,6 +41,16 @@ #define BIG_ENDIAN __BIG_ENDIAN #endif +#if !defined(BYTE_ORDER) || \ + (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN) + /* you must determine what the correct bit order is for + * your compiler - the next line is an intentional error + * which will force your compiles to bomb until you fix + * the above macros. + */ +#error "Undefined or invalid BYTE_ORDER"; +#endif + #if BYTE_ORDER == LITTLE_ENDIAN static void byteSwap(isc_uint32_t *buf, unsigned words) diff --git a/lib/isc/sha1.c b/lib/isc/sha1.c index 53f9a5d67c..7a1a276e79 100644 --- a/lib/isc/sha1.c +++ b/lib/isc/sha1.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: sha1.c,v 1.3 2000/06/07 00:49:01 explorer Exp $ */ +/* $Id: sha1.c,v 1.4 2000/06/07 01:14:26 explorer Exp $ */ /* $NetBSD: sha1.c,v 1.5 2000/01/22 22:19:14 mycroft Exp $ */ /* $OpenBSD: sha1.c,v 1.9 1997/07/23 21:12:32 kstailey Exp $ */ @@ -54,6 +54,16 @@ #define BIG_ENDIAN __BIG_ENDIAN #endif +#if !defined(BYTE_ORDER) || \ + (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN) + /* you must determine what the correct bit order is for + * your compiler - the next line is an intentional error + * which will force your compiles to bomb until you fix + * the above macros. + */ +#error "Undefined or invalid BYTE_ORDER"; +#endif + #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /*