aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorthomasvaughan <thomas@vaughan.net>2018-09-02 14:51:23 +0000
committerthomasvaughan <thomas@vaughan.net>2018-09-11 14:32:33 +0000
commitbcda7adcd444cc72b5c0d02da65be6b5cd843fc2 (patch)
tree0a02c0b8c9ea34c32ced30e511338db0ca479e52 /src
parentMerge pull request #4223 (diff)
downloadmonero-bcda7adcd444cc72b5c0d02da65be6b5cd843fc2.tar.xz
NetBSD support
Diffstat (limited to 'src')
-rw-r--r--src/crypto/oaes_lib.c13
-rw-r--r--src/crypto/slow-hash.c2
-rw-r--r--src/crypto/tree-hash.c3
3 files changed, 10 insertions, 8 deletions
diff --git a/src/crypto/oaes_lib.c b/src/crypto/oaes_lib.c
index 9e31ebf46..210f5d43a 100644
--- a/src/crypto/oaes_lib.c
+++ b/src/crypto/oaes_lib.c
@@ -33,14 +33,15 @@
#include <stdlib.h>
#include <stdio.h>
-// OS X, FreeBSD, and OpenBSD don't need malloc.h
+// OS X, FreeBSD, OpenBSD and NetBSD don't need malloc.h
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) \
- && !defined(__DragonFly__)
+ && !defined(__DragonFly__) && !defined(__NetBSD__)
#include <malloc.h>
#endif
-// ANDROID, FreeBSD, and OpenBSD also don't need timeb.h
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__ANDROID__)
+// ANDROID, FreeBSD, OpenBSD and NetBSD also don't need timeb.h
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__ANDROID__) \
+ && !defined(__NetBSD__)
#include <sys/timeb.h>
#else
#include <sys/time.h>
@@ -473,7 +474,7 @@ OAES_RET oaes_sprintf(
#ifdef OAES_HAVE_ISAAC
static void oaes_get_seed( char buf[RANDSIZ + 1] )
{
- #if !defined(__FreeBSD__) && !defined(__OpenBSD__)
+ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
struct timeb timer;
struct tm *gmTimer;
char * _test = NULL;
@@ -505,7 +506,7 @@ static void oaes_get_seed( char buf[RANDSIZ + 1] )
#else
static uint32_t oaes_get_seed(void)
{
- #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__ANDROID__)
+ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__ANDROID__) && !defined(__NetBSD__)
struct timeb timer;
struct tm *gmTimer;
char * _test = NULL;
diff --git a/src/crypto/slow-hash.c b/src/crypto/slow-hash.c
index 9d4fc0dfa..e76fb1c0a 100644
--- a/src/crypto/slow-hash.c
+++ b/src/crypto/slow-hash.c
@@ -492,7 +492,7 @@ void slow_hash_allocate_state(void)
MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
#else
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
- defined(__DragonFly__)
+ defined(__DragonFly__) || defined(__NetBSD__)
hp_state = mmap(0, MEMORY, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON, 0, 0);
#else
diff --git a/src/crypto/tree-hash.c b/src/crypto/tree-hash.c
index 57c38b86b..b2dc3ffb2 100644
--- a/src/crypto/tree-hash.c
+++ b/src/crypto/tree-hash.c
@@ -36,7 +36,8 @@
#ifdef _MSC_VER
#include <malloc.h>
-#elif !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
+#elif !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) \
+ && !defined(__NetBSD__)
#include <alloca.h>
#else
#include <stdlib.h>