From d36aa94c1e2694b0e802c4c51d6a68b0ffe299f1 Mon Sep 17 00:00:00 2001 From: saharNooby Date: Mon, 18 Sep 2023 19:42:05 +0400 Subject: [PATCH] Try to fix compilation error --- rwkv.cpp | 8 -------- tests/test_ggml_basics.c | 12 ++++++++++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rwkv.cpp b/rwkv.cpp index ef32573..01d62a1 100644 --- a/rwkv.cpp +++ b/rwkv.cpp @@ -1,12 +1,4 @@ #include "rwkv.h" - -// Fix build on Linux. -// https://stackoverflow.com/questions/8518264/where-is-the-declaration-of-cpu-alloc -#if defined(__linux__) -#define _GNU_SOURCE -#include -#endif - #include "ggml.h" #include "ggml-alloc.h" diff --git a/tests/test_ggml_basics.c b/tests/test_ggml_basics.c index 72f305b..1882fd8 100644 --- a/tests/test_ggml_basics.c +++ b/tests/test_ggml_basics.c @@ -1,4 +1,12 @@ // Tests that ggml basics work. + +// Fix build on Linux. +// https://stackoverflow.com/questions/8518264/where-is-the-declaration-of-cpu-alloc +#if defined(__linux__) +#define _GNU_SOURCE +#include +#endif + #include #include @@ -23,7 +31,7 @@ } // Tests simple computation in a single context. -static void test_computation() { +static void test_computation(void) { struct ggml_init_params params = { .mem_size = 16 * 1024, .mem_buffer = NULL, @@ -62,7 +70,7 @@ static void test_computation() { // Tests that operations on tensors from different contexts work. // RWKV model loading code depends on this behavior. -static void test_tensors_from_different_contexts() { +static void test_tensors_from_different_contexts(void) { struct ggml_init_params params = { .mem_size = 16 * 1024, .mem_buffer = NULL,