From 02abb01318a8435a16b765e465ac376a08730d09 Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Mon, 9 Dec 2019 15:44:19 +0100 Subject: [PATCH] add support for NetBSD --- lib/3rdparty/sfmt/SFMT.c | 2 +- lib/ccv.h | 2 +- lib/ccv_io.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/3rdparty/sfmt/SFMT.c b/lib/3rdparty/sfmt/SFMT.c index 7e1fbd7e..0cb3ab01 100644 --- a/lib/3rdparty/sfmt/SFMT.c +++ b/lib/3rdparty/sfmt/SFMT.c @@ -338,7 +338,7 @@ void sfmt_fill_array64(sfmt_t * sfmt, uint64_t *array, int size) { * @param size the size of the array * @param rsize the size of each record in the array */ -#if !defined(__OpenBSD__) && !defined(__FreeBSD__) +#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) #include #endif diff --git a/lib/ccv.h b/lib/ccv.h index 4ba44b19..70f474d6 100644 --- a/lib/ccv.h +++ b/lib/ccv.h @@ -14,7 +14,7 @@ #include #include #include -#if !defined(__OpenBSD__) && !defined(__FreeBSD__) +#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) #include #endif diff --git a/lib/ccv_io.c b/lib/ccv_io.c index c9ee912e..3d478500 100644 --- a/lib/ccv_io.c +++ b/lib/ccv_io.c @@ -132,7 +132,7 @@ static int _ccv_read_raw(ccv_dense_matrix_t** x, void* data, int type, int rows, return CCV_IO_FINAL; } -#if defined(__APPLE__) || defined(BSD) +#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) typedef struct { char* buffer; fpos_t pos; @@ -185,7 +185,7 @@ int ccv_read_impl(const void* in, ccv_dense_matrix_t** x, int type, int rows, in } else if (type & CCV_IO_ANY_STREAM) { assert(rows > 8 && cols == 0 && scanline == 0); assert((type & 0xFF) != CCV_IO_DEFLATE_STREAM); // deflate stream (compressed stream) is not supported yet -#if _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L || defined(__APPLE__) || defined(BSD) +#if _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) // this is only supported by glibc #if _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L fd = fmemopen((void*)in, (size_t)rows, "rb"); -- 2.24.1