From 7c4424531ff0dbe6958d6dd8beaeb978d3a6ebdb Mon Sep 17 00:00:00 2001 From: Matt Little Date: Thu, 25 Jan 2018 13:00:45 -0700 Subject: Support building cncrypto lib with msvc --- src/common/int-util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/common') diff --git a/src/common/int-util.h b/src/common/int-util.h index 7cec571ad..dcf28d38a 100644 --- a/src/common/int-util.h +++ b/src/common/int-util.h @@ -34,7 +34,10 @@ #include #include #include + +#ifndef _MSC_VER #include +#endif #if defined(__ANDROID__) #include @@ -206,6 +209,12 @@ static inline void memcpy_swap64(void *dst, const void *src, size_t n) { } } +#if _MSC_VER +# define LITTLE_ENDIAN 1234 +# define BIG_ENDIAN 4321 +# define BYTE_ORDER LITTLE_ENDIAN +#endif + #if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) || !defined(BIG_ENDIAN) static_assert(false, "BYTE_ORDER is undefined. Perhaps, GNU extensions are not enabled"); #endif -- cgit v1.2.3 From 1dfed567e24dab9002af0e87f8005dd809d2b944 Mon Sep 17 00:00:00 2001 From: Matt Little Date: Sat, 27 Jan 2018 13:33:11 -0700 Subject: Fixed #if instead of #ifdef --- src/common/int-util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common') diff --git a/src/common/int-util.h b/src/common/int-util.h index dcf28d38a..6207997fe 100644 --- a/src/common/int-util.h +++ b/src/common/int-util.h @@ -209,9 +209,9 @@ static inline void memcpy_swap64(void *dst, const void *src, size_t n) { } } -#if _MSC_VER -# define LITTLE_ENDIAN 1234 -# define BIG_ENDIAN 4321 +#ifdef _MSC_VER +# define LITTLE_ENDIAN 1234 +# define BIG_ENDIAN 4321 # define BYTE_ORDER LITTLE_ENDIAN #endif -- cgit v1.2.3