1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Remove more UWIN symbols (re: 0ea97b9d) and EMX support

This removes support for the (AFAIK, completely unavailable) UWIN
preprocessor, which used directives that nothing else understands,
hidden behind the following macros:
	__STDPP__
	__STDPP__directive
	__STDPP__hide
This mailing list post from 2001 says that __STDPP__ is UWIN:
https://lists.gnu.org/archive/html/bug-groff/2001-04/msg00030.html

This also removes code hidden by the __EMX__ symbol. EMX (Eberhard
Mattes eXtender) was a programming environment and POSIX interface
for MS-DOS and OS/2. The last release was in 1998.
https://en.wikipedia.org/wiki/EMX_%28programming_environment%29
This commit is contained in:
Martijn Dekker 2022-07-21 15:41:22 +02:00
parent d9a85caf22
commit 4c0df0e617
32 changed files with 21 additions and 333 deletions

View file

@ -66,7 +66,7 @@ then tmpdir=$TMPDIR
else tmpdir=/tmp else tmpdir=/tmp
fi fi
tmpdir=$tmpdir/probe$$ tmpdir=$tmpdir/probe$$
undef="define defined elif else endif error if ifdef ifndef include line pragma undef __STDC__ __STDPP__ __ARGC__ __BASE__ __BASE_FILE__ __DATE__ __FILE__ __FUNCTION__ __INCLUDE_LEVEL__ __LINE__ __PATH__ __TIME__ __TIMESTAMP__ __VERSION__" undef="define defined elif else endif error if ifdef ifndef include line pragma undef __STDC__ __ARGC__ __BASE__ __BASE_FILE__ __DATE__ __FILE__ __FUNCTION__ __INCLUDE_LEVEL__ __LINE__ __PATH__ __TIME__ __TIMESTAMP__ __VERSION__"
version_flags= version_flags=
version_stamp= version_stamp=
version_string= version_string=

View file

@ -3579,10 +3579,7 @@ $inc
[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]:[\\/]*|[\\/]*) [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]:[\\/]*|[\\/]*)
success success
case $o in case $o in
lcl) echo "#if defined(__STDPP__directive)" lcl) echo "#include <$i> /* the native <$f.h> */"
echo "__STDPP__directive pragma pp:hosted"
echo "#endif"
echo "#include <$i> /* the native <$f.h> */"
echo "#undef $m" echo "#undef $m"
usr="$usr$nl#define $m 1" usr="$usr$nl#define $m 1"
echo "#define $m 1" echo "#define $m 1"

View file

@ -3,12 +3,8 @@
* workarounds to bring the native interface close to POSIX and X/Open * workarounds to bring the native interface close to POSIX and X/Open
*/ */
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide utime utimes
#else
#define utime ______utime #define utime ______utime
#define utimes ______utimes #define utimes ______utimes
#endif
#include <ast.h> #include <ast.h>
#include <error.h> #include <error.h>
@ -33,12 +29,8 @@ __STDPP__directive pragma pp:hide utime utimes
#endif #endif
#endif #endif
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide utime utimes
#else
#undef utime #undef utime
#undef utimes #undef utimes
#endif
#ifndef MAX_PATH #ifndef MAX_PATH
#define MAX_PATH PATH_MAX #define MAX_PATH PATH_MAX

View file

@ -2,7 +2,7 @@
* * * *
* This software is part of the ast package * * This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property * * Copyright (c) 1985-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the * * and is licensed under the *
* Eclipse Public License, Version 1.0 * * Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property * * by AT&T Intellectual Property *
@ -21,19 +21,11 @@
* * * *
***********************************************************************/ ***********************************************************************/
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide strstr
#else
#define strstr ______strstr #define strstr ______strstr
#endif
#include <ast.h> #include <ast.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide strstr
#else
#undef strstr #undef strstr
#endif
#if _lib_strstr #if _lib_strstr

View file

@ -2,7 +2,7 @@
* * * *
* This software is part of the ast package * * This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property * * Copyright (c) 1985-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the * * and is licensed under the *
* Eclipse Public License, Version 1.0 * * Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property * * by AT&T Intellectual Property *
@ -24,19 +24,11 @@
* swab implementation * swab implementation
*/ */
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide swab
#else
#define swab ______swab #define swab ______swab
#endif
#include <ast.h> #include <ast.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide swab
#else
#undef swab #undef swab
#endif
#if _lib_swab #if _lib_swab

View file

@ -2,7 +2,7 @@
* * * *
* This software is part of the ast package * * This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property * * Copyright (c) 1985-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the * * and is licensed under the *
* Eclipse Public License, Version 1.0 * * Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property * * by AT&T Intellectual Property *
@ -29,23 +29,15 @@
#ifdef tempnam #ifdef tempnam
#define _def_tempnam 1 #define _def_tempnam 1
#else #else
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide tempnam
#else
#define tempnam ______tempnam #define tempnam ______tempnam
#endif #endif
#endif
#include <ast.h> #include <ast.h>
#include <stdio.h> #include <stdio.h>
#if !_def_tempnam #if !_def_tempnam
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide tempnam
#else
#undef tempnam #undef tempnam
#endif #endif
#endif
#if defined(__EXPORT__) #if defined(__EXPORT__)
#define extern __EXPORT__ #define extern __EXPORT__

View file

@ -30,14 +30,10 @@
#ifndef _DIRLIB_H #ifndef _DIRLIB_H
#define _DIRLIB_H #define _DIRLIB_H
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getdents getdirentries
#else
#undef getdents #undef getdents
#define getdents ______getdents #define getdents ______getdents
#undef getdirentries #undef getdirentries
#define getdirentries ______getdirentries #define getdirentries ______getdirentries
#endif
#include <ast.h> #include <ast.h>
#include <errno.h> #include <errno.h>
@ -69,9 +65,6 @@ __STDPP__directive pragma pp:hide getdents getdirentries
#define dirent DIRdirent #define dirent DIRdirent
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide DIR closedir opendir readdir seekdir telldir
#else
#undef DIR #undef DIR
#define DIR ______DIR #define DIR ______DIR
#undef closedir #undef closedir
@ -84,7 +77,6 @@ __STDPP__directive pragma pp:hide DIR closedir opendir readdir seekdir telldir
#define seekdir ______seekdir #define seekdir ______seekdir
#undef telldir #undef telldir
#define telldir ______telldir #define telldir ______telldir
#endif
#include <ast_param.h> #include <ast_param.h>
@ -104,16 +96,12 @@ __STDPP__directive pragma pp:hide DIR closedir opendir readdir seekdir telldir
#endif #endif
#undef dirent #undef dirent
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide DIR closedir opendir readdir seekdir telldir
#else
#undef DIR #undef DIR
#undef closedir #undef closedir
#undef opendir #undef opendir
#undef readdir #undef readdir
#undef seekdir #undef seekdir
#undef telldir #undef telldir
#endif
#define _DIR_PRIVATE_ \ #define _DIR_PRIVATE_ \
int dd_loc; /* offset in block */ \ int dd_loc; /* offset in block */ \
@ -140,12 +128,8 @@ __STDPP__directive pragma pp:nohide DIR closedir opendir readdir seekdir telldir
#endif #endif
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide getdents getdirentries
#else
#undef getdents #undef getdents
#undef getdirentries #undef getdirentries
#endif
#ifndef errno #ifndef errno
extern int errno; extern int errno;

View file

@ -60,7 +60,8 @@ cat{
#endif #endif
/* Windows variants and veneers */ /* Windows variants and veneers */
#if !defined(_WINIX) && (__CYGWIN__ || __EMX__) /* (as of 2022-07-21, only Cygwin) */
#if !defined(_WINIX) && __CYGWIN__
# define _WINIX 1 # define _WINIX 1
#endif #endif

View file

@ -69,27 +69,19 @@ elif ( _hdr_ndir ) {
#ifndef _DIRENT_H #ifndef _DIRENT_H
#define _DIRENT_H #define _DIRENT_H
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide closedir opendir readdir seekdir telldir
#else
#define closedir ______closedir #define closedir ______closedir
#define opendir ______opendir #define opendir ______opendir
#define readdir ______readdir #define readdir ______readdir
#define seekdir ______seekdir #define seekdir ______seekdir
#define telldir ______telldir #define telldir ______telldir
#endif
#include <ndir.h> #include <ndir.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide closedir opendir readdir seekdir telldir
#else
#undef closedir #undef closedir
#undef opendir #undef opendir
#undef readdir #undef readdir
#undef seekdir #undef seekdir
#undef telldir #undef telldir
#endif
#ifndef dirent #ifndef dirent
#define dirent direct #define dirent direct
@ -120,27 +112,19 @@ elif ( _sys_dir ) {
#ifndef _DIRENT_H #ifndef _DIRENT_H
#define _DIRENT_H #define _DIRENT_H
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide closedir opendir readdir seekdir telldir
#else
#define closedir ______closedir #define closedir ______closedir
#define opendir ______opendir #define opendir ______opendir
#define readdir ______readdir #define readdir ______readdir
#define seekdir ______seekdir #define seekdir ______seekdir
#define telldir ______telldir #define telldir ______telldir
#endif
#include <sys/dir.h> #include <sys/dir.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide closedir opendir readdir seekdir telldir
#else
#undef closedir #undef closedir
#undef opendir #undef opendir
#undef readdir #undef readdir
#undef seekdir #undef seekdir
#undef telldir #undef telldir
#endif
#ifndef dirent #ifndef dirent
#define dirent direct #define dirent direct

View file

@ -41,9 +41,6 @@ macro{
#ifndef major #ifndef major
#include <sys/sysmacros.h> #include <sys/sysmacros.h>
#endif #endif
<<"#if defined(__STDPP__directive) && defined(__STDPP__initial)">>
<<"__STDPP__directive pragma pp:initial">>
<<"#endif">>
<<"#ifndef major">> <<"#ifndef major">>
#ifdef major #ifdef major
<<"#define major(x)">> major((x)) <<"#define major(x)">> major((x))
@ -78,9 +75,6 @@ macro{
#endif #endif
<<"#endif">> <<"#endif">>
#endif #endif
<<"#if defined(__STDPP__directive) && defined(__STDPP__initial)">>
<<"__STDPP__directive pragma pp:noinitial">>
<<"#endif">>
}end fail{ }end fail{
cat <<! cat <<!
#ifndef major #ifndef major

View file

@ -31,12 +31,8 @@
* NOTE: two's complement binary integral representation assumed * NOTE: two's complement binary integral representation assumed
*/ */
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getpagesize getdtablesize
#else
#define getpagesize ______getpagesize #define getpagesize ______getpagesize
#define getdtablesize ______getdtablesize #define getdtablesize ______getdtablesize
#endif
/* /*
* we'd like as many symbols as possible defined * we'd like as many symbols as possible defined
@ -74,12 +70,8 @@ __STDPP__directive pragma pp:hide getpagesize getdtablesize
#include "FEATURE/param" #include "FEATURE/param"
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide getpagesize getdtablesize
#else
#undef getpagesize #undef getpagesize
#undef getdtablesize #undef getdtablesize
#endif
int main() int main()
{ {

View file

@ -48,11 +48,9 @@ tst note{ check for Win32 .exe botches }end output{
fix++,printf("#define _win32_botch_copy 1\n"); fix++,printf("#define _win32_botch_copy 1\n");
if (_getpagesize() != 64 * 1024) if (_getpagesize() != 64 * 1024)
fix++,printf("#define _win32_botch_getpagesize 1\n"); fix++,printf("#define _win32_botch_getpagesize 1\n");
#if !__EMX__
if (_link("foo", "bar") || _access("bar.exe", X_OK)) if (_link("foo", "bar") || _access("bar.exe", X_OK))
fix++,printf("#define _win32_botch_link 1\n"); fix++,printf("#define _win32_botch_link 1\n");
else else
#endif
cp("foo.exe", "bar.exe"); cp("foo.exe", "bar.exe");
if ((fd = _open("foo", O_RDONLY)) < 0) if ((fd = _open("foo", O_RDONLY)) < 0)
fix++,printf("#define _win32_botch_open 1\n"); fix++,printf("#define _win32_botch_open 1\n");

View file

@ -2,7 +2,7 @@
# # # #
# This software is part of the ast package # # This software is part of the ast package #
# Copyright (c) 1985-2011 AT&T Intellectual Property # # Copyright (c) 1985-2011 AT&T Intellectual Property #
# Copyright (c) 2020-2021 Contributors to ksh 93u+m # # Copyright (c) 2020-2022 Contributors to ksh 93u+m #
# and is licensed under the # # and is licensed under the #
# Eclipse Public License, Version 1.0 # # Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property # # by AT&T Intellectual Property #
@ -38,19 +38,11 @@ int xxx;" > $tmp.c
$cc -c $tmp.c >/dev/null 2>$tmp.e $cc -c $tmp.c >/dev/null 2>$tmp.e
echo "#define sig_info _sig_info_ echo "#define sig_info _sig_info_
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide kill killpg
#else
#define kill ______kill #define kill ______kill
#define killpg ______killpg #define killpg ______killpg
#endif
#include <signal.h> #include <signal.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide kill killpg
#else
#undef kill #undef kill
#undef killpg #undef killpg
#endif
#ifndef sigmask #ifndef sigmask
#define sigmask(s) (1<<((s)-1)) #define sigmask(s) (1<<((s)-1))
#endif" #endif"

View file

@ -195,9 +195,6 @@ output{
} }
}end }end
macro{ macro{
<<"#if defined(__STDPP__directive) && defined(__STDPP__initial)">>
<<"__STDPP__directive pragma pp:initial">>
<<"#endif">>
<<"#ifndef P_tmpdir">> <<"#ifndef P_tmpdir">>
#ifndef P_tmpdir #ifndef P_tmpdir
#define P_tmpdir "/var/tmp/" #define P_tmpdir "/var/tmp/"
@ -216,9 +213,6 @@ macro{
#endif #endif
<<"#define L_tmpnam">> L_tmpnam <<"#define L_tmpnam">> L_tmpnam
<<"#endif">> <<"#endif">>
<<"#if defined(__STDPP__directive) && defined(__STDPP__initial)">>
<<"__STDPP__directive pragma pp:noinitial">>
<<"#endif">>
}end }end
cat{ cat{
extern char* ctermid(char*); extern char* ctermid(char*);

View file

@ -2,7 +2,7 @@
* * * *
* This software is part of the ast package * * This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property * * Copyright (c) 1985-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the * * and is licensed under the *
* Eclipse Public License, Version 1.0 * * Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property * * by AT&T Intellectual Property *
@ -31,20 +31,12 @@
#include <ast_wait.h> #include <ast_wait.h>
#if _sys_wait #if _sys_wait
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide wait waitpid
#else
#define wait ______wait #define wait ______wait
#define waitpid ______waitpid #define waitpid ______waitpid
#endif
#include <sys/wait.h> #include <sys/wait.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide wait waitpid
#else
#undef wait #undef wait
#undef waitpid #undef waitpid
#endif #endif
#endif
#ifndef WNOHANG #ifndef WNOHANG
#define WNOHANG 1 #define WNOHANG 1

View file

@ -2,7 +2,7 @@
* * * *
* This software is part of the ast package * * This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property * * Copyright (c) 1985-2011 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the * * and is licensed under the *
* Eclipse Public License, Version 1.0 * * Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property * * by AT&T Intellectual Property *
@ -36,15 +36,11 @@
#ifndef _UNIVLIB_H #ifndef _UNIVLIB_H
#define _UNIVLIB_H #define _UNIVLIB_H
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getuniverse readlink setuniverse symlink universe
#else
#define getuniverse ______getuniverse #define getuniverse ______getuniverse
#define readlink ______readlink #define readlink ______readlink
#define setuniverse ______setuniverse #define setuniverse ______setuniverse
#define symlink ______symlink #define symlink ______symlink
#define universe ______universe #define universe ______universe
#endif
#include <ast.h> #include <ast.h>
#include <ls.h> #include <ls.h>
@ -56,15 +52,11 @@ __STDPP__directive pragma pp:hide getuniverse readlink setuniverse symlink unive
#include <sys/universe.h> #include <sys/universe.h>
#endif #endif
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide getuniverse readlink setuniverse symlink universe
#else
#undef getuniverse #undef getuniverse
#undef readlink #undef readlink
#undef setuniverse #undef setuniverse
#undef symlink #undef symlink
#undef universe #undef universe
#endif
#if _cmd_universe #if _cmd_universe
#ifdef NUMUNIV #ifdef NUMUNIV

View file

@ -40,11 +40,7 @@
int int
pathicase(const char *path) pathicase(const char *path)
{ {
#ifdef _PC_PATH_ATTRIBUTES #if _lib_pathconf && defined(_PC_CASE_SENSITIVE)
/* AT&T mystery system (AST UWIN?) */
char *a = astconf("PATH_ATTRIBUTES", path, (char*)0);
return a ? strchr(a,'c') != 0 : -1;
#elif _lib_pathconf && defined(_PC_CASE_SENSITIVE)
/* macOS; QNX 7.0+ */ /* macOS; QNX 7.0+ */
long r = pathconf(path, _PC_CASE_SENSITIVE); long r = pathconf(path, _PC_CASE_SENSITIVE);
return r < 0L ? -1 : r == 0L; return r < 0L ? -1 : r == 0L;

View file

@ -55,30 +55,7 @@ pathnative(const char* path, char* buf, size_t siz)
return strlen(buf); return strlen(buf);
} }
#else #elif __INTERIX
#if __EMX__
size_t
pathnative(const char* path, char* buf, size_t siz)
{
char* s;
size_t n;
if (!_fullpath(buf, path, siz))
{
for (s = buf; *s; s++)
if (*s == '/')
*s = '\\';
}
else if ((n = strlen(path)) < siz && buf)
memcpy(buf, path, n + 1);
return n;
}
#else
#if __INTERIX
#include <interix/interix.h> #include <interix/interix.h>
@ -106,7 +83,3 @@ pathnative(const char* path, char* buf, size_t siz)
} }
#endif #endif
#endif
#endif

View file

@ -55,30 +55,7 @@ pathposix(const char* path, char* buf, size_t siz)
return strlen(buf); return strlen(buf);
} }
#else #elif __INTERIX
#if __EMX__ && 0 /* show me the docs */
size_t
pathposix(const char* path, char* buf, size_t siz)
{
char* s;
size_t n;
if (!_posixpath(buf, path, siz))
{
for (s = buf; *s; s++)
if (*s == '/')
*s = '\\';
}
else if ((n = strlen(path)) < siz && buf)
memcpy(buf, path, n + 1);
return n;
}
#else
#if __INTERIX
#include <interix/interix.h> #include <interix/interix.h>
@ -108,7 +85,3 @@ pathposix(const char* path, char* buf, size_t siz)
} }
#endif #endif
#endif
#endif

View file

@ -654,32 +654,7 @@ format(register Feature_t* fp, const char* path, const char* value, unsigned int
break; break;
case OP_path_attributes: case OP_path_attributes:
#ifdef _PC_PATH_ATTRIBUTES
{
register char* s;
register char* e;
intmax_t v;
/*
* _PC_PATH_ATTRIBUTES is a bitmap for 'a' to 'z'
*/
if ((v = pathconf(path, _PC_PATH_ATTRIBUTES)) == -1L)
return 0;
s = fp->value;
e = s + sizeof(fp->value) - 1;
for (n = 'a'; n <= 'z'; n++)
if (v & (1 << (n - 'a')))
{
*s++ = n;
if (s >= e)
break;
}
*s = 0;
}
#else
fp->value = pathicase(path) > 0 ? "c" : null; fp->value = pathicase(path) > 0 ? "c" : null;
#endif
break; break;
case OP_path_resolve: case OP_path_resolve:

View file

@ -2,7 +2,7 @@
* * * *
* This software is part of the ast package * * This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property * * Copyright (c) 1985-2012 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the * * and is licensed under the *
* Eclipse Public License, Version 1.0 * * Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property * * by AT&T Intellectual Property *
@ -33,12 +33,8 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide ioctl sleep
#else
#define ioctl ______ioctl #define ioctl ______ioctl
#define sleep ______sleep #define sleep ______sleep
#endif
#if defined(TIOCGWINSZ) #if defined(TIOCGWINSZ)
#if _sys_stream && _sys_ptem #if _sys_stream && _sys_ptem
@ -59,12 +55,8 @@ __STDPP__directive pragma pp:hide ioctl sleep
#endif #endif
#endif #endif
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide ioctl sleep
#else
#undef ioctl #undef ioctl
#undef sleep #undef sleep
#endif
static int ttctl(int, int, void*); static int ttctl(int, int, void*);

View file

@ -460,12 +460,8 @@ mntclose(void* handle)
#if _lib_getmntent && ( _hdr_mntent || _sys_mntent && !_sys_mnttab ) #if _lib_getmntent && ( _hdr_mntent || _sys_mntent && !_sys_mnttab )
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide endmntent getmntent
#else
#define endmntent ______endmntent #define endmntent ______endmntent
#define getmntent ______getmntent #define getmntent ______getmntent
#endif
#include <stdio.h> #include <stdio.h>
#if _hdr_mntent #if _hdr_mntent
@ -474,12 +470,8 @@ __STDPP__directive pragma pp:hide endmntent getmntent
#include <sys/mntent.h> #include <sys/mntent.h>
#endif #endif
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide endmntent getmntent
#else
#undef endmntent #undef endmntent
#undef getmntent #undef getmntent
#endif
extern int endmntent(FILE*); extern int endmntent(FILE*);
extern struct mntent* getmntent(FILE*); extern struct mntent* getmntent(FILE*);

View file

@ -20,19 +20,11 @@
* Phong Vo <kpv@research.att.com> * * Phong Vo <kpv@research.att.com> *
* * * *
***********************************************************************/ ***********************************************************************/
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getpagesize
#else
#define getpagesize ______getpagesize #define getpagesize ______getpagesize
#endif
#include "sfhdr.h" #include "sfhdr.h"
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide getpagesize
#else
#undef getpagesize #undef getpagesize
#endif
#if _lib_getpagesize #if _lib_getpagesize
extern int getpagesize(void); extern int getpagesize(void);

View file

@ -27,21 +27,13 @@
* cached GID number -> group name * cached GID number -> group name
*/ */
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getgrgid
#else
#define getgrgid ______getgrgid #define getgrgid ______getgrgid
#endif
#include <ast.h> #include <ast.h>
#include <cdt.h> #include <cdt.h>
#include <grp.h> #include <grp.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide getgrgid
#else
#undef getgrgid #undef getgrgid
#endif
extern struct group* getgrgid(gid_t); extern struct group* getgrgid(gid_t);

View file

@ -27,21 +27,13 @@
* UID number -> user name * UID number -> user name
*/ */
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getpwuid
#else
#define getpwuid ______getpwuid #define getpwuid ______getpwuid
#endif
#include <ast.h> #include <ast.h>
#include <cdt.h> #include <cdt.h>
#include <pwd.h> #include <pwd.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide getpwuid
#else
#undef getpwuid #undef getpwuid
#endif
extern struct passwd* getpwuid(uid_t); extern struct passwd* getpwuid(uid_t);

View file

@ -2,7 +2,7 @@
* * * *
* This software is part of the ast package * * This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property * * Copyright (c) 1985-2012 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the * * and is licensed under the *
* Eclipse Public License, Version 1.0 * * Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property * * by AT&T Intellectual Property *
@ -25,22 +25,14 @@
#define VMDEBUG 0 #define VMDEBUG 0
#if defined(_MSVCRT_H) #if defined(_MSVCRT_H)
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide strdup
#else
#define strdup ______strdup #define strdup ______strdup
#endif #endif
#endif
#include <ast.h> #include <ast.h>
#if defined(_MSVCRT_H) #if defined(_MSVCRT_H)
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide strdup
#else
#undef strdup #undef strdup
#endif #endif
#endif
/* /*
* return a copy of s using malloc * return a copy of s using malloc

View file

@ -27,26 +27,18 @@
* group name -> GID number * group name -> GID number
*/ */
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getgrgid getgrnam getpwnam
#else
#define getgrgid ______getgrgid #define getgrgid ______getgrgid
#define getgrnam ______getgrnam #define getgrnam ______getgrnam
#define getpwnam ______getpwnam #define getpwnam ______getpwnam
#endif
#include <ast.h> #include <ast.h>
#include <cdt.h> #include <cdt.h>
#include <pwd.h> #include <pwd.h>
#include <grp.h> #include <grp.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide getgrgid getgrnam getpwnam
#else
#undef getgrgid #undef getgrgid
#undef getgrnam #undef getgrnam
#undef getpwnam #undef getpwnam
#endif
extern struct group* getgrgid(gid_t); extern struct group* getgrgid(gid_t);
extern struct group* getgrnam(const char*); extern struct group* getgrnam(const char*);

View file

@ -27,23 +27,15 @@
* user name -> UID * user name -> UID
*/ */
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getpwnam getpwuid
#else
#define getpwnam ______getpwnam #define getpwnam ______getpwnam
#define getpwuid ______getpwuid #define getpwuid ______getpwuid
#endif
#include <ast.h> #include <ast.h>
#include <cdt.h> #include <cdt.h>
#include <pwd.h> #include <pwd.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide getpwnam getpwuid
#else
#undef getpwnam #undef getpwnam
#undef getpwuid #undef getpwuid
#endif
extern struct passwd* getpwnam(const char*); extern struct passwd* getpwnam(const char*);
extern struct passwd* getpwuid(uid_t); extern struct passwd* getpwuid(uid_t);

View file

@ -2,7 +2,7 @@
* * * *
* This software is part of the ast package * * This software is part of the ast package *
* Copyright (c) 1985-2013 AT&T Intellectual Property * * Copyright (c) 1985-2013 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the * * and is licensed under the *
* Eclipse Public License, Version 1.0 * * Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property * * by AT&T Intellectual Property *
@ -27,11 +27,7 @@
* Tv_t conversion support * Tv_t conversion support
*/ */
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide utime
#else
#define utime ______utime #define utime ______utime
#endif
#ifndef _ATFILE_SOURCE #ifndef _ATFILE_SOURCE
#define _ATFILE_SOURCE 1 #define _ATFILE_SOURCE 1
@ -49,11 +45,7 @@ __STDPP__directive pragma pp:hide utime
#include <utime.h> #include <utime.h>
#endif #endif
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide utime
#else
#undef utime #undef utime
#endif
#if _lib_utime #if _lib_utime
#if _hdr_utime #if _hdr_utime

View file

@ -97,11 +97,7 @@ static const char usage_3[] =
"[+SEE ALSO?\bchmod\b(1), \bchown\b(2), \btw\b(1), \bgetconf\b(1), \bls\b(1)]" "[+SEE ALSO?\bchmod\b(1), \bchown\b(2), \btw\b(1), \bgetconf\b(1), \bls\b(1)]"
; ;
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide lchown
#else
#define lchown ______lchown #define lchown ______lchown
#endif
#include <cmd.h> #include <cmd.h>
#include <cdt.h> #include <cdt.h>
@ -111,11 +107,7 @@ __STDPP__directive pragma pp:hide lchown
#include "FEATURE/symlink" #include "FEATURE/symlink"
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide lchown
#else
#undef lchown #undef lchown
#endif
typedef struct Key_s /* UID/GID key */ typedef struct Key_s /* UID/GID key */
{ {

View file

@ -2,7 +2,7 @@
* * * *
* This software is part of the ast package * * This software is part of the ast package *
* Copyright (c) 1992-2012 AT&T Intellectual Property * * Copyright (c) 1992-2012 AT&T Intellectual Property *
* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * Copyright (c) 2020-2022 Contributors to ksh 93u+m *
* and is licensed under the * * and is licensed under the *
* Eclipse Public License, Version 1.0 * * Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property * * by AT&T Intellectual Property *
@ -127,11 +127,7 @@ static const char usage[] =
; ;
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide lchmod
#else
#define lchmod ______lchmod #define lchmod ______lchmod
#endif
#include <cmd.h> #include <cmd.h>
#include <ls.h> #include <ls.h>
@ -139,11 +135,7 @@ __STDPP__directive pragma pp:hide lchmod
#include "FEATURE/symlink" #include "FEATURE/symlink"
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide lchmod
#else
#undef lchmod #undef lchmod
#endif
extern int lchmod(const char*, mode_t); extern int lchmod(const char*, mode_t);

View file

@ -69,14 +69,10 @@ static const char usage[] =
" \bsysconf\b(3), \bsysinfo\b(2)]" " \bsysconf\b(3), \bsysinfo\b(2)]"
; ;
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getdomainname gethostid gethostname sethostname
#else
#define getdomainname ______getdomainname #define getdomainname ______getdomainname
#define gethostid ______gethostid #define gethostid ______gethostid
#define gethostname ______gethostname #define gethostname ______gethostname
#define sethostname ______sethostname #define sethostname ______sethostname
#endif
#include <cmd.h> #include <cmd.h>
#include <ctype.h> #include <ctype.h>
@ -91,14 +87,10 @@ __STDPP__directive pragma pp:hide getdomainname gethostid gethostname sethostnam
# include <sys/utsname.h> # include <sys/utsname.h>
#endif #endif
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide getdomainname gethostid gethostname sethostname
#else
#undef getdomainname #undef getdomainname
#undef gethostid #undef gethostid
#undef gethostname #undef gethostname
#undef sethostname #undef sethostname
#endif
#if _lib_getdomainname #if _lib_getdomainname
extern int getdomainname(char*, size_t); extern int getdomainname(char*, size_t);
@ -121,18 +113,6 @@ static const char hosttype[] = HOSTTYPE;
#if !_lib_uname || !_sys_utsname #if !_lib_uname || !_sys_utsname
#if defined(__STDPP__)
#define SYSNAME #(getprd machine)
#define RELEASE #(getprd release)
#define VERSION #(getprd version)
#define MACHINE #(getprd architecture)
#else
#define SYSNAME ""
#define RELEASE ""
#define VERSION ""
#define MACHINE ""
#endif
struct utsname struct utsname
{ {
char* sysname; char* sysname;
@ -174,14 +154,13 @@ uname(register struct utsname* ut)
#ifdef HOSTTYPE #ifdef HOSTTYPE
if (!(ut->sysname = sys)) if (!(ut->sysname = sys))
#endif #endif
if (!*(ut->sysname = SYSNAME)) ut->sysname = ut->nodename;
ut->sysname = ut->nodename;
#ifdef HOSTTYPE #ifdef HOSTTYPE
if (!(ut->machine = arch)) if (!(ut->machine = arch))
#endif #endif
ut->machine = MACHINE; ut->machine = "";
ut->release = RELEASE; ut->release = "";
ut->version = VERSION; ut->version = "";
return 0; return 0;
} }
@ -215,14 +194,6 @@ uname(register struct utsname* ut)
#define OPT_total (1L<<30) #define OPT_total (1L<<30)
#define OPT_standard ((1<<OPT_STANDARD)-1) #define OPT_standard ((1<<OPT_STANDARD)-1)
#ifndef MACHINE
#if defined(__STDPP__)
#define MACHINE #(getprd architecture)
#else
#define MACHINE ""
#endif
#endif
#ifndef HOSTTYPE #ifndef HOSTTYPE
#define HOSTTYPE "unknown" #define HOSTTYPE "unknown"
#endif #endif