diff --git a/src/lib/libast/comp/conf.sh b/src/lib/libast/comp/conf.sh index adde98f18..7e9c0ae11 100644 --- a/src/lib/libast/comp/conf.sh +++ b/src/lib/libast/comp/conf.sh @@ -1546,7 +1546,7 @@ struct Conf_s short standard; short section; short call; - short op; + int op; }; typedef struct Prefix_s diff --git a/src/lib/libast/features/standards b/src/lib/libast/features/standards index 1d329ea8a..0d871a653 100644 --- a/src/lib/libast/features/standards +++ b/src/lib/libast/features/standards @@ -1,29 +1,39 @@ set stdio + +# Flag systems that omit necessary definitions such as u_long +# when _POSIX_SOURCE or _XOPEN_SOURCE are defined. +# Affected: Mac OS X, UnixWare. +typ u_long + # In FreeBSD, definitions like _POSIX_SOURCE and such are used to *limit* # functionality to known API; they don't enable anything. The general intent in -# BSD is to enable everything by default (effectively, providing the -# _KITCHEN_SINK_SOURCE mentioned below). So we look for that here, but stay +# BSD is to enable everything by default. So we look for that here, but stay # careful that we don't get fooled by presence of FreeBSD that underpins some # subsystems in Mac OS X; there are other Apple-specific portability hacks # elsewhere we should not interfere with. -if tst note{ FreeBSD, DragonFly BSD, or UnixWare }end compile{ +if tst note{ FreeBSD or DragonFly BSD }end compile{ #include - #if (!defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__USLC__)) || defined(APPLE) - #error not a FreeBSD or DragonFly BSD system + #if (!defined(__FreeBSD__) && !defined(__DragonFly__)) || defined(__APPLE__) || defined(__MACH__) + #error not one of the listed systems #endif }end { } -elif tst note{ _ALL_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ works }end compile{ +elif tst note{ _ALL_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & _GNU_SOURCE & _DARWIN_C_SOURCE & __EXTENSIONS__ works }end compile{ #define _ALL_SOURCE 1 #define _POSIX_SOURCE 1 #define _POSIX_C_SOURCE 21000101L #define _XOPEN_SOURCE 9900 #define _GNU_SOURCE 1 + #define _DARWIN_C_SOURCE 1 #define __EXTENSIONS__ 1 #include #include #include #include + #include + #if _typ_u_long + u_long _test_dummy_; + #endif }end { #ifndef _ALL_SOURCE #define _ALL_SOURCE 1 @@ -40,20 +50,28 @@ elif tst note{ _ALL_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & _ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif + #ifndef _DARWIN_C_SOURCE + #define _DARWIN_C_SOURCE 1 + #endif #ifndef __EXTENSIONS__ #define __EXTENSIONS__ 1 #endif } -elif tst note{ _ALL_SOURCE & _POSIX_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ works }end compile{ +elif tst note{ _ALL_SOURCE & _POSIX_SOURCE & _XOPEN_SOURCE & _GNU_SOURCE & _DARWIN_C_SOURCE & __EXTENSIONS__ works }end compile{ #define _ALL_SOURCE 1 #define _POSIX_SOURCE 1 #define _XOPEN_SOURCE 9900 #define _GNU_SOURCE 1 + #define _DARWIN_C_SOURCE 1 #define __EXTENSIONS__ 1 #include #include #include #include + #include + #if _typ_u_long + u_long _test_dummy; + #endif }end { #ifndef _ALL_SOURCE #define _ALL_SOURCE 1 @@ -67,20 +85,28 @@ elif tst note{ _ALL_SOURCE & _POSIX_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ work #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif + #ifndef _DARWIN_C_SOURCE + #define _DARWIN_C_SOURCE 1 + #endif #ifndef __EXTENSIONS__ #define __EXTENSIONS__ 1 #endif } -elif tst note{ _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ works }end compile{ +elif tst note{ _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & _GNU_SOURCE & _DARWIN_C_SOURCE & __EXTENSIONS__ works }end compile{ #define _POSIX_SOURCE 1 #define _POSIX_C_SOURCE 21000101L #define _XOPEN_SOURCE 9900 #define _GNU_SOURCE 1 + #define _DARWIN_C_SOURCE 1 #define __EXTENSIONS__ 1 #include #include #include #include + #include + #if _typ_u_long + u_long _test_dummy; + #endif }end { #ifndef _POSIX_SOURCE #define _POSIX_SOURCE 1 @@ -94,6 +120,9 @@ elif tst note{ _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif + #ifndef _DARWIN_C_SOURCE + #define _DARWIN_C_SOURCE 1 + #endif #ifndef __EXTENSIONS__ #define __EXTENSIONS__ 1 #endif @@ -106,6 +135,10 @@ elif tst note{ _POSIX_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ works }end compile #include #include #include + #include + #if _typ_u_long + u_long _test_dummy; + #endif }end { #ifndef _POSIX_SOURCE #define _POSIX_SOURCE 1 @@ -124,6 +157,10 @@ elif tst note{ _XOPEN_SOURCE & __EXTENSIONS__ works }end compile{ #include #include #include + #include + #if _typ_u_long + u_long _test_dummy; + #endif }end { #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 1 @@ -138,6 +175,10 @@ elif tst note{ _XOPEN_SOURCE works }end compile{ #include #include #include + #include + #if _typ_u_long + u_long _test_dummy; + #endif }end { #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 1 @@ -147,6 +188,10 @@ else tst note{ __EXTENSIONS__ works }end compile{ #define __EXTENSIONS__ 1 #include #include + #include + #if _typ_u_long + u_long _test_dummy; + #endif }end { #ifndef __EXTENSIONS__ #define __EXTENSIONS__ 1 @@ -167,19 +212,3 @@ if tst -D_ISOC99_SOURCE -lm note{ _ISOC99_SOURCE plays nice }end link{ #endif } endif - -cat{ - -/* - * this is a nasty game we all play to honor standards symbol visibility - * it would help if all implementations had - * _KITCHEN_SINK_SOURCE - * that enabled all symbols from the latest implemented standards - * that's probably the most useful but least portable request - */ - -#if __MACH__ -#undef _POSIX_SOURCE -#endif - -}end diff --git a/src/lib/libast/features/tty b/src/lib/libast/features/tty index 34ea8ed2e..179e0e85a 100644 --- a/src/lib/libast/features/tty +++ b/src/lib/libast/features/tty @@ -1,4 +1,4 @@ -hdr termios,termio,sgtty +hdr termios,termio,sgtty,sys/ioctl sys termios,termio,ioctl,bsdtty,nttyio,ttyio lib tcgetattr,tcgetpgrp termios.h mac _POSIX_VDISABLE termios.h @@ -107,6 +107,10 @@ cat{ # endif /* TCSANOW */ #endif /* _hdr_termios */ +#if _hdr_sys_ioctl +# include +#endif + /* set ECHOCTL if driver can echo control characters as ^c */ #ifdef LCTLECH # ifndef ECHOCTL