aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorMatt Little <zone117x@gmail.com>2018-01-25 13:00:45 -0700
committerMatt Little <zone117x@gmail.com>2018-01-25 13:00:45 -0700
commit7c4424531ff0dbe6958d6dd8beaeb978d3a6ebdb (patch)
tree323e5d60db89952f030749178cc34b143a0b52a4 /src/common
parentMerge pull request #3115 (diff)
downloadmonero-7c4424531ff0dbe6958d6dd8beaeb978d3a6ebdb.tar.xz
Support building cncrypto lib with msvc
Diffstat (limited to 'src/common')
-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 7cec571ad..dcf28d38a 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) {
}
}
+#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