From f64ae18ac6621a6e9828bedb9fb6c0a5adb688db Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 19 Oct 2006 01:21:17 +0000 Subject: [PATCH] add endian defines on MSVC git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3088 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/iax/src/md5.c | 12 ++++++++++++ libs/libdingaling/src/sha1.c | 12 ++++++++++++ src/include/switch_platform.h | 10 ++++++++++ 3 files changed, 34 insertions(+) diff --git a/libs/iax/src/md5.c b/libs/iax/src/md5.c index b969ee6324..5863cc4bd8 100644 --- a/libs/iax/src/md5.c +++ b/libs/iax/src/md5.c @@ -23,6 +23,18 @@ # endif #endif +#ifdef _MSC_VER +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN 1234 +#endif +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN 4321 +#endif +#ifndef __BYTE_ORDER +#define __BYTE_ORDER __LITTLE_ENDIAN +#endif +#endif + #if __BYTE_ORDER == __BIG_ENDIAN || BYTE_ORDER == BIG_ENDIAN # define HIGHFIRST 1 #elif __BYTE_ORDER == __LITTLE_ENDIAN || BYTE_ORDER == LITLE_ENDIAN diff --git a/libs/libdingaling/src/sha1.c b/libs/libdingaling/src/sha1.c index 843aedba86..91cd4afecd 100644 --- a/libs/libdingaling/src/sha1.c +++ b/libs/libdingaling/src/sha1.c @@ -54,7 +54,19 @@ A million repetitions of "a" #include #include +#ifdef _MSC_VER +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN 1234 +#endif +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN 4321 +#endif +#ifndef __BYTE_ORDER +#define __BYTE_ORDER __LITTLE_ENDIAN +#endif +#else #include "config.h" +#endif #include "sha1.h" #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) diff --git a/src/include/switch_platform.h b/src/include/switch_platform.h index 2dd6cf3c97..a6e98066f0 100644 --- a/src/include/switch_platform.h +++ b/src/include/switch_platform.h @@ -60,6 +60,16 @@ SWITCH_BEGIN_EXTERN_C */ #pragma warning(disable:4152 4054 4100 4142 4200 4204 4706 4055 4214 4819 4132 4510 4512 4610) +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN 1234 +#endif +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN 4321 +#endif +#ifndef __BYTE_ORDER +#define __BYTE_ORDER __LITTLE_ENDIAN +#endif + #if (_MSC_VER >= 1400) // VC8+ #ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE