remove warnings on more OSes - libgcgi - REST library for Gopher | |
git clone git://bitreich.org/libgcgi git://hg6vgqziawt5s4dj.onion/libgcgi | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit fd61b070718453c8d57daa40f620d89e75cb2d78 | |
parent f1f14c75ca3477d51d1a4e09b917a5e5f869e672 | |
Author: Josuah Demangeon <[email protected]> | |
Date: Tue, 2 Aug 2022 14:28:03 +0200 | |
remove warnings on more OSes | |
Diffstat: | |
M Makefile | 2 +- | |
M libgcgi.c | 1 + | |
M libgcgi.h | 9 ++++++++- | |
3 files changed, 10 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/Makefile b/Makefile | |
@@ -1,5 +1,5 @@ | |
LDFLAGS = -static | |
-CFLAGS = -g -pedantic -std=c99 -Wall -Wextra | |
+CFLAGS = -D_POSIX_C_SOURCE=200809L -g -pedantic -std=c99 -Wall -Wextra | |
all: index.cgi | |
diff --git a/libgcgi.c b/libgcgi.c | |
@@ -6,6 +6,7 @@ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
+#include <strings.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
diff --git a/libgcgi.h b/libgcgi.h | |
@@ -1,7 +1,11 @@ | |
#ifndef LIBGCGI_H | |
#define LIBGCGI_H | |
-/* Gopher CGI library to use in CGI scripts */ | |
+/* | |
+ * Gopher CGI library to use in CGI scripts | |
+ * | |
+ * See libgcgi(3) or the README for usage and examples. | |
+ */ | |
/* maps glob pattern */ | |
struct gcgi_handler { | |
@@ -43,4 +47,7 @@ extern struct gcgi_var_list gcgi_gopher_query; | |
extern char *gcgi_gopher_host; | |
extern char *gcgi_gopher_port; | |
+/* need to be provided if not present in libc, which is rare */ | |
+char *strsep(char **s, const char *delims); | |
+ | |
#endif |