aboutsummaryrefslogtreecommitdiff
path: root/src/common/int-util.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-02-16 14:19:42 +0100
committerRiccardo Spagni <ric@spagni.net>2018-02-16 14:19:42 +0100
commitba22928d4bc6516e3b10785fefa6735fafdd62d5 (patch)
treedd481d126bb68e950459a2b82cb0ac99f0b4cacf /src/common/int-util.h
parentMerge pull request #3175 (diff)
parentFixed #if instead of #ifdef (diff)
downloadmonero-ba22928d4bc6516e3b10785fefa6735fafdd62d5.tar.xz
Merge pull request #3180
1dfed567 Fixed #if instead of #ifdef (Matt Little) 7c442453 Support building cncrypto lib with msvc (Matt Little)
Diffstat (limited to 'src/common/int-util.h')
-rw-r--r--src/common/int-util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/int-util.h b/src/common/int-util.h
index 11e39895e..3bcc085e2 100644
--- a/src/common/int-util.h
+++ b/src/common/int-util.h
@@ -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