ref: 54ff303f876bd222db5238abfd166f4703e9cbc8
parent: ebf07866d4c0be18dd2a7dd623e9458220e5ebb1
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Mar 16 09:53:50 EDT 2021
plan9.h: include stddef.h directly here, also thread.h if threaded version is used
--- a/include/npe/iconv.h
+++ b/include/npe/iconv.h
@@ -2,7 +2,6 @@
#define _iconv_h_
#include "plan9.h"
-#include <stdint.h>
typedef struct iconv_s *iconv_t;
#pragma incomplete struct iconv_s
--- a/include/npe/plan9.h
+++ b/include/npe/plan9.h
@@ -9,6 +9,7 @@
/* programs quite often do not include these directly */
#include </sys/include/stdio.h>
#include </sys/include/ctype.h>
+#include <stddef.h>
/* some programs do not #include <strings.h> */
#define strcasecmp cistrcmp
@@ -26,10 +27,10 @@
/* to override "main" with our own threadmain */
#ifndef __plan9_keep_main__
+#include <thread.h>
#define main npe_main_renamed
#pragma lib "libthread.a"
#ifndef exit
-void threadexitsall(char *);
#define exit(x) threadexitsall(x == 0 ? nil : "error")
#endif
#endif
--- a/include/npe/stddef.h
+++ b/include/npe/stddef.h
@@ -1,1 +1,9 @@
+#ifndef _stddef_h_
+#define _stddef_h_
+
#include "plan9.h"
+
+typedef long ssize_t;
+typedef ulong size_t;
+
+#endif
--- a/include/npe/stdint.h
+++ b/include/npe/stdint.h
@@ -12,8 +12,6 @@
typedef u32int uint32_t;
typedef s64int int64_t;
typedef u64int uint64_t;
-typedef long ssize_t;
-typedef ulong size_t;
typedef intptr ptrdiff_t;
typedef intptr intptr_t;
typedef uintptr uintptr_t;