aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-24 02:47:11 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-07-20 23:52:53 +0200
commitaf16aa6702ffb385a36504a459210e94704bbe2b (patch)
tree5921933f67aff7a9aefe1fecd494558d0d8d017c
parent327690ad9f5f8476405401bdb79d1f523567a8e0 (diff)
Define _POSIX_C_SOURCE
This allows using the default compiler defined by make(1) (i.e., c99(1)), thus improving POSIX compatibility.
-rw-r--r--Makefile1
-rw-r--r--handler.c2
-rw-r--r--html.c2
-rw-r--r--http.c2
-rw-r--r--server.c2
5 files changed, 8 insertions, 1 deletions
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 <dynstr.h>
#include <errno.h>
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 <dynstr.h>
#include <sys/types.h>
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 <fcntl.h>
#include <sys/select.h>