diff --git a/Makefile b/Makefile index 73e1c5f..c7b05a9 100644 --- a/Makefile +++ b/Makefile @@ -36,11 +36,12 @@ CFLAGS = -I. -O3 -DNDEBUG -std=c11 -fPIC CXXFLAGS = -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC LDFLAGS = -# ref: https://github.com/ggerganov/whisper.cpp/issues/37 -ifneq ($(wildcard /usr/include/musl/*),) - CFLAGS += -D_POSIX_SOURCE -D_GNU_SOURCE - CXXFLAGS += -D_POSIX_SOURCE -D_GNU_SOURCE -endif +# clock_gettime came in POSIX.1b (1993) +# CLOCK_MONOTONIC came in POSIX.1-2001 / SUSv3 as optional +# posix_memalign came in POSIX.1-2001 / SUSv3 +# M_PI is an XSI extension since POSIX.1-2001 / SUSv3, came in XPG1 (1985) +CFLAGS += -D_XOPEN_SOURCE=600 +CXXFLAGS += -D_XOPEN_SOURCE=600 # OS specific # TODO: support Windows diff --git a/examples/command/command.cpp b/examples/command/command.cpp index 54e3549..d39af73 100644 --- a/examples/command/command.cpp +++ b/examples/command/command.cpp @@ -6,8 +6,8 @@ // ref: https://github.com/ggerganov/whisper.cpp/issues/171 // -#include "common.h" #include "common-sdl.h" +#include "common.h" #include "whisper.h" #include diff --git a/examples/stream/stream.cpp b/examples/stream/stream.cpp index cec5a2b..e44c1f6 100644 --- a/examples/stream/stream.cpp +++ b/examples/stream/stream.cpp @@ -3,8 +3,8 @@ // A very quick-n-dirty implementation serving mainly as a proof of concept. // -#include "common.h" #include "common-sdl.h" +#include "common.h" #include "whisper.h" #include diff --git a/examples/talk-llama/llama.cpp b/examples/talk-llama/llama.cpp index 942407b..04d78e0 100644 --- a/examples/talk-llama/llama.cpp +++ b/examples/talk-llama/llama.cpp @@ -1,11 +1,3 @@ -// Defines fileno on msys: -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#include -#include -#include -#endif - #include "llama-util.h" #include "llama.h" diff --git a/examples/talk-llama/talk-llama.cpp b/examples/talk-llama/talk-llama.cpp index 57a02ea..1865866 100644 --- a/examples/talk-llama/talk-llama.cpp +++ b/examples/talk-llama/talk-llama.cpp @@ -1,8 +1,8 @@ // Talk with AI // -#include "common.h" #include "common-sdl.h" +#include "common.h" #include "whisper.h" #include "llama.h" diff --git a/examples/talk/talk.cpp b/examples/talk/talk.cpp index 651ca20..12d98a0 100644 --- a/examples/talk/talk.cpp +++ b/examples/talk/talk.cpp @@ -1,8 +1,8 @@ // Talk with AI // -#include "common.h" #include "common-sdl.h" +#include "common.h" #include "whisper.h" #include "gpt-2.h" diff --git a/ggml.c b/ggml.c index 955f335..9dcaafa 100644 --- a/ggml.c +++ b/ggml.c @@ -1,4 +1,3 @@ -#define _GNU_SOURCE // Defines CLOCK_MONOTONIC on Linux #define _CRT_SECURE_NO_DEPRECATE // Disables ridiculous "unsafe" warnigns on Windows #include "ggml.h"