diff --git a/src/cmd/INIT/iffe.sh b/src/cmd/INIT/iffe.sh index bfd29ab83..6eaaacc2e 100644 --- a/src/cmd/INIT/iffe.sh +++ b/src/cmd/INIT/iffe.sh @@ -1327,7 +1327,6 @@ std='#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) #define _NIL_(x) ((x)0)' tst= ext="#include " -noext='*[<"][Ss][Tt][Dd][Ii][Oo].[Hh][">]*|**|**|*/[*][*]/*' # loop on op [ arg [ ... ] ] [ : op [ arg [ ... ] ] ] @@ -3376,7 +3375,9 @@ int x; esac case $src in ?*) case $src in - $noext) EXT= ;; + *[\<\"][Ss][Tt][Dd][Ii][Oo].[Hh][\"\>]* | *\* | *\* | */[*]\[*]/*) + EXT= + ;; *) EXT="$tst $ext" ;; diff --git a/src/cmd/builtin/features/pty b/src/cmd/builtin/features/pty index f912d3ead..b617013de 100755 --- a/src/cmd/builtin/features/pty +++ b/src/cmd/builtin/features/pty @@ -14,17 +14,14 @@ lib grantpt,unlockpt,posix_openpt stdlib.h lib cfmakeraw termios.h tst - output{ + #include + #include + #if _lib_ptsname + #include + #endif + #include #include #include - #if _lib_ptsname && _npt_ptsname - _BEGIN_EXTERNS_ - #if _STD_ - extern char* ptsname(int); - #else - extern char* ptsname(); - #endif - #endif - _END_EXTERNS_ int main() { int i; @@ -39,7 +36,7 @@ tst - output{ { if (ptsname(fd)) { - printf("#define _pty_clone\t\"%s\"\n", ptc[i]); + sfprintf(sfstdout, "#define _pty_clone\t\"%s\"\n", ptc[i]); close(fd); break; } @@ -49,7 +46,7 @@ tst - output{ for (i = 0;; i++) if(i >= (sizeof(pty) / sizeof(pty[0]) - 1) || stat(pty[i], &statb)>=0) { - printf("#define _pty_first\t\"%s\"\n", pty[i]); + sfprintf(sfstdout, "#define _pty_first\t\"%s\"\n", pty[i]); break; } return 0; diff --git a/src/lib/libast/features/float b/src/lib/libast/features/float index 0f357eec9..781f76e0f 100644 --- a/src/lib/libast/features/float +++ b/src/lib/libast/features/float @@ -245,6 +245,7 @@ macro{ tst - note{ missing floating point limits }end output{ #include "FEATURE/common" + #include #if _hdr_float #include #endif @@ -899,6 +900,7 @@ tst - note{ missing floating point limits }end output{ tst - note{ double exponent bitfoolery }end output{ #include "FEATURE/common" + #include typedef union _dbl_exp_u { unsigned _ast_int4_t e[sizeof(double) / 4]; @@ -934,6 +936,7 @@ tst - note{ double exponent bitfoolery }end output{ tst - note{ long double exponent bitfoolery }end output{ #include "FEATURE/common" + #include typedef union _ast_fltmax_exp_u { unsigned _ast_int4_t e[sizeof(_ast_fltmax_t) / 4]; @@ -968,6 +971,7 @@ tst - note{ long double exponent bitfoolery }end output{ }end tst - -DN=1 - -DN=2 note{ _ast_fltmax_t maximum integral type }end output{ + #include int main() { @@ -992,6 +996,7 @@ tst - -DSCAN=1 - -lm -DSTRTO=1 - -DMAC=1 - -DDIV=1 - -DEXP=1 - -DADD=1 - -DMPY=1 #define _FP_MODE_VARIABLE 1 #endif #include "FEATURE/common" + #include #include #include #include diff --git a/src/lib/libast/features/sfio b/src/lib/libast/features/sfio index 3ec8d1de9..2d240545f 100644 --- a/src/lib/libast/features/sfio +++ b/src/lib/libast/features/sfio @@ -7,6 +7,7 @@ key signed typ struct.sf_hdtr sys/socket.h tst - note{ number of bits in pointer }end output{ + #include int main() { diff --git a/src/lib/libast/features/stdio b/src/lib/libast/features/stdio index 0e5c3b79d..508879f3b 100644 --- a/src/lib/libast/features/stdio +++ b/src/lib/libast/features/stdio @@ -204,6 +204,7 @@ cat{ #endif }end output{ + #include #ifndef FILENAME_MAX #ifndef NAME_MAX #ifndef _POSIX_NAME_MAX