summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-03-04 03:23:42 -0500
committerJakob Kaivo <jkk@ung.org>2020-03-04 03:23:42 -0500
commit0bd100d7cca8d9b333a309448c2847b3dbce4a06 (patch)
tree798d286c59f77e9cab77ea7d4845811b8a1f1be2
parent921b86d6a1316585469fd0c1a2d876079925ec11 (diff)
compile with c=AMD1 and POSIX.2
-rw-r--r--src/setjmp/siglongjmp.c1
-rw-r--r--src/setjmp/sigsetjmp.c1
-rw-r--r--src/stdio/fgetc.c4
-rw-r--r--src/stdio/popen.c4
-rw-r--r--src/wchar/fgetwc.c1
5 files changed, 8 insertions, 3 deletions
diff --git a/src/setjmp/siglongjmp.c b/src/setjmp/siglongjmp.c
index 06edc641..039dabf1 100644
--- a/src/setjmp/siglongjmp.c
+++ b/src/setjmp/siglongjmp.c
@@ -1,4 +1,5 @@
#include <setjmp.h>
+#include "sys/types.h"
#include "signal.h"
/** restore calling environment with signal mask **/
diff --git a/src/setjmp/sigsetjmp.c b/src/setjmp/sigsetjmp.c
index 46eebeba..6b75e90f 100644
--- a/src/setjmp/sigsetjmp.c
+++ b/src/setjmp/sigsetjmp.c
@@ -1,4 +1,5 @@
#include <setjmp.h>
+#include "sys/types.h"
#include "signal.h"
/** save program state with signal mask **/
diff --git a/src/stdio/fgetc.c b/src/stdio/fgetc.c
index ae1f529a..08fe4e64 100644
--- a/src/stdio/fgetc.c
+++ b/src/stdio/fgetc.c
@@ -1,8 +1,8 @@
#include <stdio.h>
#include "_stdio.h"
-#ifndef _POSIX_C_SOURCE
-#define getc_unlocked(...) 0
+#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 199506L
+#include "getc_unlocked.c"
#endif
/** read a character from a file stream **/
diff --git a/src/stdio/popen.c b/src/stdio/popen.c
index 201800a7..04918003 100644
--- a/src/stdio/popen.c
+++ b/src/stdio/popen.c
@@ -8,6 +8,10 @@
#include "nonstd/assert.h"
#include "_stdio.h"
+#ifdef __STDC_VERSION__
+#include "wchar.h"
+#endif
+
FILE * popen(const char * command, const char * mode)
{
ASSERT_NONNULL(command);
diff --git a/src/wchar/fgetwc.c b/src/wchar/fgetwc.c
index 2c4d0d24..e5bedd04 100644
--- a/src/wchar/fgetwc.c
+++ b/src/wchar/fgetwc.c
@@ -5,7 +5,6 @@
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 199506L
#include "../unistd/read.c"
-static int getc_unlocked(FILE *);
#include "../stdio/getc_unlocked.c"
#endif