shithub: npe

Download patch

ref: 31984582c702a9febde8773e1e24f305c4eceae4
parent: 8d59ff3b29f759e550dc421b8cd14d96b83b5001
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Mar 16 09:21:35 EDT 2021

move exit(3) to plan9.h, choose between threadexitsall and exits depending on __plan9_keep_main__

--- a/include/npe/plan9.h
+++ b/include/npe/plan9.h
@@ -28,6 +28,15 @@
 #ifndef __plan9_keep_main__
 #define main npe_main_renamed
 #pragma lib "libthread.a"
+#ifndef exit
+void threadexitsall(char *);
+#define exit(x) threadexitsall(x == 0 ? nil : "error")
+#endif
+#endif
+
+#ifndef exit
+void exits(char *);
+#define exit(x) exits(x == 0 ? nil : "error")
 #endif
 
 uvlong npe_nanosec(void);
--- a/include/npe/stdlib.h
+++ b/include/npe/stdlib.h
@@ -1,11 +1,1 @@
-#ifndef _stdlib_h_
-#define _stdlib_h_
-
 #include "plan9.h"
-
-#ifndef exit
-void threadexitsall(char *);
-#define exit(x) threadexitsall(x == 0 ? nil : "error")
-#endif
-
-#endif