shithub: npe

Download patch

ref: 41f9e6315b75a8ea422d1c0dbf0ed1999b80a7eb
parent: adfd58ca7bfc4972c2ae3d4168206288b07dab82
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Mar 15 12:08:17 EDT 2021

relax includes. again.

--- a/include/npe/ctype.h
+++ b/include/npe/ctype.h
@@ -1,7 +1,1 @@
-#ifndef _ctype_h_
-#define _ctype_h_
-
 #include "plan9.h"
-#include </sys/include/ctype.h>
-
-#endif
--- a/include/npe/plan9.h
+++ b/include/npe/plan9.h
@@ -1,18 +1,26 @@
 #ifndef __plan9_h__
 #define __plan9_h__
 
+#pragma lib "libnpe.a"
+
 #include <u.h>
 #include <libc.h>
+
+/* programs quite often do not include these directly */
 #include </sys/include/stdio.h>
+#include </sys/include/ctype.h>
 
-#pragma lib "libnpe.a"
+/* some programs do not #include <strings.h> */
+#define strcasecmp cistrcmp
+#define strncasecmp cistrncmp
 
 #ifndef __attribute__
 #define __attribute__(a)
 #endif
 
-/* this HAS to be in this header since some many programs do not #include <stdlib.h> */
+/* some programs do not #include <stdlib.h> */
 #define getenv npe_getenv
+char *npe_getenv(char *s);
 
 /* to override "main" with our own threadmain */
 #define main npe_main_renamed
--- a/include/npe/stdlib.h
+++ b/include/npe/stdlib.h
@@ -8,6 +8,4 @@
 #define exit(x) threadexitsall(x == 0 ? nil : "error")
 #endif
 
-char *npe_getenv(char *s);
-
 #endif
--- a/include/npe/strings.h
+++ b/include/npe/strings.h
@@ -1,7 +1,1 @@
-#ifndef _strings_h_
-#define _strings_h_
-
-#define strcasecmp cistrcmp
-#define strncasecmp cistrncmp
-
-#endif
+#include "plan9.h"