commit 1586f63
xplshn
·
2026-07-01 03:19:26 +0000 UTC
parent f47c515
more header order fixes Signed-off-by: xplshn <anto@xplshn.com.ar>
13 files changed,
+86,
-28
+18,
-19
1@@ -1,8 +1,8 @@
2 # posix: POSIX 2024
3 PRESET_FEATURES=all
4
5-# subset of: posix linux net xsi pseudo dev
6-PRESET_UTILS="posix linux net xsi pseudo"
7+# subset of: posix xsi net pseudo linux dev
8+PRESET_UTILS="posix xsi net pseudo linux"
9
10 # installation paths
11 VERSION=2026-06-08T05-53-UTC-03
12@@ -40,11 +40,11 @@ posix)
13 FEATURE_SH_SETVAR=0; FEATURE_SH_WORDEXP=0
14 FEATURE_CAL_EXT=0
15 FEATURE_LS_COLOR=0
16- FEATURE_DIFF3_MERGE=0; FEATURE_DIFF3_EDSCRIPT=0
17- FEATURE_DIFF_CONTEXT=0; FEATURE_DIFF_UNIFIED=0
18- FEATURE_DIFF_ED=0; FEATURE_DIFF_BRIEF=0
19+ FEATURE_DIFF3_MERGE=0; FEATURE_DIFF3_EDSCRIPT=0
20+ FEATURE_DIFF_CONTEXT=0; FEATURE_DIFF_UNIFIED=0
21+ FEATURE_DIFF_ED=0; FEATURE_DIFF_BRIEF=0
22 FEATURE_DIFF_SIDEBYSIDE=0
23- FEATURE_PATCH_BACKUP=0; FEATURE_PATCH_FUZZ=0
24+ FEATURE_PATCH_BACKUP=0; FEATURE_PATCH_FUZZ=0
25 FEATURE_PATCH_STRIP_CR=0
26 FEATURE_MODPROBE_SHOW_DEPENDS=0; FEATURE_MODPROBE_BLACKLIST=0
27 FEATURE_MODPROBE_SYSLOG=0; FEATURE_MODPROBE_DIR_OVERRIDE=0
28@@ -75,11 +75,11 @@ common)
29 FEATURE_SH_SETVAR=0; FEATURE_SH_WORDEXP=0
30 FEATURE_CAL_EXT=1
31 FEATURE_LS_COLOR=1
32- FEATURE_DIFF3_MERGE=0; FEATURE_DIFF3_EDSCRIPT=1
33- FEATURE_DIFF_CONTEXT=1; FEATURE_DIFF_UNIFIED=1
34- FEATURE_DIFF_ED=1; FEATURE_DIFF_BRIEF=1
35+ FEATURE_DIFF3_MERGE=0; FEATURE_DIFF3_EDSCRIPT=1
36+ FEATURE_DIFF_CONTEXT=1; FEATURE_DIFF_UNIFIED=1
37+ FEATURE_DIFF_ED=1; FEATURE_DIFF_BRIEF=1
38 FEATURE_DIFF_SIDEBYSIDE=0
39- FEATURE_PATCH_BACKUP=1; FEATURE_PATCH_FUZZ=1
40+ FEATURE_PATCH_BACKUP=1; FEATURE_PATCH_FUZZ=1
41 FEATURE_PATCH_STRIP_CR=1
42 FEATURE_MODPROBE_SHOW_DEPENDS=1; FEATURE_MODPROBE_BLACKLIST=1
43 FEATURE_MODPROBE_SYSLOG=1; FEATURE_MODPROBE_DIR_OVERRIDE=1
44@@ -92,7 +92,6 @@ common)
45 FEATURE_IP_LINK_SET=1; FEATURE_IP_ADDR_FLUSH=1
46 ;;
47 all)
48- # histedit now included via redline
49 FEATURE_FIND_DELETE=1; FEATURE_FIND_QUIT=1
50 FEATURE_FIND_EMPTY=1; FEATURE_FIND_INUM=1
51 FEATURE_FIND_SAMEFILE=1; FEATURE_FIND_MAXDEPTH=1
52@@ -107,16 +106,16 @@ all)
53 FEATURE_SORT_BIG=1; FEATURE_SORT_STABLE=1
54 FEATURE_OD_ENDIAN=1;
55 FEATURE_SH_HISTEDIT=1
56-FEATURE_INPROC_EXEC=0 # set to 1 for aruu-box in-process dispatch; FEATURE_SH_LOCAL=1
57+ FEATURE_INPROC_EXEC=0 FEATURE_SH_LOCAL=1
58 FEATURE_SH_LET=1; FEATURE_SH_ULIMIT=1
59 FEATURE_SH_SETVAR=1; FEATURE_SH_WORDEXP=1
60 FEATURE_CAL_EXT=1
61 FEATURE_LS_COLOR=1
62- FEATURE_DIFF3_MERGE=1; FEATURE_DIFF3_EDSCRIPT=1
63- FEATURE_DIFF_CONTEXT=1; FEATURE_DIFF_UNIFIED=1
64- FEATURE_DIFF_ED=1; FEATURE_DIFF_BRIEF=1
65+ FEATURE_DIFF3_MERGE=1; FEATURE_DIFF3_EDSCRIPT=1
66+ FEATURE_DIFF_CONTEXT=1; FEATURE_DIFF_UNIFIED=1
67+ FEATURE_DIFF_ED=1; FEATURE_DIFF_BRIEF=1
68 FEATURE_DIFF_SIDEBYSIDE=1
69- FEATURE_PATCH_BACKUP=1; FEATURE_PATCH_FUZZ=1
70+ FEATURE_PATCH_BACKUP=1; FEATURE_PATCH_FUZZ=1
71 FEATURE_PATCH_STRIP_CR=1
72 FEATURE_MODPROBE_SHOW_DEPENDS=1; FEATURE_MODPROBE_BLACKLIST=1
73 FEATURE_MODPROBE_SYSLOG=1; FEATURE_MODPROBE_DIR_OVERRIDE=1
74@@ -134,8 +133,8 @@ FEATURE_INPROC_EXEC=0 # set to 1 for aruu-box in-process dispatch; F
75 ;;
76 esac
77
78-BUILD_POSIX=0; BUILD_LINUX=0; BUILD_NET=0; BUILD_XSI=0
79-BUILD_PSEUDO=0; BUILD_DEV=0
80+
81+BUILD_POSIX=0; BUILD_XSI=0; BUILD_PSEUDO=0; BUILD_NET=0; BUILD_LINUX=0; BUILD_DEV=0
82 for _p in $PRESET_UTILS; do
83 case "$_p" in
84 posix) BUILD_POSIX=1 ;;
85@@ -156,7 +155,7 @@ unset _p
86 # BUILD_POSIX_SH=0 # disable a tool when its group is active
87 # BUILD_DEV_AS=1 # enable a tool whose group isnt in PRESET_UTILS
88 FEATURE_SH_HISTEDIT=1
89-FEATURE_INPROC_EXEC=0 # set to 1 for aruu-box in-process dispatch
90+FEATURE_INPROC_EXEC=0
91 # tls backend: set exactly one to 1 to enable tls
92 FEATURE_USE_BEARSSL=0
93 FEATURE_USE_LIBRESSL=0
+1,
-0
1@@ -23,6 +23,7 @@ THIS SOFTWARE.
2 ****************************************************************/
3
4 #include <assert.h>
5+#include <stddef.h>
6 #include <stdint.h>
7
8 #ifndef bool
+2,
-0
1@@ -22,6 +22,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
2 THIS SOFTWARE.
3 ****************************************************************/
4
5+#include <stddef.h>
6+#include <stdio.h>
7 extern int yywrap(void);
8 extern void setfname(Cell *);
9 extern int constnode(Node *);
+4,
-2
1@@ -2,9 +2,9 @@
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1993
5- * The Regents of the University of California. All rights reserved.
6+ * The Regents of the University of California. All rights reserved.
7 * Copyright (c) 2007
8- * Herbert Xu <herbert@gondor.apana.org.au>. All rights reserved.
9+ * Herbert Xu <herbert@gondor.apana.org.au>. All rights reserved.
10 *
11 * This code is derived from software contributed to Berkeley by
12 * Kenneth Almquist.
13@@ -34,6 +34,8 @@
14 * SUCH DAMAGE.
15 */
16
17+#include "shell.h"
18+
19 #define ARITH_ASS 1
20
21 #define ARITH_OR 2
+2,
-0
1@@ -32,6 +32,8 @@
2 * SUCH DAMAGE.
3 */
4
5+#include "sh_cdefs.h"
6+
7 /*
8 * We enclose jmp_buf in a structure so that we can declare pointers to
9 * jump locations. The global variable handler contains the location to
+2,
-0
1@@ -32,6 +32,8 @@
2 * SUCH DAMAGE.
3 */
4
5+#include "sh_cdefs.h"
6+
7 /* values of cmdtype */
8 #define CMDUNKNOWN -1 /* no entry in table for command */
9 #define CMDNORMAL 0 /* command is an executable program */
+2,
-1
1@@ -2,7 +2,7 @@
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1991, 1993
5- * The Regents of the University of California. All rights reserved.
6+ * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Kenneth Almquist.
10@@ -37,6 +37,7 @@
11 #define FORK_BG 1
12 #define FORK_NOJOB 2
13
14+#include "shell.h"
15 #include <signal.h> /* for sig_atomic_t */
16
17 struct job;
+3,
-1
1@@ -2,7 +2,7 @@
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1991, 1993
5- * The Regents of the University of California. All rights reserved.
6+ * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Kenneth Almquist.
10@@ -32,6 +32,8 @@
11 * SUCH DAMAGE.
12 */
13
14+#include "sh_cdefs.h"
15+#include <stddef.h>
16 #include <string.h>
17
18 struct stackmark {
+2,
-0
1@@ -32,6 +32,8 @@
2 * SUCH DAMAGE.
3 */
4
5+#include "sh_cdefs.h"
6+
7 #ifndef OUTPUT_INCL
8
9 #include <stdarg.h>
+37,
-0
1@@ -0,0 +1,37 @@
2+/*-
3+ * Compat defs for non-BSDs
4+ *
5+ * __unused and __nonstring are intentionally NOT defined here
6+ * They collide with struct field names in some libc's <bits/stat.h>
7+ * (`long __unused[3]`) and similar system headers when defined as
8+ * macros before those headers are included. They remain defined in
9+ * shell.h, which includes <sys/stat.h> before defining them
10+ *
11+ * All definitions are guarded with #ifndef so they do not conflict
12+ * with each other or with system-provided definitions
13+ */
14+
15+#ifndef SH_CDEFS_H
16+#define SH_CDEFS_H
17+
18+#ifndef __dead2
19+#define __dead2 __attribute__((__noreturn__))
20+#endif
21+
22+#ifndef __printf0like
23+#define __printf0like(n, m) __attribute__((__format__(__printf__, n, m)))
24+#endif
25+
26+#ifndef __printflike
27+#define __printflike(n, m) __attribute__((__format__(__printf__, n, m)))
28+#endif
29+
30+#ifndef _SH_POINTER_TYPEDEF
31+#define _SH_POINTER_TYPEDEF
32+typedef void *pointer; /* used in our memalloc.h and bltin.h
33+ canonical home is shell.h, but we
34+ want memalloc to be self-contained
35+ and not pull all of shell.h */
36+#endif
37+
38+#endif /* SH_CDEFS_H */
+7,
-4
1@@ -2,7 +2,7 @@
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1991, 1993
5- * The Regents of the University of California. All rights reserved.
6+ * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Kenneth Almquist.
10@@ -129,9 +129,9 @@
11
12 /*
13 * The follow should be set to reflect the type of system you have:
14- * JOBS -> 1 if you have Berkeley job control, 0 otherwise.
15- * define DEBUG=1 to compile in debugging (set global "debug" to turn on)
16- * define DEBUG=2 to compile in and turn on debugging.
17+ * JOBS -> 1 if you have Berkeley job control, 0 otherwise.
18+ * define DEBUG=1 to compile in debugging (set global "debug" to turn on)
19+ * define DEBUG=2 to compile in and turn on debugging.
20 *
21 * When debugging is on, debugging info will be written to ./trace and
22 * a quit signal will generate a core dump.
23@@ -148,7 +148,10 @@ typedef intmax_t arith_t;
24 #define ARITH_MIN INTMAX_MIN
25 #define ARITH_MAX INTMAX_MAX
26
27+#ifndef _SH_POINTER_TYPEDEF
28+#define _SH_POINTER_TYPEDEF
29 typedef void *pointer;
30+#endif
31
32 #if defined(__has_include)
33 #if __has_include(<sys/cdefs.h>)
+2,
-0
1@@ -29,6 +29,8 @@
2 * SUCH DAMAGE.
3 */
4
5+#include "sh_cdefs.h"
6+
7 void showtree(union node *);
8 #ifdef DEBUG
9 void sh_trace(const char *, ...) __printflike(1, 2);
+4,
-1
1@@ -2,7 +2,7 @@
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1991, 1993
5- * The Regents of the University of California. All rights reserved.
6+ * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Kenneth Almquist.
10@@ -32,6 +32,9 @@
11 * SUCH DAMAGE.
12 */
13
14+#include "sh_cdefs.h"
15+#include <signal.h> /* for sig_atomic_t */
16+
17 extern volatile sig_atomic_t pendingsig;
18 extern volatile sig_atomic_t pendingsig_waitcmd;
19