From 6de08cb5b0602f7786bc1daabc6b7f460cfd542b Mon Sep 17 00:00:00 2001 From: Jan Wielemaker Date: Tue, 3 Dec 2024 10:53:15 +0100 Subject: [PATCH] PORT: Make cmake test for signal handler compatible with c23 --- cmake/TestSignalType.c | 6 +++--- scripts/configure | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cmake/TestSignalType.c b/cmake/TestSignalType.c index aca0bf4ed6..4d2d081b9c 100644 --- a/cmake/TestSignalType.c +++ b/cmake/TestSignalType.c @@ -4,13 +4,13 @@ # undef signal #endif #ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); +extern "C" #else -void (*signal ()) (); +void ( *signal(int signum, void (*handler)(int)) ) (int); #endif int -main () +main(int argc, char **argv) { return 0; } diff --git a/scripts/configure b/scripts/configure index 5da09dab3a..e52ec58e81 100755 --- a/scripts/configure +++ b/scripts/configure @@ -94,6 +94,16 @@ case $config in ;; esac +# c23 +# +# Enable C23 mode + +case $config in + *c23*) + CFLAGS+=" -std=gnu23" + ;; +esac + # test # # Install the tests along with the executable. Allows running the