summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Klausner <wiz@gatalith.at>2023-03-13 17:40:54 +0100
committerGitHub <noreply@github.com>2023-03-13 18:40:54 +0200
commit41be0a3b3d76ee4f254dc81b42bd8ed26ee324e7 (patch)
treebf1d7d1f766b447c7c7e6e0e4984ac01a65bb9e4
parent671d5cac15241b495006f56482bf2d6967dca91f (diff)
Add NetBSD support. (#90)
-rw-r--r--Makefile4
-rw-r--r--ggml.c2
-rw-r--r--utils.cpp2
3 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8388c290..1601079a 100644
--- a/Makefile
+++ b/Makefile
@@ -48,6 +48,10 @@ ifeq ($(UNAME_S),FreeBSD)
CFLAGS += -pthread
CXXFLAGS += -pthread
endif
+ifeq ($(UNAME_S),NetBSD)
+ CFLAGS += -pthread
+ CXXFLAGS += -pthread
+endif
ifeq ($(UNAME_S),Haiku)
CFLAGS += -pthread
CXXFLAGS += -pthread
diff --git a/ggml.c b/ggml.c
index 7b0b456f..58a4c9b6 100644
--- a/ggml.c
+++ b/ggml.c
@@ -2,7 +2,7 @@
#if defined(_MSC_VER) || defined(__MINGW32__)
#include <malloc.h> // using malloc.h with MSC/MINGW
-#elif !defined(__FreeBSD__)
+#elif !defined(__FreeBSD__) && !defined(__NetBSD__)
#include <alloca.h>
#endif
diff --git a/utils.cpp b/utils.cpp
index b340bd61..54217f02 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -11,7 +11,7 @@
#if defined(_MSC_VER) || defined(__MINGW32__)
#include <malloc.h> // using malloc.h with MSC/MINGW
- #elif !defined(__FreeBSD__)
+ #elif !defined(__FreeBSD__) && !defined(__NetBSD__)
#include <alloca.h>
#endif