From 65c39faa76cb7a711b21e1e54b9e0aa1410e997c Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Tue, 21 Oct 2025 13:42:46 -0500 Subject: Fix _GNU_SOURCE not being defined --- src/Makefile | 2 +- src/encryption.c | 16 +++++++++------- src/main.c | 2 ++ src/tests.c | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index de0c9f6..0a72955 100644 --- a/src/Makefile +++ b/src/Makefile @@ -29,7 +29,7 @@ $(TIMESTAMPS): $(TIMESTAMP_DIR)/%.t: %.c | $(TIMESTAMP_DIR) touch $@ main tests: %: %.c $(TIMESTAMPS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ + $(CC) -D_GNU_SOURCE=1 $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ # Phony rules diff --git a/src/encryption.c b/src/encryption.c index aafb972..c3f77ce 100644 --- a/src/encryption.c +++ b/src/encryption.c @@ -14,12 +14,11 @@ // I need to make sure every single function in this file returns with an indicated error instead of nuking the whole program with // error() +#define _GNU_SOURCE 1 + #ifndef __VXGG_REWRITE___ENCRYPTION_C___1481879318188___ #define __VXGG_REWRITE___ENCRYPTION_C___1481879318188___ - -#define _GNU_SOURCE - #define TPSIZE (1<<13) #include "shared.c" @@ -29,14 +28,17 @@ #include #include +#include + #include #include -#include #include + +#include +#include + #include #include -#include -#include /// Determines whether any function that calls libsodium functions also checks to make sure libsodium is actually initialized. May /// cause unexpected issues with early exiting due to libsodium failing to initialize properly. It's recommended that you just @@ -626,7 +628,7 @@ ctqueue * cryptscan() { ctqueue *res = ctqueue_init(TPSIZE), *working = ctqueue_init(TPSIZE); if(!res || !working) ERRRET(errno, NULL); - task *start = task_init(__cscan_worker, free, void *data); + task *start = task_init(__cscan_worker, free, NULL); if(!start) ERRRET(errno, NULL); ctqueue_waitpush(working, start); diff --git a/src/main.c b/src/main.c index b5b4a5f..c9cc873 100755 --- a/src/main.c +++ b/src/main.c @@ -9,6 +9,8 @@ * */ +#define _GNU_SOURCE 1 + #include "shared.c" #include "encryption.c" #include "threadpool.c" diff --git a/src/tests.c b/src/tests.c index 882fdc2..2b98b3d 100644 --- a/src/tests.c +++ b/src/tests.c @@ -1,4 +1,4 @@ -#define _GNU_SOURCE +#define _GNU_SOURCE 1 #include "shared.c" #include "encryption.c" -- cgit v1.2.3