summaryrefslogtreecommitdiff
path: root/src/nonstd
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-25 21:08:46 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-25 21:08:46 -0500
commitf26bf1396557e4bc739d6a7703099f75bfe2fb99 (patch)
tree1ac1d21defcccac8032590aa6bc145b9d8877016 /src/nonstd
parent21f6ab11f8554328772ac992ced6947b2b67df65 (diff)
fix warning from -Wall
Diffstat (limited to 'src/nonstd')
-rw-r--r--src/nonstd/__libc.c1
-rw-r--r--src/nonstd/__libc_start.c1
-rw-r--r--src/nonstd/__pthread_per_thread.c9
-rw-r--r--src/nonstd/_printf.h1
4 files changed, 7 insertions, 5 deletions
diff --git a/src/nonstd/__libc.c b/src/nonstd/__libc.c
index 2d246203..e1d64c6d 100644
--- a/src/nonstd/__libc.c
+++ b/src/nonstd/__libc.c
@@ -1,3 +1,4 @@
+#include "sys/types.h"
#include <nonstd/internal.h>
#include "locale.h"
#include "nonstd/locale.h"
diff --git a/src/nonstd/__libc_start.c b/src/nonstd/__libc_start.c
index 8dab57fb..0cff0ab3 100644
--- a/src/nonstd/__libc_start.c
+++ b/src/nonstd/__libc_start.c
@@ -23,4 +23,3 @@ void __libc_start(int argc, char **argv)
exit(main(argc, argv));
}
-
diff --git a/src/nonstd/__pthread_per_thread.c b/src/nonstd/__pthread_per_thread.c
index 0dff3999..0f633a1b 100644
--- a/src/nonstd/__pthread_per_thread.c
+++ b/src/nonstd/__pthread_per_thread.c
@@ -1,10 +1,12 @@
+#if defined _POSIX_C_SOURCE && 199506L <= _POSIX_C_SOURCE
+
#include "pthread.h"
static pthread_key_t __per_thread_key;
static void __make_key(void)
{
- pthread_key_create(&key, NULL);
+ pthread_key_create(&__per_thread_key, NULL);
}
static struct per_thread *per_thread(void)
@@ -12,12 +14,13 @@ static struct per_thread *per_thread(void)
static pthread_once_t key_once = PTHREAD_ONCE_INIT;
struct per_thread *pt;
pthread_once(&key_once, __make_key);
- if ((pt = pthread_getspecific(key)) == NULL) {
+ if ((pt = pthread_getspecific(__per_thread_key)) == NULL) {
pt = calloc(1, sizeof (*pt));
- pthread_setspecific(key, pt);
+ pthread_setspecific(__per_thread_key, pt);
}
return pt;
}
+#endif
/*
LINK(pthread)
diff --git a/src/nonstd/_printf.h b/src/nonstd/_printf.h
index 0c513bef..fa132367 100644
--- a/src/nonstd/_printf.h
+++ b/src/nonstd/_printf.h
@@ -58,7 +58,6 @@ int (__printf)(struct io_options *opt, const char * format, va_list arg)
{
extern int isdigit(int);
extern int isupper(int);
- extern size_t fwrite(char *, size_t, size_t, struct __FILE *);
char buf[BUFSIZ];
int nout = 0;