Merge pull request #3180

1dfed567 Fixed #if instead of #ifdef (Matt Little)
7c442453 Support building cncrypto lib with msvc (Matt Little)
This commit is contained in:
Riccardo Spagni 2018-02-16 14:19:42 +01:00
commit ba22928d4b
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
4 changed files with 24 additions and 5 deletions

View file

@ -34,7 +34,10 @@
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#ifndef _MSC_VER
#include <sys/param.h>
#endif
#if defined(__ANDROID__)
#include <byteswap.h>
@ -206,6 +209,12 @@ static inline void memcpy_swap64(void *dst, const void *src, size_t n) {
}
}
#ifdef _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