From af16aa6702ffb385a36504a459210e94704bbe2b Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 24 Mar 2023 02:47:11 +0100 Subject: Define _POSIX_C_SOURCE This allows using the default compiler defined by make(1) (i.e., c99(1)), thus improving POSIX compatibility. --- Makefile | 1 - handler.c | 2 ++ html.c | 2 ++ http.c | 2 ++ server.c | 2 ++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 517959c..36bc50f 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ .POSIX: .SUFFIXES: .c .o -CC = cc # c99 (default value) does not allow POSIX extensions. PROJECT = slcl O = -Og CDEFS = -D_FILE_OFFSET_BITS=64 # Required for large file support on 32-bit. diff --git a/handler.c b/handler.c index 22699f5..73ac9ab 100644 --- a/handler.c +++ b/handler.c @@ -1,3 +1,5 @@ +#define _POSIX_C_SOURCE 200809L + #include "handler.h" #include "http.h" #include "server.h" diff --git a/html.c b/html.c index cad966b..41ce387 100644 --- a/html.c +++ b/html.c @@ -1,3 +1,5 @@ +#define _POSIX_C_SOURCE 200809L + #include "html.h" #include #include diff --git a/http.c b/http.c index b3b65d4..9126d7f 100644 --- a/http.c +++ b/http.c @@ -1,3 +1,5 @@ +#define _POSIX_C_SOURCE 200809L + #include "http.h" #include #include diff --git a/server.c b/server.c index 40be54e..f740384 100644 --- a/server.c +++ b/server.c @@ -1,3 +1,5 @@ +#define _POSIX_C_SOURCE 200809L + #include "server.h" #include #include -- cgit v1.2.3