From 3de4da5afbddc7315dfc227e6ad14dcfa24cd908 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Thu, 21 Jul 2022 18:26:42 +0200 Subject: [PATCH] Remove Microsoft/Cygwin import/export nonsense Windows/Cygwin requires onerous special handling and the definition of additional _imp__* symbols to import/export symbols between dynamically linked binaries. Its support in AST used a lot of macros and code obfuscation. In the features/common test for this, AT&T called this the "Microsoft import/export nonsense". They're right, it's nonsense. Somehow, Microsoft's POSIX layer, SFU/Interix, always managed without it. No one has time to maintain this (especially considering how incredibly sluggish Cygwin is). And in fact, it had already fallen victim to bit rot; I confirmed this in my early experiments with reintroducing dynamic library support. No one has time to fix it, either. So, my apologies to any Cygwin fans; ksh 93u+m will never support dynamically loadable built-ins on Cygwin, even when I do manage to reintroduce dynamic linking properly. --- src/cmd/ksh93/include/builtins.h | 6 ----- src/cmd/ksh93/include/io.h | 3 --- src/cmd/ksh93/include/nval.h | 7 ------ src/cmd/ksh93/include/path.h | 4 --- src/cmd/ksh93/include/shell.h | 8 ------ src/cmd/ksh93/include/shnodes.h | 3 --- src/cmd/ksh93/sh/defs.c | 3 --- src/cmd/ksh93/sh/fcin.c | 4 --- src/cmd/ksh93/sh/streval.c | 6 ----- src/lib/libast/cdt/cdtlib.h | 33 +----------------------- src/lib/libast/cdt/dtcomp.c | 6 +---- src/lib/libast/cdt/dthash.c | 11 +++----- src/lib/libast/cdt/dtlist.c | 10 ++++---- src/lib/libast/cdt/dttree.c | 9 +++---- src/lib/libast/comp/basename.c | 6 +---- src/lib/libast/comp/dirname.c | 6 +---- src/lib/libast/comp/eaccess.c | 4 --- src/lib/libast/comp/execlp.c | 10 +------- src/lib/libast/comp/execve.c | 6 +---- src/lib/libast/comp/execvp.c | 10 +------- src/lib/libast/comp/execvpe.c | 10 +------- src/lib/libast/comp/fmtmsg.h | 23 +---------------- src/lib/libast/comp/fnmatch.c | 6 +---- src/lib/libast/comp/fnmatch.h | 8 +----- src/lib/libast/comp/ftw.h | 8 +----- src/lib/libast/comp/getdate.c | 8 ++---- src/lib/libast/comp/getgroups.c | 6 +---- src/lib/libast/comp/getlogin.c | 6 +---- src/lib/libast/comp/getpgrp.c | 6 +---- src/lib/libast/comp/libgen.h | 17 +------------ src/lib/libast/comp/mktemp.c | 6 +---- src/lib/libast/comp/mktime.c | 6 +---- src/lib/libast/comp/omitted.c | 21 ---------------- src/lib/libast/comp/putenv.c | 4 --- src/lib/libast/comp/re_comp.h | 8 +----- src/lib/libast/comp/realpath.c | 6 +---- src/lib/libast/comp/regcmp.c | 4 +-- src/lib/libast/comp/regexp.h | 8 +----- src/lib/libast/comp/remove.c | 6 +---- src/lib/libast/comp/resolvepath.c | 6 +---- src/lib/libast/comp/setenv.c | 6 +---- src/lib/libast/comp/statvfs.c | 10 +------- src/lib/libast/comp/strftime.c | 6 +---- src/lib/libast/comp/strptime.c | 6 +---- src/lib/libast/comp/strstr.c | 4 --- src/lib/libast/comp/swab.c | 4 --- src/lib/libast/comp/syslog.h | 15 ----------- src/lib/libast/comp/system.c | 6 +---- src/lib/libast/comp/tempnam.c | 4 --- src/lib/libast/comp/tmpnam.c | 6 +---- src/lib/libast/comp/transition.c | 6 +---- src/lib/libast/comp/unsetenv.c | 6 +---- src/lib/libast/comp/vfork.c | 4 --- src/lib/libast/comp/wordexp.h | 8 +----- src/lib/libast/features/common | 40 +++--------------------------- src/lib/libast/features/iconv | 6 ----- src/lib/libast/features/map.c | 4 --- src/lib/libast/features/nl_types | 6 ----- src/lib/libast/features/sig.sh | 17 +------------ src/lib/libast/features/stdio | 19 -------------- src/lib/libast/features/sys | 4 --- src/lib/libast/features/tmx | 4 --- src/lib/libast/features/tv | 4 --- src/lib/libast/features/wchar | 4 --- src/lib/libast/include/aso.h | 20 +-------------- src/lib/libast/include/ast.h | 12 --------- src/lib/libast/include/ast_std.h | 21 ---------------- src/lib/libast/include/ccode.h | 8 +----- src/lib/libast/include/cdt.h | 24 +----------------- src/lib/libast/include/cmdarg.h | 6 ----- src/lib/libast/include/debug.h | 8 +----- src/lib/libast/include/dt.h | 8 +----- src/lib/libast/include/error.h | 15 ----------- src/lib/libast/include/find.h | 6 ----- src/lib/libast/include/fts.h | 8 +----- src/lib/libast/include/ftwalk.h | 8 +----- src/lib/libast/include/glob.h | 8 +----- src/lib/libast/include/hash.h | 8 +----- src/lib/libast/include/hashkey.h | 8 +----- src/lib/libast/include/ip6.h | 8 +----- src/lib/libast/include/ls.h | 8 +----- src/lib/libast/include/magic.h | 6 ----- src/lib/libast/include/mc.h | 8 +----- src/lib/libast/include/mime.h | 6 ----- src/lib/libast/include/mnt.h | 8 +----- src/lib/libast/include/modex.h | 8 +----- src/lib/libast/include/option.h | 15 ----------- src/lib/libast/include/proc.h | 6 ----- src/lib/libast/include/recfmt.h | 8 +----- src/lib/libast/include/regex.h | 6 ----- src/lib/libast/include/sfdisc.h | 8 +----- src/lib/libast/include/sfio.h | 15 ----------- src/lib/libast/include/shcmd.h | 6 ----- src/lib/libast/include/stack.h | 8 +----- src/lib/libast/include/stk.h | 17 +------------ src/lib/libast/include/swap.h | 8 +----- src/lib/libast/include/times.h | 8 +----- src/lib/libast/include/tm.h | 17 +------------ src/lib/libast/include/tok.h | 8 +----- src/lib/libast/include/vecargs.h | 8 +----- src/lib/libast/include/vmalloc.h | 15 +---------- src/lib/libast/misc/error.c | 14 ++--------- src/lib/libast/misc/getenv.c | 4 --- src/lib/libast/misc/optget.c | 10 ++------ src/lib/libast/misc/sigdata.c | 6 ++--- src/lib/libast/misc/signal.c | 4 --- src/lib/libast/misc/state.c | 2 +- src/lib/libast/misc/stk.c | 4 +-- src/lib/libast/port/lcgen.c | 5 ---- src/lib/libast/regex/regexec.c | 6 +---- src/lib/libast/regex/regnexec.c | 6 +---- src/lib/libast/regex/regrexec.c | 6 +---- src/lib/libast/regex/regsubexec.c | 6 +---- src/lib/libast/sfio/_sfgetl.c | 6 +---- src/lib/libast/sfio/_sfgetl2.c | 8 +----- src/lib/libast/sfio/_sfgetu.c | 6 +---- src/lib/libast/sfio/_sfgetu2.c | 8 +----- src/lib/libast/sfio/_sfopen.c | 5 ---- src/lib/libast/sfio/sfextern.c | 19 +++----------- src/lib/libast/sfio/sfhdr.h | 9 ------- src/lib/libast/sfio/sfpeek.c | 6 +---- src/lib/libast/sfio/sfstrtof.h | 14 +++-------- src/lib/libast/stdio/_filbuf.c | 4 --- src/lib/libast/stdio/_flsbuf.c | 4 --- src/lib/libast/stdio/stdhdr.h | 4 --- src/lib/libast/string/strdup.c | 4 --- src/lib/libast/string/strerror.c | 6 +---- src/lib/libast/string/strlcat.c | 6 +---- src/lib/libast/string/strlcpy.c | 6 +---- src/lib/libast/string/strtoi.h | 6 +---- src/lib/libast/tm/tmdata.c | 18 ++------------ src/lib/libast/tm/tminit.c | 18 ++------------ src/lib/libast/tm/tmlocale.c | 4 +-- src/lib/libast/vmalloc/malloc.c | 28 ++------------------- src/lib/libast/vmalloc/vmbest.c | 10 ++++---- src/lib/libast/vmalloc/vmdcheap.c | 2 +- src/lib/libast/vmalloc/vmdebug.c | 2 +- src/lib/libast/vmalloc/vmlast.c | 2 +- src/lib/libast/vmalloc/vmpool.c | 2 +- src/lib/libast/vmalloc/vmprofile.c | 2 +- src/lib/libcmd/cmd.h | 14 +---------- src/lib/libdll/dlfcn.c | 6 +---- src/lib/libdll/features/dll | 6 ----- 143 files changed, 125 insertions(+), 1083 deletions(-) diff --git a/src/cmd/ksh93/include/builtins.h b/src/cmd/ksh93/include/builtins.h index 37c90903e..c08086514 100644 --- a/src/cmd/ksh93/include/builtins.h +++ b/src/cmd/ksh93/include/builtins.h @@ -63,10 +63,6 @@ /* entry point for shell special builtins */ -#if defined(__EXPORT__) -# define extern __EXPORT__ -#endif - extern int b_alias(int, char*[],Shbltin_t*); extern int b_break(int, char*[],Shbltin_t*); extern int b_dot_cmd(int, char*[],Shbltin_t*); @@ -129,8 +125,6 @@ extern int b_times(int, char*[],Shbltin_t*); extern short b_enum_nelem(Namfun_t*); -#undef extern - extern const char e_alrm1[]; extern const char e_alrm2[]; extern const char e_badfun[]; diff --git a/src/cmd/ksh93/include/io.h b/src/cmd/ksh93/include/io.h index b6821541d..9a4bb80b7 100644 --- a/src/cmd/ksh93/include/io.h +++ b/src/cmd/ksh93/include/io.h @@ -59,9 +59,6 @@ extern int sh_iorenumber(int,int); extern void sh_pclose(int[]); extern int sh_rpipe(int[]); extern void sh_iorestore(int,int); -#if defined(__EXPORT__) && defined(_BLD_DLL) - __EXPORT__ -#endif extern Sfio_t *sh_iostream(int); extern int sh_redirect(struct ionod*,int); extern void sh_iosave(int,int,char*); diff --git a/src/cmd/ksh93/include/nval.h b/src/cmd/ksh93/include/nval.h index 6d9963fdb..8de446d3b 100644 --- a/src/cmd/ksh93/include/nval.h +++ b/src/cmd/ksh93/include/nval.h @@ -237,9 +237,6 @@ struct Namval #define NV_DCADD 0 /* used to add named disciplines */ #define NV_DCRESTRICT 1 /* variable that are restricted in rsh */ -#if defined(__EXPORT__) && defined(_DLL) -# define extern __EXPORT__ -#endif /* _DLL */ /* prototype for array interface */ extern Namarr_t *nv_arrayptr(Namval_t*); extern Namarr_t *nv_setarray(Namval_t*,void*(*)(Namval_t*,const char*,int)); @@ -289,10 +286,6 @@ extern Namval_t *nv_type(Namval_t*); extern void nv_addtype(Namval_t*,const char*, Optdisc_t*, size_t); extern const Namdisc_t *nv_discfun(int); -#ifdef _DLL -# undef extern -#endif /* _DLL */ - #define nv_unset(np) _nv_unset(np,0) #define nv_size(np) nv_setsize((np),-1) #define nv_stack(np,nf) nv_disc(np,nf,0) diff --git a/src/cmd/ksh93/include/path.h b/src/cmd/ksh93/include/path.h index 081d07b01..543ec06bb 100644 --- a/src/cmd/ksh93/include/path.h +++ b/src/cmd/ksh93/include/path.h @@ -83,12 +83,8 @@ extern char *path_fullname(const char*); extern int path_expand(const char*, struct argnod**); extern noreturn void path_exec(const char*,char*[],struct argnod*); extern pid_t path_spawn(const char*,char*[],char*[],Pathcomp_t*,int); -#if defined(__EXPORT__) && defined(_BLD_DLL) -# define extern __EXPORT__ -#endif extern int path_open(const char*,Pathcomp_t*); extern Pathcomp_t *path_get(const char*); -#undef extern extern char *path_pwd(void); extern Pathcomp_t *path_nextcomp(Pathcomp_t*,const char*,Pathcomp_t*); extern int path_search(const char*,Pathcomp_t**,int); diff --git a/src/cmd/ksh93/include/shell.h b/src/cmd/ksh93/include/shell.h index 7f98ab8cb..e047746a0 100644 --- a/src/cmd/ksh93/include/shell.h +++ b/src/cmd/ksh93/include/shell.h @@ -419,10 +419,6 @@ extern Libcomp_t *liblist; #undef getenv /* -lshell provides its own */ -#if defined(__EXPORT__) && defined(_DLL) -# define extern __EXPORT__ -#endif /* _DLL */ - extern void sh_subfork(void); extern Shell_t *sh_init(int,char*[],Shinit_f); extern int sh_reinit(char*[]); @@ -472,10 +468,6 @@ extern int sh_exec(const Shnode_t*,int); extern Shell_t sh; #define sh_getinterp() (&sh) -#ifdef _DLL -# undef extern -#endif /* _DLL */ - #define chdir(a) sh_chdir(a) #define fchdir(a) sh_fchdir(a) #ifndef defs_h_defined diff --git a/src/cmd/ksh93/include/shnodes.h b/src/cmd/ksh93/include/shnodes.h index 81e120c6b..1ca5c4ce6 100644 --- a/src/cmd/ksh93/include/shnodes.h +++ b/src/cmd/ksh93/include/shnodes.h @@ -212,9 +212,6 @@ union Shnode_u extern void sh_freeup(void); extern void sh_funstaks(struct slnod*,int); extern Sfio_t *sh_subshell(Shnode_t*, volatile int, int); -#if defined(__EXPORT__) && defined(_BLD_DLL) - __EXPORT__ -#endif extern int sh_tdump(Sfio_t*, const Shnode_t*); extern Shnode_t *sh_trestore(Sfio_t*); diff --git a/src/cmd/ksh93/sh/defs.c b/src/cmd/ksh93/sh/defs.c index c26db8929..ba0f6d03a 100644 --- a/src/cmd/ksh93/sh/defs.c +++ b/src/cmd/ksh93/sh/defs.c @@ -32,9 +32,6 @@ #include "timeout.h" Shell_t sh = {0}; -#ifdef __IMPORT__ - Shell_t *_imp__sh = &sh; -#endif Dtdisc_t _Nvdisc = { diff --git a/src/cmd/ksh93/sh/fcin.c b/src/cmd/ksh93/sh/fcin.c index 457b17499..6eab4de0a 100644 --- a/src/cmd/ksh93/sh/fcin.c +++ b/src/cmd/ksh93/sh/fcin.c @@ -135,10 +135,6 @@ void fcnotify(void (*fun)(Sfio_t*,const char*,int,void*),void* context) _Fcin.context = context; } -#ifdef __EXPORT__ -# define extern __EXPORT__ -#endif - #undef fcsave extern void fcsave(Fcin_t *fp) { diff --git a/src/cmd/ksh93/sh/streval.c b/src/cmd/ksh93/sh/streval.c index b589c7e45..c3a91bd09 100644 --- a/src/cmd/ksh93/sh/streval.c +++ b/src/cmd/ksh93/sh/streval.c @@ -969,10 +969,6 @@ Sfdouble_t arith_strval(const char *s, char **end, Sfdouble_t(*convert)(const ch #undef error -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #ifndef DOMAIN #define DOMAIN _DOMAIN #endif @@ -1010,6 +1006,4 @@ Sfdouble_t arith_strval(const char *s, char **end, Sfdouble_t(*convert)(const ch UNREACHABLE(); } -#undef extern - #endif /* _mem_name_exception */ diff --git a/src/lib/libast/cdt/cdtlib.h b/src/lib/libast/cdt/cdtlib.h index 0bbe6dea3..98b90a991 100644 --- a/src/lib/libast/cdt/cdtlib.h +++ b/src/lib/libast/cdt/cdtlib.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -75,31 +75,6 @@ typedef struct _dtlib_s Dtmethod_t** methods; /* method list */ } Dtlib_t; -#if _BLD_cdt - -#define CDTLIB(m) __DEFINE__(Dtmethod_t*,m,&_##m); - -#else - -#define CDTLIB(m) \ - void* cdt_lib(const char* name, Dtdisc_t* disc, const char* type) \ - { \ - int i; \ - int n; \ - if (!type) \ - return &cdt_lib_##m; \ - n = strlen(cdt_lib_##m.prefix); \ - if (!strncmp(type, cdt_lib_##m.prefix, n)) \ - type += n; \ - for (i = 0; cdt_lib_##m.methods[i]; i++) \ - if (!strcmp(type, cdt_lib_##m.methods[i]->name + n)) \ - return cdt_lib_##m.methods[i]; \ - return 0; \ - } \ - unsigned long plugin_version(void) { return CDT_PLUGIN_VERSION; } - -#endif /* _BLD_cdt */ - /* these macros lock/unlock dictionaries. DTRETURN substitutes for "return" */ #define DTSETLOCK(dt) (((dt)->data->type&DT_SHARE) ? asolock(&(dt)->data->lock,1,ASO_LOCK) : 0 ) #define DTCLRLOCK(dt) (((dt)->data->type&DT_SHARE) ? asolock(&(dt)->data->lock,1,ASO_UNLOCK) : 0 ) @@ -139,16 +114,10 @@ typedef struct _dtlib_s #define LLSHIFT(x,t) ((t) = (x)->_rght->_rght, (x)->_rght->_rght = (t)->_left, \ (t)->_left = (x), (x) = (t) ) -#if _BLD_cdt && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern Dtlink_t* _dtmake(Dt_t*, void*, int); extern void _dtfree(Dt_t*, Dtlink_t*, int); extern int _dtlock(Dt_t*, int); -#undef extern - #if !_PACKAGE_ast extern void* malloc(size_t); extern void* realloc(void*, size_t); diff --git a/src/lib/libast/cdt/dtcomp.c b/src/lib/libast/cdt/dtcomp.c index 5d3600e21..a83d55b0c 100644 --- a/src/lib/libast/cdt/dtcomp.c +++ b/src/lib/libast/cdt/dtcomp.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -26,10 +26,6 @@ #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #undef dtflatten extern Dtlink_t* dtflatten(Dt_t* d) { diff --git a/src/lib/libast/cdt/dthash.c b/src/lib/libast/cdt/dthash.c index e33e0f76c..f6812db3a 100644 --- a/src/lib/libast/cdt/dthash.c +++ b/src/lib/libast/cdt/dthash.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -432,15 +432,12 @@ static int hashevent(Dt_t* dt, int event, void* arg) static Dtmethod_t _Dtset = { dthashchain, DT_SET, hashevent, "Dtset" }; static Dtmethod_t _Dtbag = { dthashchain, DT_BAG, hashevent, "Dtbag" }; -__DEFINE__(Dtmethod_t*,Dtset,&_Dtset); -__DEFINE__(Dtmethod_t*,Dtbag,&_Dtbag); +Dtmethod_t *Dtset = &_Dtset; +Dtmethod_t *Dtbag = &_Dtbag; /* backwards compatibility */ #undef Dthash -#if defined(__EXPORT__) -__EXPORT__ -#endif -__DEFINE__(Dtmethod_t*,Dthash,&_Dtset); +Dtmethod_t *Dthash = &_Dtset; #ifdef NoF NoF(dthashchain) diff --git a/src/lib/libast/cdt/dtlist.c b/src/lib/libast/cdt/dtlist.c index 3e6e356ff..e4a54df38 100644 --- a/src/lib/libast/cdt/dtlist.c +++ b/src/lib/libast/cdt/dtlist.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -337,10 +337,10 @@ static Dtmethod_t _Dtdeque = { dtlist, DT_DEQUE, listevent, "Dtdeque" }; static Dtmethod_t _Dtstack = { dtlist, DT_STACK, listevent, "Dtstack" }; static Dtmethod_t _Dtqueue = { dtlist, DT_QUEUE, listevent, "Dtqueue" }; -__DEFINE__(Dtmethod_t*,Dtlist,&_Dtlist); -__DEFINE__(Dtmethod_t*,Dtdeque,&_Dtdeque); -__DEFINE__(Dtmethod_t*,Dtstack,&_Dtstack); -__DEFINE__(Dtmethod_t*,Dtqueue,&_Dtqueue); +Dtmethod_t* Dtlist = &_Dtlist; +Dtmethod_t* Dtdeque = &_Dtdeque; +Dtmethod_t* Dtstack = &_Dtstack; +Dtmethod_t* Dtqueue = &_Dtqueue; #ifdef NoF NoF(dtlist) diff --git a/src/lib/libast/cdt/dttree.c b/src/lib/libast/cdt/dttree.c index 679a57ca9..7cb7a2d47 100644 --- a/src/lib/libast/cdt/dttree.c +++ b/src/lib/libast/cdt/dttree.c @@ -639,15 +639,12 @@ static int treeevent(Dt_t* dt, int event, void* arg) /* make this method available */ static Dtmethod_t _Dtoset = { dttree, DT_OSET, treeevent, "Dtoset" }; static Dtmethod_t _Dtobag = { dttree, DT_OBAG, treeevent, "Dtobag" }; -__DEFINE__(Dtmethod_t*,Dtoset,&_Dtoset); -__DEFINE__(Dtmethod_t*,Dtobag,&_Dtobag); +Dtmethod_t *Dtoset = &_Dtoset; +Dtmethod_t *Dtobag = &_Dtobag; /* backwards compatibility */ #undef Dttree -#if defined(__EXPORT__) -__EXPORT__ -#endif -__DEFINE__(Dtmethod_t*,Dttree,&_Dtoset); +Dtmethod_t *Dttree = &_Dtoset; #ifdef NoF NoF(dttree) diff --git a/src/lib/libast/comp/basename.c b/src/lib/libast/comp/basename.c index a280d561b..780a6d1ac 100644 --- a/src/lib/libast/comp/basename.c +++ b/src/lib/libast/comp/basename.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -26,10 +26,6 @@ #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char *basename(register char *pathname) { register char *first, *last; diff --git a/src/lib/libast/comp/dirname.c b/src/lib/libast/comp/dirname.c index 5ac050267..2d4762e4b 100644 --- a/src/lib/libast/comp/dirname.c +++ b/src/lib/libast/comp/dirname.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -26,10 +26,6 @@ #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char *dirname(register char *pathname) { register char *last; diff --git a/src/lib/libast/comp/eaccess.c b/src/lib/libast/comp/eaccess.c index d3b40ae04..3f51e0470 100644 --- a/src/lib/libast/comp/eaccess.c +++ b/src/lib/libast/comp/eaccess.c @@ -36,10 +36,6 @@ NoN(eaccess) #else -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int eaccess(const char* path, register int flags) { diff --git a/src/lib/libast/comp/execlp.c b/src/lib/libast/comp/execlp.c index 1e95e98fc..ee250c388 100644 --- a/src/lib/libast/comp/execlp.c +++ b/src/lib/libast/comp/execlp.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -31,16 +31,8 @@ NoN(execlp) #else -#if defined(__EXPORT__) -__EXPORT__ int execlp(const char*, const char*, ...); -#endif - #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int execlp(const char* name, const char* arg, ...) { diff --git a/src/lib/libast/comp/execve.c b/src/lib/libast/comp/execve.c index 1adaa871e..1affca430 100644 --- a/src/lib/libast/comp/execve.c +++ b/src/lib/libast/comp/execve.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -42,10 +42,6 @@ execsig(int sig) signal(sig, execsig); } -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int execve(const char* path, char* const argv[], char* const arge[]) { diff --git a/src/lib/libast/comp/execvp.c b/src/lib/libast/comp/execvp.c index fce68743c..16db0eb2c 100644 --- a/src/lib/libast/comp/execvp.c +++ b/src/lib/libast/comp/execvp.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -31,16 +31,8 @@ NoN(execvp) #else -#if defined(__EXPORT__) -__EXPORT__ int execvp(const char*, char* const[]); -#endif - #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int execvp(const char* name, char* const argv[]) { diff --git a/src/lib/libast/comp/execvpe.c b/src/lib/libast/comp/execvpe.c index 7345471d4..519d7d798 100644 --- a/src/lib/libast/comp/execvpe.c +++ b/src/lib/libast/comp/execvpe.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -31,17 +31,9 @@ NoN(execvpe) #else -#if defined(__EXPORT__) -__EXPORT__ int execvpe(const char*, char* const[], char* const[]); -#endif - #include #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int execvpe(const char* name, char* const argv[], char* const envv[]) { diff --git a/src/lib/libast/comp/fmtmsg.h b/src/lib/libast/comp/fmtmsg.h index 810f066cf..dcfc3b2d8 100644 --- a/src/lib/libast/comp/fmtmsg.h +++ b/src/lib/libast/comp/fmtmsg.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -108,34 +108,13 @@ typedef struct #define MM_default (MM_action|MM_label|MM_severity|MM_tag|MM_text) -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif -#if !_BLD_ast && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern const MM_table_t mm_class[]; extern const MM_table_t mm_verb[]; -#undef extern - -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern const MM_table_t* mm_severity; -#undef extern - -#endif - -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ #endif extern int fmtmsg(long, const char*, int, const char*, const char*, const char*); -#undef extern - #endif diff --git a/src/lib/libast/comp/fnmatch.c b/src/lib/libast/comp/fnmatch.c index cb730e1c9..799558d74 100644 --- a/src/lib/libast/comp/fnmatch.c +++ b/src/lib/libast/comp/fnmatch.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -45,10 +45,6 @@ static const Map_t map[] = FNM_PERIOD, REG_SHELL_DOT, }; -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int fnmatch(const char* pattern, const char* subject, register int flags) { diff --git a/src/lib/libast/comp/fnmatch.h b/src/lib/libast/comp/fnmatch.h index 94c8e9fbc..1faf52061 100644 --- a/src/lib/libast/comp/fnmatch.h +++ b/src/lib/libast/comp/fnmatch.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -50,12 +50,6 @@ #define FNM_NOMATCH 1 /* == REG_NOMATCH */ -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int fnmatch(const char*, const char*, int); -#undef extern - #endif diff --git a/src/lib/libast/comp/ftw.h b/src/lib/libast/comp/ftw.h index e90d54b2f..c2baffcad 100644 --- a/src/lib/libast/comp/ftw.h +++ b/src/lib/libast/comp/ftw.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -48,13 +48,7 @@ struct FTW #define FTW_SKD FTW_SKIP #define FTW_PRUNE FTW_SKIP -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int ftw(const char*, int(*)(const char*, const struct stat*, int), int); extern int nftw(const char*, int(*)(const char*, const struct stat*, int, struct FTW*), int, int); -#undef extern - #endif diff --git a/src/lib/libast/comp/getdate.c b/src/lib/libast/comp/getdate.c index 6c532fdaf..ae70a65f3 100644 --- a/src/lib/libast/comp/getdate.c +++ b/src/lib/libast/comp/getdate.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -43,11 +43,7 @@ NoN(getdate) #else #ifndef getdate_err -__DEFINE__(int, getdate_err, 0); -#endif - -#if defined(__EXPORT__) -#define extern __EXPORT__ +int getdate_err = 0; #endif extern struct tm* diff --git a/src/lib/libast/comp/getgroups.c b/src/lib/libast/comp/getgroups.c index b5a24c009..96600912d 100644 --- a/src/lib/libast/comp/getgroups.c +++ b/src/lib/libast/comp/getgroups.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -40,10 +40,6 @@ extern int getgroups(int, int*); #define ast_getgroups getgroups #endif -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int ast_getgroups(int len, gid_t* set) { diff --git a/src/lib/libast/comp/getlogin.c b/src/lib/libast/comp/getlogin.c index 7c60bcfd9..d22c163c2 100644 --- a/src/lib/libast/comp/getlogin.c +++ b/src/lib/libast/comp/getlogin.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -29,10 +29,6 @@ NoN(getlogin) #else -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* getlogin(void) { diff --git a/src/lib/libast/comp/getpgrp.c b/src/lib/libast/comp/getpgrp.c index 1656150f7..2842652c3 100644 --- a/src/lib/libast/comp/getpgrp.c +++ b/src/lib/libast/comp/getpgrp.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -36,10 +36,6 @@ extern int getpgrp(int); -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int _ast_getpgrp(void) { diff --git a/src/lib/libast/comp/libgen.h b/src/lib/libast/comp/libgen.h index ef90a810c..5f26c09e2 100644 --- a/src/lib/libast/comp/libgen.h +++ b/src/lib/libast/comp/libgen.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -27,26 +27,11 @@ #ifndef _LIBGEN_H #define _LIBGEN_H -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif -#if !_BLD_ast && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern char* __loc1; -#undef extern - -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* regcmp(const char*, ...); extern char* regex(const char*, const char*, ...); extern char* basename(char*); extern char* dirname(char*); -#undef extern - #endif diff --git a/src/lib/libast/comp/mktemp.c b/src/lib/libast/comp/mktemp.c index 9e22f504e..6e613c320 100644 --- a/src/lib/libast/comp/mktemp.c +++ b/src/lib/libast/comp/mktemp.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -36,10 +36,6 @@ #undef _def_map_ast #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - static char* temp(char* buf, int* fdp) { diff --git a/src/lib/libast/comp/mktime.c b/src/lib/libast/comp/mktime.c index 9b35b61e6..c06387cf2 100644 --- a/src/lib/libast/comp/mktime.c +++ b/src/lib/libast/comp/mktime.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -42,10 +42,6 @@ NoN(mktime) #else -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern time_t mktime(struct tm* ts) { diff --git a/src/lib/libast/comp/omitted.c b/src/lib/libast/comp/omitted.c index b298bbcf4..f80ae1bd0 100644 --- a/src/lib/libast/comp/omitted.c +++ b/src/lib/libast/comp/omitted.c @@ -74,10 +74,6 @@ extern int _utime(const char*, const struct utimbuf*); extern int _utimes(const char*, const struct timeval*); extern ssize_t _write(int, const void*, size_t); -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #if _win32_botch_access #define sysaccess _access #else @@ -1118,23 +1114,6 @@ getpagesize() #endif -#if __CYGWIN__ && defined(__IMPORT__) && defined(__EXPORT__) - -#ifndef OMITTED -#define OMITTED 1 -#endif - -/* - * a few _imp__FUNCTION symbols are needed to avoid - * static link multiple definitions - */ - -#ifndef strtod -__EXPORT__ double (*_imp__strtod)(const char*, char**) = strtod; -#endif - -#endif - /* Kludge to deal with GCC's overzealous optimizer breaking the pow functions. * * Removal of this will break IEEE floating point on the SVR4 platforms. diff --git a/src/lib/libast/comp/putenv.c b/src/lib/libast/comp/putenv.c index b67510c62..bd8883909 100644 --- a/src/lib/libast/comp/putenv.c +++ b/src/lib/libast/comp/putenv.c @@ -36,10 +36,6 @@ NoN(putenv) #undef _def_map_ast #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int putenv(const char* s) { diff --git a/src/lib/libast/comp/re_comp.h b/src/lib/libast/comp/re_comp.h index cd31697ad..53acf6eb2 100644 --- a/src/lib/libast/comp/re_comp.h +++ b/src/lib/libast/comp/re_comp.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -29,13 +29,7 @@ #ifndef _RE_COMP_H #define _RE_COMP_H -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* re_comp(const char*); extern int re_exec(const char*); -#undef extern - #endif diff --git a/src/lib/libast/comp/realpath.c b/src/lib/libast/comp/realpath.c index 533b07876..724f6bf76 100644 --- a/src/lib/libast/comp/realpath.c +++ b/src/lib/libast/comp/realpath.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -37,10 +37,6 @@ extern int resolvepath(const char*, char*, size_t); -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* realpath(const char* file, char* path) { diff --git a/src/lib/libast/comp/regcmp.c b/src/lib/libast/comp/regcmp.c index afc344034..e362c4800 100644 --- a/src/lib/libast/comp/regcmp.c +++ b/src/lib/libast/comp/regcmp.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -43,7 +43,7 @@ typedef struct char buf[ALIGN_BOUND2]; } Regex_t; -__DEFINE__(char*, __loc1, 0); +char* __loc1 = 0; static void* block(void* handle, void* data, size_t size) diff --git a/src/lib/libast/comp/regexp.h b/src/lib/libast/comp/regexp.h index 2126e8676..02be510cf 100644 --- a/src/lib/libast/comp/regexp.h +++ b/src/lib/libast/comp/regexp.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -60,17 +60,11 @@ typedef struct #define compile(a,b,c,d) _re_read(&_re_info,a,b,c,d) #define step(a,b) _re_exec(&_re_info,a,b,0) -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int _re_comp(regexp_t*, const char*, char*, unsigned int); extern int _re_exec(regexp_t*, const char*, const char*, int); extern char* _re_putc(int); extern char* _re_read(regexp_t*, const char*, char*, const char*, int); -#undef extern - #ifndef _REGEXP_DECLARE regexp_t _re_info; diff --git a/src/lib/libast/comp/remove.c b/src/lib/libast/comp/remove.c index 4dd94cd11..5e984999c 100644 --- a/src/lib/libast/comp/remove.c +++ b/src/lib/libast/comp/remove.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -36,10 +36,6 @@ NoN(remove) #else -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int remove(const char* path) { diff --git a/src/lib/libast/comp/resolvepath.c b/src/lib/libast/comp/resolvepath.c index 2c668b7b3..cb4d7b567 100644 --- a/src/lib/libast/comp/resolvepath.c +++ b/src/lib/libast/comp/resolvepath.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -36,10 +36,6 @@ #undef _AST_API_H #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int resolvepath(const char* file, char* path, size_t size) { diff --git a/src/lib/libast/comp/setenv.c b/src/lib/libast/comp/setenv.c index 5af7a3281..985a22666 100644 --- a/src/lib/libast/comp/setenv.c +++ b/src/lib/libast/comp/setenv.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -37,10 +37,6 @@ NoN(setenv) #undef _def_map_ast #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int setenv(const char* name, const char* value, int overwrite) { diff --git a/src/lib/libast/comp/statvfs.c b/src/lib/libast/comp/statvfs.c index b6ffd915b..3d3f0ba94 100644 --- a/src/lib/libast/comp/statvfs.c +++ b/src/lib/libast/comp/statvfs.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -59,10 +59,6 @@ NoN(statvfs) #define STATFS(a,b) statfs(a,b) #endif -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - static void us2v(register struct statfs* ufs, register struct stat* st, register struct statvfs* vfs) { @@ -111,10 +107,6 @@ statvfs(const char* path, struct statvfs* vfs) #else -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - static void s2v(register struct stat* st, register struct statvfs* vfs) { diff --git a/src/lib/libast/comp/strftime.c b/src/lib/libast/comp/strftime.c index cffa7b56b..26c8a6732 100644 --- a/src/lib/libast/comp/strftime.c +++ b/src/lib/libast/comp/strftime.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -42,10 +42,6 @@ NoN(strftime) #else -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern size_t strftime(char* buf, size_t len, const char* format, const struct tm* tm) { diff --git a/src/lib/libast/comp/strptime.c b/src/lib/libast/comp/strptime.c index 6d6659086..e3ed799fd 100644 --- a/src/lib/libast/comp/strptime.c +++ b/src/lib/libast/comp/strptime.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -40,10 +40,6 @@ NoN(strptime) #else -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* strptime(const char* s, const char* format, struct tm* ts) { diff --git a/src/lib/libast/comp/strstr.c b/src/lib/libast/comp/strstr.c index 79fbcaa86..da168fe64 100644 --- a/src/lib/libast/comp/strstr.c +++ b/src/lib/libast/comp/strstr.c @@ -33,10 +33,6 @@ NoN(strstr) #else -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* strstr(register const char* s1, register const char* s2) { diff --git a/src/lib/libast/comp/swab.c b/src/lib/libast/comp/swab.c index 7ae3c564d..a823699aa 100644 --- a/src/lib/libast/comp/swab.c +++ b/src/lib/libast/comp/swab.c @@ -38,10 +38,6 @@ NoN(swab) #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern void swab(const void* src, void* dst, ssize_t n) { diff --git a/src/lib/libast/comp/syslog.h b/src/lib/libast/comp/syslog.h index 1e498926a..53fec29ba 100644 --- a/src/lib/libast/comp/syslog.h +++ b/src/lib/libast/comp/syslog.h @@ -103,22 +103,9 @@ #define LOG_FACILITY(p) LOG_FAC(p) /* get facility index from pri */ #define LOG_SEVERITY(p) LOG_PRI(p) /* get severity from pri */ -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif -#if !_BLD_ast && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern const Namval_t log_facility[]; extern const Namval_t log_severity[]; -#undef extern - -#endif - -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ #endif extern void closelog(void); @@ -127,6 +114,4 @@ extern int setlogmask(int); extern void syslog(int, const char*, ...); extern void vsyslog(int, const char*, va_list); -#undef extern - #endif diff --git a/src/lib/libast/comp/system.c b/src/lib/libast/comp/system.c index 0dabac7c3..21d7e3df4 100644 --- a/src/lib/libast/comp/system.c +++ b/src/lib/libast/comp/system.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -36,10 +36,6 @@ #undef _def_map_ast #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int system(const char* cmd) { diff --git a/src/lib/libast/comp/tempnam.c b/src/lib/libast/comp/tempnam.c index b2ad11f70..b414d2462 100644 --- a/src/lib/libast/comp/tempnam.c +++ b/src/lib/libast/comp/tempnam.c @@ -39,10 +39,6 @@ #undef tempnam #endif -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* tempnam(const char* dir, const char* pfx) { diff --git a/src/lib/libast/comp/tmpnam.c b/src/lib/libast/comp/tmpnam.c index 822986ba4..b7dad618a 100644 --- a/src/lib/libast/comp/tmpnam.c +++ b/src/lib/libast/comp/tmpnam.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -34,10 +34,6 @@ #undef _def_map_ast #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #ifndef L_tmpnam #define L_tmpnam 25 #endif diff --git a/src/lib/libast/comp/transition.c b/src/lib/libast/comp/transition.c index c139b24f3..f017e537d 100644 --- a/src/lib/libast/comp/transition.c +++ b/src/lib/libast/comp/transition.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -27,10 +27,6 @@ #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #define STUB 1 /* diff --git a/src/lib/libast/comp/unsetenv.c b/src/lib/libast/comp/unsetenv.c index 7662b0824..9b45da8aa 100644 --- a/src/lib/libast/comp/unsetenv.c +++ b/src/lib/libast/comp/unsetenv.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -36,10 +36,6 @@ NoN(unsetenv) #undef _def_map_ast #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern void unsetenv(const char *name) { diff --git a/src/lib/libast/comp/vfork.c b/src/lib/libast/comp/vfork.c index 58f637e92..e5e2971ee 100644 --- a/src/lib/libast/comp/vfork.c +++ b/src/lib/libast/comp/vfork.c @@ -33,10 +33,6 @@ NoN(vfork) #undef vfork -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern pid_t vfork(void) { diff --git a/src/lib/libast/comp/wordexp.h b/src/lib/libast/comp/wordexp.h index a5850dad1..b500dbe8f 100644 --- a/src/lib/libast/comp/wordexp.h +++ b/src/lib/libast/comp/wordexp.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -51,13 +51,7 @@ typedef struct _wdarg size_t we_offs; } wordexp_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int wordexp(const char*, wordexp_t*, int); extern int wordfree(wordexp_t*); -#undef extern - #endif /* _WORDEXP_H */ diff --git a/src/lib/libast/features/common b/src/lib/libast/features/common index b87a7793d..c1cf64aec 100644 --- a/src/lib/libast/features/common +++ b/src/lib/libast/features/common @@ -6,13 +6,6 @@ typ __va_list stdio.h mac SF_APPEND,SF_CLOSE sys/stat.h sys/socket.h -dll import note{ Microsoft import/export nonsense }end execute{ - __declspec(dllimport) int foo; - int main() { return foo == 5 ? 0 : 1; } - int bar = 5; - int* _imp__foo = &bar; -}end - std proto note{ standard C prototypes ok }end compile{ extern int foo(int, int); bar() { foo(1, 1); } @@ -43,6 +36,10 @@ cat{ #define _BEGIN_EXTERNS_ #undef _END_EXTERNS_ #define _END_EXTERNS_ + #undef __EXTERN__ + #define __EXTERN__(T,obj) extern T obj + #undef __DEFINE__ + #define __DEFINE__(T,obj,val) T obj = val #undef __STD_C #define __STD_C 1 #undef Void_t @@ -72,35 +69,6 @@ cat{ # define _DLL 1 # endif #endif - #if _dll_import - # if _BLD_STATIC && !_BLD_DLL - # undef _DLL - # else - # if !defined(_DLL) - # define _DLL 1 - # endif - # endif - # if !defined(__EXPORT__) && _BLD_DLL - # define __EXPORT__ __declspec(dllexport) - # endif - # if !defined(__IMPORT__) && ( _BLD_DLL || defined(_DLL) ) - # define __IMPORT__ __declspec(dllimport) - # endif - #endif - #if !defined(_astimport) - # if defined(__IMPORT__) && defined(_DLL) - # define _astimport __IMPORT__ - # else - # define _astimport extern - # endif - #endif - #if _dll_import && ( !_BLD_DLL || _WINIX ) - # define __EXTERN__(T,obj) extern T obj; T* _imp__ ## obj = &obj - # define __DEFINE__(T,obj,val) T obj = val; T* _imp__ ## obj = &obj - #else - # define __EXTERN__(T,obj) extern T obj - # define __DEFINE__(T,obj,val) T obj = val - #endif #if !_hdr_stdnoreturn #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)) diff --git a/src/lib/libast/features/iconv b/src/lib/libast/features/iconv index 9e78e5eee..337e1a0f3 100644 --- a/src/lib/libast/features/iconv +++ b/src/lib/libast/features/iconv @@ -89,10 +89,6 @@ tst output{ printf("\n"); printf("#define iconv_init(d,e) (memset(d,0,sizeof(*(d))),(d)->version=ICONV_VERSION,(d)->errorf=(Iconv_error_f)(e),(d)->fill=(-1))\n"); printf("\n"); - printf("#if _BLD_ast && defined(__EXPORT__)\n"); - printf("#define extern __EXPORT__\n"); - printf("#endif\n"); - printf("\n"); printf("extern %siconv_t %siconv_open(const char*, const char*);\n", lib, lib); printf("extern size_t %siconv(%siconv_t, char**, size_t*, char**, size_t*);\n", lib, lib); printf("extern int %siconv_close(%siconv_t);\n", lib, lib); @@ -108,8 +104,6 @@ tst output{ printf("#endif\n"); printf("#endif\n"); printf("\n"); - printf("#undef extern\n"); - printf("\n"); return 0; } }end diff --git a/src/lib/libast/features/map.c b/src/lib/libast/features/map.c index e16bad0b0..63660565a 100644 --- a/src/lib/libast/features/map.c +++ b/src/lib/libast/features/map.c @@ -48,10 +48,6 @@ main() printf(" * unmapped in native headers included by \n"); printf(" */\n"); printf("\n"); - printf("#if _BLD_ast && defined(__EXPORT__)\n"); - printf("#define extern __EXPORT__\n"); - printf("#endif\n"); - printf("\n"); #if __MVS__ #undef _map_libc #define _map_libc 1 diff --git a/src/lib/libast/features/nl_types b/src/lib/libast/features/nl_types index b4d72e160..f965c6202 100644 --- a/src/lib/libast/features/nl_types +++ b/src/lib/libast/features/nl_types @@ -51,16 +51,10 @@ tst output{ printf("\n"); printf("typedef void* nl_catd;\n"); printf("\n"); - printf("#if _BLD_ast && defined(__EXPORT__)\n"); - printf("#define extern __EXPORT__\n"); - printf("#endif\n"); - printf("\n"); printf("extern nl_catd catopen(const char*, int);\n"); printf("extern char* catgets(nl_catd, int, int, const char*);\n"); printf("extern int catclose(nl_catd);\n"); printf("\n"); - printf("#undef extern\n"); - printf("\n"); return 0; } }end diff --git a/src/lib/libast/features/sig.sh b/src/lib/libast/features/sig.sh index f545d9301..3e3177f6c 100644 --- a/src/lib/libast/features/sig.sh +++ b/src/lib/libast/features/sig.sh @@ -98,29 +98,14 @@ typedef struct extern int kill(pid_t, int); extern int killpg(pid_t, int); -#if _BLD_ast && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif -#if !_BLD_ast && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern Sig_info_t sig_info; -#undef extern - #if _lib_sigflag && _npt_sigflag extern int sigflag(int, int, int); #endif -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #if !_lib_sigflag extern int sigflag(int, int, int); #endif extern int sigcritical(int); -extern int sigunblock(int); - -#undef extern' +extern int sigunblock(int);' diff --git a/src/lib/libast/features/stdio b/src/lib/libast/features/stdio index 50dce6fa0..1d3f9baf7 100644 --- a/src/lib/libast/features/stdio +++ b/src/lib/libast/features/stdio @@ -230,10 +230,6 @@ cat{ #undef extern - #if _BLD_ast && defined(__EXPORT__) - #define extern __EXPORT__ - #endif - extern int _doprnt(const char*, va_list, FILE*); extern int _doscan(FILE*, const char*, va_list); extern int asprintf(char**, const char*, ...); @@ -347,19 +343,10 @@ cat{ #else - #if _BLD_ast && defined(__EXPORT__) - #define extern extern __EXPORT__ - #endif - #if !_BLD_ast && defined(__IMPORT__) - #define extern extern __IMPORT__ - #endif - extern FILE _Sfstdin; extern FILE _Sfstdout; extern FILE _Sfstderr; - #undef extern - #define feof(f) (_sf_(f)->_flags&_SF_EOF) #define ferror(f) (_sf_(f)->_flags&_SF_ERROR) #define fileno(f) (_sf_(f)->_file) @@ -369,14 +356,8 @@ cat{ #define putc(c,f) fputc(c,f) #define putchar(c) fputc(c,stdout) - #if _BLD_ast && defined(__EXPORT__) - #define extern __EXPORT__ - #endif - extern int _sffilbuf(FILE*, int); extern int _sfflsbuf(FILE*, int); - #undef extern - #endif }end diff --git a/src/lib/libast/features/sys b/src/lib/libast/features/sys index a07334037..c74d233c1 100644 --- a/src/lib/libast/features/sys +++ b/src/lib/libast/features/sys @@ -113,10 +113,6 @@ define X_OK 1 define W_OK 2 define R_OK 4 -print #if _BLD_ast && defined(__EXPORT__) -print #define extern __EXPORT__ -print #endif - extern _exit void (int) extern abort void (void) extern abs int (int) diff --git a/src/lib/libast/features/tmx b/src/lib/libast/features/tmx index 991159e6d..9c51c80b7 100644 --- a/src/lib/libast/features/tmx +++ b/src/lib/libast/features/tmx @@ -80,10 +80,6 @@ cat{ #define tmxsetctime(s,t) ((s)->st_ctime=tmxsec(t),ST_CTIME_NSEC_SET(s,tmxnsec(t))) #define tmxsetmtime(s,t) ((s)->st_mtime=tmxsec(t),ST_MTIME_NSEC_SET(s,tmxnsec(t))) - #if _BLD_ast && defined(__EXPORT__) - #define extern __EXPORT__ - #endif - extern Time_t tmxdate(const char*, char**, Time_t); extern Time_t tmxduration(const char*, char**); extern char* tmxfmt(char*, size_t, const char*, Time_t); diff --git a/src/lib/libast/features/tv b/src/lib/libast/features/tv index 451eda8a1..3f5844eef 100644 --- a/src/lib/libast/features/tv +++ b/src/lib/libast/features/tv @@ -66,10 +66,6 @@ cat{ #define tvsetmtime(t,s) (ST_MTIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_mtime=(t)->tv_sec) #define tvsetctime(t,s) (ST_CTIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_ctime=(t)->tv_sec) - #if _BLD_ast && defined(__EXPORT__) - #define extern __EXPORT__ - #endif - extern int tvgettime(Tv_t*); extern int tvsettime(const Tv_t*); extern int tvcmp(const Tv_t*, const Tv_t*); diff --git a/src/lib/libast/features/wchar b/src/lib/libast/features/wchar index 9885bb774..3cd8f83f4 100644 --- a/src/lib/libast/features/wchar +++ b/src/lib/libast/features/wchar @@ -103,10 +103,6 @@ cat < */ @@ -464,12 +458,6 @@ extern char** environ; #undef AST_PLUGIN_VERSION #define AST_PLUGIN_VERSION(v) ((v)>AST_VERSION?(v):AST_VERSION) -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern unsigned long plugin_version(void); -#undef extern - #endif diff --git a/src/lib/libast/include/ast_std.h b/src/lib/libast/include/ast_std.h index b43bff889..ac4068215 100644 --- a/src/lib/libast/include/ast_std.h +++ b/src/lib/libast/include/ast_std.h @@ -128,10 +128,6 @@ struct lconv #endif -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #undef getenv #define getenv _ast_getenv @@ -231,8 +227,6 @@ extern char* strerror(int); #define LC_LANG (-AST_LC_LANG) #endif -#undef extern - #undef strcoll #if _std_strcoll #define strcoll _ast_info.collate @@ -279,17 +273,8 @@ typedef struct } _Ast_info_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif -#if !_BLD_ast && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern _Ast_info_t _ast_info; -#undef extern - /* direct macro access for bsd crossover */ #if !defined(memcpy) && !defined(_lib_memcpy) && defined(_lib_bcopy) @@ -322,16 +307,10 @@ extern int rename(const char*, const char*); /* and now introducing prototypes botched by the standard(s) */ -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #undef getpgrp #define getpgrp() _ast_getpgrp() extern int _ast_getpgrp(void); -#undef extern - /* * and finally, standard interfaces hijacked by AST * _AST_STD_I delays headers that require diff --git a/src/lib/libast/include/ccode.h b/src/lib/libast/include/ccode.h index f485d9556..7d4bce948 100644 --- a/src/lib/libast/include/ccode.h +++ b/src/lib/libast/include/ccode.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -48,10 +48,6 @@ typedef struct Ccmap_s void* data; /* map specific data */ } Ccmap_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern unsigned char* _ccmap(int, int); extern void* _ccmapcpy(unsigned char*, void*, const void*, size_t); extern void* _ccmapstr(unsigned char*, void*, size_t); @@ -61,8 +57,6 @@ extern char* ccmapname(int); extern void* ccnative(void*, const void*, size_t); extern Ccmap_t* ccmaplist(Ccmap_t*); -#undef extern - #define CCOP(i,o) ((i)==(o)?0:(((o)<<8)|(i))) #define CCIN(x) ((x)&0xFF) #define CCOUT(x) (((x)>>8)&0xFF) diff --git a/src/lib/libast/include/cdt.h b/src/lib/libast/include/cdt.h index d04134c6f..0b3de024c 100644 --- a/src/lib/libast/include/cdt.h +++ b/src/lib/libast/include/cdt.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -232,12 +232,6 @@ struct _dtstat_s #define DT_ERROR 0xbad /* announcing an error */ /* data structures and functions */ -#if _BLD_cdt && defined(__EXPORT__) -#define extern __EXPORT__ -#endif -#if !_BLD_cdt && defined(__IMPORT__) -#define extern __IMPORT__ -#endif extern Dtmethod_t* Dtset; extern Dtmethod_t* Dtbag; @@ -266,12 +260,6 @@ extern Dtmethod_t* Dtrhbag; #endif /*_PACKAGE_ast*/ -#undef extern - -#if _BLD_cdt && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern Dt_t* dtopen(Dtdisc_t*, Dtmethod_t*); extern int dtclose(Dt_t*); extern Dt_t* dtview(Dt_t*, Dt_t*); @@ -288,18 +276,8 @@ extern int dtuserevent(Dt_t*, int, void*); extern Dt_t* _dtopen(Dtdisc_t*, Dtmethod_t*, unsigned long); #define dtopen(dc,mt) _dtopen((dc), (mt), CDT_VERSION) -#undef extern - #if _PACKAGE_ast && !defined(_CDTLIB_H) - -#if _BLD_dll && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern void* dllmeth(const char*, const char*, unsigned long); - -#undef extern - #endif /* internal functions for translating among holder, object and key */ diff --git a/src/lib/libast/include/cmdarg.h b/src/lib/libast/include/cmdarg.h index 2678218e6..eab5a76b8 100644 --- a/src/lib/libast/include/cmdarg.h +++ b/src/lib/libast/include/cmdarg.h @@ -74,10 +74,6 @@ typedef struct Cmdarg_s /* cmdopen() handle */ } Cmdarg_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #ifndef cmdopen extern Cmdarg_t* cmdopen(char**, int, int, const char*, int); #endif @@ -87,6 +83,4 @@ extern int cmdflush(Cmdarg_t*); extern int cmdarg(Cmdarg_t*, const char*, int); extern int cmdclose(Cmdarg_t*); -#undef extern - #endif diff --git a/src/lib/libast/include/debug.h b/src/lib/libast/include/debug.h index 44211300e..24efbd5bd 100644 --- a/src/lib/libast/include/debug.h +++ b/src/lib/libast/include/debug.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -96,14 +96,8 @@ #define RETURN(x) DEBUG_RETURN(x) #endif -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern double debug_elapsed(int); extern void debug_fatal(const char*, int); extern void systrace(const char*); -#undef extern - #endif diff --git a/src/lib/libast/include/dt.h b/src/lib/libast/include/dt.h index 490d063cd..5da8bfd78 100644 --- a/src/lib/libast/include/dt.h +++ b/src/lib/libast/include/dt.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -27,15 +27,9 @@ #include #include -#if _BLD_cdt && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern Dt_t* dtnew(Vmalloc_t*, Dtdisc_t*, Dtmethod_t*); extern Dt_t* _dtnew(Vmalloc_t*, Dtdisc_t*, Dtmethod_t*, unsigned long); -#undef extern - #define dtnew(v,d,m) _dtnew(v,d,m,CDT_VERSION) #endif diff --git a/src/lib/libast/include/error.h b/src/lib/libast/include/error.h index 7a625744a..79caba196 100644 --- a/src/lib/libast/include/error.h +++ b/src/lib/libast/include/error.h @@ -195,23 +195,10 @@ extern int errno; /* system call error status */ #define ESPIPE 29 #endif -#if _BLD_ast && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif -#if !_BLD_ast && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern Error_info_t* _error_infop_; #define error_info (*_error_infop_) -#undef extern - -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern void error(int, ...); extern int errormsg(const char*, int, ...); extern int errorf(void*, void*, int, ...); @@ -221,6 +208,4 @@ extern char* errorx(const char*, const char*, const char*, const char*); #endif extern Error_info_t* errorctx(Error_info_t*, int, int); -#undef extern - #endif diff --git a/src/lib/libast/include/find.h b/src/lib/libast/include/find.h index 0579bca92..db527f664 100644 --- a/src/lib/libast/include/find.h +++ b/src/lib/libast/include/find.h @@ -72,15 +72,9 @@ typedef struct Find_s } Find_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern Find_t* findopen(const char*, const char*, const char*, Finddisc_t*); extern char* findread(Find_t*); extern int findwrite(Find_t*, const char*, size_t, const char*); extern int findclose(Find_t*); -#undef extern - #endif diff --git a/src/lib/libast/include/fts.h b/src/lib/libast/include/fts.h index 689dcc084..a828b6e4d 100644 --- a/src/lib/libast/include/fts.h +++ b/src/lib/libast/include/fts.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -144,10 +144,6 @@ struct Fts }; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern FTSENT* fts_children(FTS*, int); extern int fts_close(FTS*); extern int fts_flags(void); @@ -157,6 +153,4 @@ extern FTS* fts_open(char* const*, int, int(*)(FTSENT* const*, FTSENT* const*)); extern FTSENT* fts_read(FTS*); extern int fts_set(FTS*, FTSENT*, int); -#undef extern - #endif diff --git a/src/lib/libast/include/ftwalk.h b/src/lib/libast/include/ftwalk.h index 37a697a95..1ee4029bf 100644 --- a/src/lib/libast/include/ftwalk.h +++ b/src/lib/libast/include/ftwalk.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -112,13 +112,7 @@ #define FTW_SKIP FTS_SKIP #define FTW_STAT FTS_STAT -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int ftwalk(const char*, int(*)(Ftw_t*), int, int(*)(Ftw_t*, Ftw_t*)); extern int ftwflags(void); -#undef extern - #endif diff --git a/src/lib/libast/include/glob.h b/src/lib/libast/include/glob.h index 4be71e5ce..fa19ed388 100644 --- a/src/lib/libast/include/glob.h +++ b/src/lib/libast/include/glob.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -141,13 +141,7 @@ struct _glob_ #define GLOB_APPERR 5 #define GLOB_NOSYS 6 -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int glob(const char*, int, int(*)(const char*,int), glob_t*); extern void globfree(glob_t*); -#undef extern - #endif /* _GLOB_H */ diff --git a/src/lib/libast/include/hash.h b/src/lib/libast/include/hash.h index 7ba8a9a5c..2d3267e68 100644 --- a/src/lib/libast/include/hash.h +++ b/src/lib/libast/include/hash.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -181,10 +181,6 @@ struct Hash_table /* hash table information */ #endif }; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern Hash_table_t* hashalloc(Hash_table_t*, ...); extern void hashdone(Hash_position_t*); extern void hashdump(Hash_table_t*, int); @@ -197,6 +193,4 @@ extern void hashsize(Hash_table_t*, int); extern Hash_table_t* hashview(Hash_table_t*, Hash_table_t*); extern int hashwalk(Hash_table_t*, int, int (*)(const char*, char*, void*), void*); -#undef extern - #endif diff --git a/src/lib/libast/include/hashkey.h b/src/lib/libast/include/hashkey.h index a9539aab6..4b1654263 100644 --- a/src/lib/libast/include/hashkey.h +++ b/src/lib/libast/include/hashkey.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -51,12 +51,6 @@ #define HASHNKEY4(n,c4,c3,c2,c1) HASHKEY5((n)+'a',c4,c3,c2,c1) #define HASHNKEY5(n,c5,c4,c3,c2,c1) HASHKEY6((n)+'a',c5,c4,c3,c2,c1) -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern long strkey(const char*); -#undef extern - #endif diff --git a/src/lib/libast/include/ip6.h b/src/lib/libast/include/ip6.h index f9dbc8157..8253cf8c3 100644 --- a/src/lib/libast/include/ip6.h +++ b/src/lib/libast/include/ip6.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -28,13 +28,7 @@ #define IP6BITS IP6ADDR #define IP6PREFIX (IP6ADDR+1) -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* fmtip6(const unsigned char*, int); extern int strtoip6(const char*, char**, unsigned char*, unsigned char*); -#undef extern - #endif diff --git a/src/lib/libast/include/ls.h b/src/lib/libast/include/ls.h index 8c1380ff4..67c8daf97 100644 --- a/src/lib/libast/include/ls.h +++ b/src/lib/libast/include/ls.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -73,16 +73,10 @@ #define LS_W_MARK 1 /* LS_MARK field width */ #define LS_W_NAME 9 /* group|user name field width */ -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern off_t _iblocks(struct stat*); extern char* fmtdev(struct stat*); extern char* fmtfs(struct stat*); extern char* fmtls(char*, const char*, struct stat*, const char*, const char*, int); extern int pathstat(const char*, struct stat*); -#undef extern - #endif diff --git a/src/lib/libast/include/magic.h b/src/lib/libast/include/magic.h index 2ca1b76a4..01b794f82 100644 --- a/src/lib/libast/include/magic.h +++ b/src/lib/libast/include/magic.h @@ -71,16 +71,10 @@ typedef struct Magic_s } Magic_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern Magic_t* magicopen(Magicdisc_t*); extern int magicload(Magic_t*, const char*, unsigned long); extern int magiclist(Magic_t*, Sfio_t*); extern char* magictype(Magic_t*, Sfio_t*, const char*, struct stat*); extern int magicclose(Magic_t*); -#undef extern - #endif diff --git a/src/lib/libast/include/mc.h b/src/lib/libast/include/mc.h index 61dc440cb..772959f8f 100644 --- a/src/lib/libast/include/mc.h +++ b/src/lib/libast/include/mc.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -79,10 +79,6 @@ typedef struct Mc_s #endif } Mc_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* mcfind(const char*, const char*, int, int, char*, size_t); extern Mc_t* mcopen(Sfio_t*); extern char* mcget(Mc_t*, int, int, const char*); @@ -91,6 +87,4 @@ extern int mcdump(Mc_t*, Sfio_t*); extern int mcindex(const char*, char**, int*, int*); extern int mcclose(Mc_t*); -#undef extern - #endif diff --git a/src/lib/libast/include/mime.h b/src/lib/libast/include/mime.h index bc7d7831d..fb0fcc960 100644 --- a/src/lib/libast/include/mime.h +++ b/src/lib/libast/include/mime.h @@ -72,10 +72,6 @@ struct Mime_s }; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern Mime_t* mimeopen(Mimedisc_t*); extern int mimeload(Mime_t*, const char*, unsigned long); extern int mimelist(Mime_t*, Sfio_t*, const char*); @@ -86,6 +82,4 @@ extern char* mimeview(Mime_t*, const char*, const char*, const char*, const char extern int mimehead(Mime_t*, void*, size_t, size_t, char*); extern int mimecmp(const char*, const char*, char**); -#undef extern - #endif diff --git a/src/lib/libast/include/mnt.h b/src/lib/libast/include/mnt.h index 6bbc692a1..52c1a1fe0 100644 --- a/src/lib/libast/include/mnt.h +++ b/src/lib/libast/include/mnt.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -44,15 +44,9 @@ typedef struct int flags; /* MNT_* flags */ } Mnt_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern void* mntopen(const char*, const char*); extern Mnt_t* mntread(void*); extern int mntwrite(void*, const Mnt_t*); extern int mntclose(void*); -#undef extern - #endif diff --git a/src/lib/libast/include/modex.h b/src/lib/libast/include/modex.h index 0eb365a3e..30aa334b4 100644 --- a/src/lib/libast/include/modex.h +++ b/src/lib/libast/include/modex.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -32,15 +32,9 @@ #include #include -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int modei(int); extern int modex(int); -#undef extern - #if _S_IDPERM #define modei(m) ((m)&X_IPERM) #if _S_IDTYPE diff --git a/src/lib/libast/include/option.h b/src/lib/libast/include/option.h index 3259633d3..5e11676ac 100644 --- a/src/lib/libast/include/option.h +++ b/src/lib/libast/include/option.h @@ -74,25 +74,12 @@ typedef struct Opt_s _OPT_PRIVATE_ } Opt_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif -#if !_BLD_ast && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern Opt_t* _opt_infop_; #define opt_info (*_opt_infop_) -#undef extern - #define optinit(d,f) (memset(d,0,sizeof(*(d))),(d)->version=OPT_VERSION,(d)->infof=(f),opt_info.disc=(d)) -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int optget(char**, const char*); extern int optjoin(char**, ...); extern char* opthelp(const char*, const char*); @@ -101,6 +88,4 @@ extern int optstr(const char*, const char*); extern int optesc(Sfio_t*, const char*, int); extern Opt_t* optctx(Opt_t*, Opt_t*); -#undef extern - #endif diff --git a/src/lib/libast/include/proc.h b/src/lib/libast/include/proc.h index 717d10410..06f223a2d 100644 --- a/src/lib/libast/include/proc.h +++ b/src/lib/libast/include/proc.h @@ -94,15 +94,9 @@ _PROC_PRIVATE_ } Proc_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int procclose(Proc_t*); extern int procfree(Proc_t*); extern Proc_t* procopen(const char*, char**, char**, long*, int); extern int procrun(const char*, char**, int); -#undef extern - #endif diff --git a/src/lib/libast/include/recfmt.h b/src/lib/libast/include/recfmt.h index 9e6cfb043..6c0f5bb92 100644 --- a/src/lib/libast/include/recfmt.h +++ b/src/lib/libast/include/recfmt.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -69,15 +69,9 @@ typedef uint32_t Recfmt_t; #define REC_N_TYPE() 0xffffffff -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* fmtrec(Recfmt_t, int); extern Recfmt_t recfmt(const void*, size_t, off_t); extern Recfmt_t recstr(const char*, char**); extern ssize_t reclen(Recfmt_t, const void*, size_t); -#undef extern - #endif diff --git a/src/lib/libast/include/regex.h b/src/lib/libast/include/regex.h index 8768bfece..048b75482 100644 --- a/src/lib/libast/include/regex.h +++ b/src/lib/libast/include/regex.h @@ -195,10 +195,6 @@ struct regex_s #define reginit(disc) (memset(disc,0,sizeof(*(disc))),(disc)->re_version=REG_VERSION) -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int regcomp(regex_t*, const char*, regflags_t); extern size_t regerror(int, const regex_t*, char*, size_t); extern int regexec(const regex_t*, const char*, size_t, regmatch_t*, regflags_t); @@ -249,6 +245,4 @@ struct _sfio_s; extern void regalloc(void*, regresize_t, regflags_t); extern int regsub(const regex_t*, struct _sfio_s*, const char*, const char*, size_t, regmatch_t*, regflags_t); -#undef extern - #endif diff --git a/src/lib/libast/include/sfdisc.h b/src/lib/libast/include/sfdisc.h index fec6b237c..d4ebb8fde 100644 --- a/src/lib/libast/include/sfdisc.h +++ b/src/lib/libast/include/sfdisc.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -33,10 +33,6 @@ #define SFDCEVENT(a,b,n) ((((a)-'A'+1)<<11)^(((b)-'A'+1)<<6)^(n)) -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #define SFSK_DISCARD SFDCEVENT('S','K',1) /* @@ -65,6 +61,4 @@ extern int sfdcunion(Sfio_t*, Sfio_t**, int); extern Sfio_t* sfdcsubstream(Sfio_t*, Sfio_t*, Sfoff_t, Sfoff_t); -#undef extern - #endif diff --git a/src/lib/libast/include/sfio.h b/src/lib/libast/include/sfio.h index fd2bf3be3..ac51ebb6a 100644 --- a/src/lib/libast/include/sfio.h +++ b/src/lib/libast/include/sfio.h @@ -192,13 +192,6 @@ struct _sffmt_s #define SF_CLOSE SF_CLOSING /* AIX sys/socket.h */ #endif -#if _BLD_sfio && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif -#if !_BLD_sfio && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern ssize_t _Sfi; extern ssize_t _Sfmaxr; @@ -211,12 +204,6 @@ extern Sfio_t _Sfstdin; extern Sfio_t _Sfstdout; extern Sfio_t _Sfstderr; -#undef extern - -#if _BLD_sfio && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern Sfio_t* sfnew(Sfio_t*, void*, size_t, int, int); extern Sfio_t* sfopen(Sfio_t*, const char*, const char*); extern Sfio_t* sfpopen(Sfio_t*, const char*, const char*); @@ -305,8 +292,6 @@ extern ssize_t sfvalue(Sfio_t*); extern ssize_t sfslen(void); extern ssize_t sfmaxr(ssize_t, int); -#undef extern - /* coding long integers in a portable and compact fashion */ #define SF_SBITS 6 #define SF_UBITS 7 diff --git a/src/lib/libast/include/shcmd.h b/src/lib/libast/include/shcmd.h index 4d40cb073..7107c266d 100644 --- a/src/lib/libast/include/shcmd.h +++ b/src/lib/libast/include/shcmd.h @@ -93,12 +93,6 @@ struct Shbltin_s # endif #endif -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int astintercept(Shbltin_t*, int); -#undef extern - #endif diff --git a/src/lib/libast/include/stack.h b/src/lib/libast/include/stack.h index ca67ac6da..7e7ed9c63 100644 --- a/src/lib/libast/include/stack.h +++ b/src/lib/libast/include/stack.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -66,10 +66,6 @@ struct stacktable /* stack information */ #define popstack stackpop #define posstack stacktell -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern STACK stackalloc(int, void*); extern void stackfree(STACK); extern void stackclear(STACK); @@ -78,6 +74,4 @@ extern int stackpush(STACK, void*); extern int stackpop(STACK); extern void stacktell(STACK, int, STACKPOS*); -#undef extern - #endif diff --git a/src/lib/libast/include/stk.h b/src/lib/libast/include/stk.h index 1a9927a8e..9de3cfdf0 100644 --- a/src/lib/libast/include/stk.h +++ b/src/lib/libast/include/stk.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -47,21 +47,8 @@ #define stktell(sp) ((sp)->_next-(sp)->_data) #define stkseek(sp,n) ((n)==0?(char*)((sp)->_next=(sp)->_data):_stkseek(sp,n)) -#if _BLD_ast && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif -#if !_BLD_ast && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern Sfio_t _Stk_data; -#undef extern - -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern Stk_t* stkopen(int); extern Stk_t* stkinstall(Stk_t*, char*(*)(int)); extern int stkclose(Stk_t*); @@ -73,6 +60,4 @@ extern char* _stkseek(Stk_t*, ssize_t); extern char* stkfreeze(Stk_t*, size_t); extern int stkon(Stk_t*, char*); -#undef extern - #endif diff --git a/src/lib/libast/include/swap.h b/src/lib/libast/include/swap.h index 1244e1609..2e6dd616b 100644 --- a/src/lib/libast/include/swap.h +++ b/src/lib/libast/include/swap.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -39,15 +39,9 @@ #define SWAPOP(n) (((n)&int_swap)^(n)) -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern void* swapmem(int, const void*, void*, size_t); extern intmax_t swapget(int, const void*, int); extern void* swapput(int, void*, int, intmax_t); extern int swapop(const void*, const void*, int); -#undef extern - #endif diff --git a/src/lib/libast/include/times.h b/src/lib/libast/include/times.h index a157f9fbf..cac2e061c 100644 --- a/src/lib/libast/include/times.h +++ b/src/lib/libast/include/times.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -43,12 +43,6 @@ #define _TIMES_H #endif -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int touch(const char*, time_t, time_t, int); -#undef extern - #endif diff --git a/src/lib/libast/include/tm.h b/src/lib/libast/include/tm.h index b0467745b..54a891be2 100644 --- a/src/lib/libast/include/tm.h +++ b/src/lib/libast/include/tm.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -148,25 +148,12 @@ typedef struct Tm_s Tm_zone_t* tm_zone; } Tm_t; -#if _BLD_ast && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif -#if !_BLD_ast && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern Tm_data_t* _tm_datap_; extern Tm_info_t* _tm_infop_; #define tm_data (*_tm_datap_) #define tm_info (*_tm_infop_) -#undef extern - -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern time_t tmdate(const char*, char**, time_t*); extern int tmequiv(Tm_t*); extern Tm_t* tmfix(Tm_t*); @@ -187,6 +174,4 @@ extern int tmweek(Tm_t*, int, int, int); extern int tmword(const char*, char**, const char*, char**, int); extern Tm_zone_t* tmzone(const char*, char**, const char*, int*); -#undef extern - #endif diff --git a/src/lib/libast/include/tok.h b/src/lib/libast/include/tok.h index a69523dbc..540395c67 100644 --- a/src/lib/libast/include/tok.h +++ b/src/lib/libast/include/tok.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -32,16 +32,10 @@ #include -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern Sfio_t* tokline(const char*, int, int*); extern int tokscan(char*, char**, const char*, ...); extern char* tokopen(char*, int); extern void tokclose(char*); extern char* tokread(char*); -#undef extern - #endif diff --git a/src/lib/libast/include/vecargs.h b/src/lib/libast/include/vecargs.h index 48946f222..cce8797b1 100644 --- a/src/lib/libast/include/vecargs.h +++ b/src/lib/libast/include/vecargs.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -30,16 +30,10 @@ #ifndef _VECARGS_H #define _VECARGS_H -#if _BLD_ast && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int vecargs(char**, int*, char***); extern char** vecfile(const char*); extern void vecfree(char**, int); extern char** vecload(char*); extern char** vecstring(const char*); -#undef extern - #endif diff --git a/src/lib/libast/include/vmalloc.h b/src/lib/libast/include/vmalloc.h index 5fe949aa1..a306f6b64 100644 --- a/src/lib/libast/include/vmalloc.h +++ b/src/lib/libast/include/vmalloc.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -122,12 +122,6 @@ struct _vmalloc_s #define VM_MMADD 2 /* add data value (long) */ /* public data */ -#if _BLD_vmalloc && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif -#if !_BLD_vmalloc && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif extern Vmethod_t* Vmbest; /* best allocation */ extern Vmethod_t* Vmlast; /* last-block allocation */ @@ -145,12 +139,7 @@ extern Vmalloc_t _Vmheap; /* heap region - use with care! */ extern Vmalloc_t* Vmheap; /* = &_Vmheap - safe to use */ extern Vmalloc_t* Vmregion; /* malloc region */ -#undef extern - /* public functions */ -#if _BLD_vmalloc && defined(__EXPORT__) -#define extern __EXPORT__ -#endif extern Vmalloc_t* vmopen( Vmdisc_t*, Vmethod_t*, int ); extern int vmclose( Vmalloc_t* ); @@ -204,8 +193,6 @@ extern void* valloc( size_t ); #endif extern int setregmax( int ); -#undef extern - /* to coerce any value to a Vmalloc_t*, make ANSI happy */ #define _VM_(vm) ((Vmalloc_t*)(vm)) diff --git a/src/lib/libast/misc/error.c b/src/lib/libast/misc/error.c index 982871798..8c0ad86c7 100644 --- a/src/lib/libast/misc/error.c +++ b/src/lib/libast/misc/error.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -50,10 +50,6 @@ * by 2009 _error_info_ can be static */ -#if _BLD_ast && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif - extern Error_info_t _error_info_; Error_info_t _error_info_ = @@ -69,13 +65,7 @@ Error_info_t _error_info_ = 0 /* catalog */ }; -#undef extern - -__EXTERN__(Error_info_t, _error_info_); - -__EXTERN__(Error_info_t*, _error_infop_); - -Error_info_t* _error_infop_ = &_error_info_; +extern Error_info_t* _error_infop_ = &_error_info_; /* * these should probably be in error_info diff --git a/src/lib/libast/misc/getenv.c b/src/lib/libast/misc/getenv.c index c145aedd2..a0a71d5b8 100644 --- a/src/lib/libast/misc/getenv.c +++ b/src/lib/libast/misc/getenv.c @@ -37,10 +37,6 @@ Intercepts_t intercepts * get name from the environment */ -#if defined(__EXPORT__) && defined(getenv) -#define extern __EXPORT__ -#endif - extern char* getenv(const char* name) { diff --git a/src/lib/libast/misc/optget.c b/src/lib/libast/misc/optget.c index 42ddc2e43..9ade62feb 100644 --- a/src/lib/libast/misc/optget.c +++ b/src/lib/libast/misc/optget.c @@ -340,19 +340,13 @@ static Msg_t C_LC_MESSAGES_libast[] = * by 2009 _opt_info_ can be static */ -#if _BLD_ast && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif - extern Opt_t _opt_info_; Opt_t _opt_info_ = { 0,0,0,0,0,0,0,{0},{0},0,0,0,{0},{0},&state }; -#undef extern +extern Opt_t _opt_info_; -__EXTERN__(Opt_t, _opt_info_); - -__EXTERN__(Opt_t*, _opt_infop_); +extern Opt_t* _opt_infop_; Opt_t* _opt_infop_ = &_opt_info_; diff --git a/src/lib/libast/misc/sigdata.c b/src/lib/libast/misc/sigdata.c index 273a78a8f..7defa2d7d 100644 --- a/src/lib/libast/misc/sigdata.c +++ b/src/lib/libast/misc/sigdata.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -32,9 +32,7 @@ #include "FEATURE/signal" -Sig_info_t _sig_info_ = { (char**)sig_name, (char**)sig_text, SIG_MAX }; - -__EXTERN__(Sig_info_t, _sig_info_); +Sig_info_t _sig_info_ = { (char**)sig_name, (char**)sig_text, SIG_MAX }; #ifdef NoF NoF(sigdata) diff --git a/src/lib/libast/misc/signal.c b/src/lib/libast/misc/signal.c index 618e66ef1..f96a80dbc 100644 --- a/src/lib/libast/misc/signal.c +++ b/src/lib/libast/misc/signal.c @@ -41,10 +41,6 @@ #undef _def_map_ast #include -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #if defined(SV_ABORT) #undef SV_INTERRUPT #define SV_INTERRUPT SV_ABORT diff --git a/src/lib/libast/misc/state.c b/src/lib/libast/misc/state.c index b7d0dbd58..463d82f18 100644 --- a/src/lib/libast/misc/state.c +++ b/src/lib/libast/misc/state.c @@ -39,4 +39,4 @@ _Ast_info_t _ast_info = AST_VERSION /* version */ }; -__EXTERN__(_Ast_info_t, _ast_info); +extern _Ast_info_t _ast_info; diff --git a/src/lib/libast/misc/stk.c b/src/lib/libast/misc/stk.c index cd9ad2549..077904771 100644 --- a/src/lib/libast/misc/stk.c +++ b/src/lib/libast/misc/stk.c @@ -61,9 +61,7 @@ typedef char* (*_stk_overflow_)(int); static int stkexcept(Sfio_t*,int,void*,Sfdisc_t*); static Sfdisc_t stkdisc = { 0, 0, 0, stkexcept }; -Sfio_t _Stak_data = SFNEW((char*)0,0,-1,SF_STATIC|SF_WRITE|SF_STRING,&stkdisc); - -__EXTERN__(Sfio_t, _Stak_data); +Sfio_t _Stak_data = SFNEW((char*)0,0,-1,SF_STATIC|SF_WRITE|SF_STRING,&stkdisc); struct frame { diff --git a/src/lib/libast/port/lcgen.c b/src/lib/libast/port/lcgen.c index dfff56718..c6be6827f 100644 --- a/src/lib/libast/port/lcgen.c +++ b/src/lib/libast/port/lcgen.c @@ -653,10 +653,6 @@ main(int argc, char** argv) fprintf(hf, "\tunsigned int\t\tflags;\n"); fprintf(hf, "} Lc_category_t;\n"); fprintf(hf, "\n"); - fprintf(hf, "#if _BLD_ast && defined(__EXPORT__)\n"); - fprintf(hf, "#define extern\t\t__EXPORT__\n"); - fprintf(hf, "#endif\n"); - fprintf(hf, "\n"); fprintf(hf, "extern size_t\t\tlccanon(Lc_t*, unsigned long flags, char*, size_t);\n"); fprintf(hf, "extern Lc_category_t*\tlccategories(void);\n"); fprintf(hf, "extern int\t\tlcindex(int, int);\n"); @@ -664,7 +660,6 @@ main(int argc, char** argv) fprintf(hf, "extern Lc_t*\t\tlcmake(const char*);\n"); fprintf(hf, "extern Lc_t*\t\tlcscan(Lc_t*);\n"); fprintf(hf, "\n"); - fprintf(hf, "#undef\textern\n"); fprintf(lf, "\nconst Lc_charset_t lc_charsets[] =\n{\n"); for (cp = (Charset_t*)state.charset.root; cp; cp = (Charset_t*)cp->link.next) { diff --git a/src/lib/libast/regex/regexec.c b/src/lib/libast/regex/regexec.c index 7e3566a9b..d5efa8a80 100644 --- a/src/lib/libast/regex/regexec.c +++ b/src/lib/libast/regex/regexec.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -57,10 +57,6 @@ regexec_20120528(const regex_t* p, const char* s, size_t nmatch, regmatch_t* mat * 20120528: regoff_t changed from int to ssize_t */ -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #undef regexec #if _map_libc #define regexec _ast_regexec diff --git a/src/lib/libast/regex/regnexec.c b/src/lib/libast/regex/regnexec.c index 220a24561..217ed6fe3 100644 --- a/src/lib/libast/regex/regnexec.c +++ b/src/lib/libast/regex/regnexec.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -2062,10 +2062,6 @@ regfree(regex_t* p) * 20120528: regoff_t changed from int to ssize_t */ -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #undef regnexec #if _map_libc #define regnexec _ast_regnexec diff --git a/src/lib/libast/regex/regrexec.c b/src/lib/libast/regex/regrexec.c index 8aaed26ba..08291ba37 100644 --- a/src/lib/libast/regex/regrexec.c +++ b/src/lib/libast/regex/regrexec.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -149,10 +149,6 @@ regrexec_20120528(const regex_t* p, const char* s, size_t len, size_t nmatch, re * 20120528: regoff_t changed from int to ssize_t */ -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #undef regrexec #if _map_libc #define regrexec _ast_regrexec diff --git a/src/lib/libast/regex/regsubexec.c b/src/lib/libast/regex/regsubexec.c index a7a6f019d..3c337ee1d 100644 --- a/src/lib/libast/regex/regsubexec.c +++ b/src/lib/libast/regex/regsubexec.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -199,10 +199,6 @@ regsubexec(const regex_t* p, const char* s, size_t nmatch, regmatch_t* match) * 20120528: regoff_t changed from int to ssize_t */ -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #undef regsubexec #if _map_libc #define regsubexec _ast_regsubexec diff --git a/src/lib/libast/sfio/_sfgetl.c b/src/lib/libast/sfio/_sfgetl.c index ad363975f..c685a7556 100644 --- a/src/lib/libast/sfio/_sfgetl.c +++ b/src/lib/libast/sfio/_sfgetl.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -26,10 +26,6 @@ * for backwards compatibility with pre-threaded sfgetl() inline */ -#ifdef __EXPORT__ -#define extern __EXPORT__ -#endif - extern Sflong_t _sfgetl(reg Sfio_t* f) { diff --git a/src/lib/libast/sfio/_sfgetl2.c b/src/lib/libast/sfio/_sfgetl2.c index 7c5854973..dd921e5af 100644 --- a/src/lib/libast/sfio/_sfgetl2.c +++ b/src/lib/libast/sfio/_sfgetl2.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -26,14 +26,8 @@ #undef _sfgetl2 -#if _BLD_sfio && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern long _sfgetl2(Sfio_t*, long); -#undef extern - long _sfgetl2(reg Sfio_t* f, long v) { if (v < 0) diff --git a/src/lib/libast/sfio/_sfgetu.c b/src/lib/libast/sfio/_sfgetu.c index c44bac8ae..e1af0a2de 100644 --- a/src/lib/libast/sfio/_sfgetu.c +++ b/src/lib/libast/sfio/_sfgetu.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -26,10 +26,6 @@ * for backwards compatibility with pre-threaded sfgetl() inline */ -#ifdef __EXPORT__ -#define extern __EXPORT__ -#endif - extern Sfulong_t _sfgetu(reg Sfio_t* f) { diff --git a/src/lib/libast/sfio/_sfgetu2.c b/src/lib/libast/sfio/_sfgetu2.c index f84364567..25cfd57fe 100644 --- a/src/lib/libast/sfio/_sfgetu2.c +++ b/src/lib/libast/sfio/_sfgetu2.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -26,14 +26,8 @@ #undef _sfgetu2 -#if _BLD_sfio && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern long _sfgetu2(Sfio_t*, long); -#undef extern - long _sfgetu2(reg Sfio_t* f, long v) { if (v < 0) diff --git a/src/lib/libast/sfio/_sfopen.c b/src/lib/libast/sfio/_sfopen.c index fb469fa2b..e5171b37d 100644 --- a/src/lib/libast/sfio/_sfopen.c +++ b/src/lib/libast/sfio/_sfopen.c @@ -29,12 +29,7 @@ ** Written by Kiem-Phong Vo. */ -#if _BLD_sfio && defined(__EXPORT__) -#define extern __EXPORT__ -#endif extern -#undef extern - Sfio_t* _sfopen(Sfio_t* f, /* old stream structure */ const char* file, /* file/string to be opened */ const char* mode) /* mode of the stream */ diff --git a/src/lib/libast/sfio/sfextern.c b/src/lib/libast/sfio/sfextern.c index e7a932c5e..a680d22b5 100644 --- a/src/lib/libast/sfio/sfextern.c +++ b/src/lib/libast/sfio/sfextern.c @@ -46,14 +46,11 @@ Sfextern_t _Sfextern = }; ssize_t _Sfi = -1; /* value for a few fast macro functions */ -ssize_t _Sfmaxr = 0; /* default (unlimited) max record size */ +ssize_t _Sfmaxr = 0; /* default (unlimited) max record size */ -Sfio_t _Sfstdin = SFNEW(NIL(char*),-1,0, - (SF_READ |SF_STATIC),NIL(Sfdisc_t*)); -Sfio_t _Sfstdout = SFNEW(NIL(char*),-1,1, - (SF_WRITE|SF_STATIC),NIL(Sfdisc_t*)); -Sfio_t _Sfstderr = SFNEW(NIL(char*),-1,2, - (SF_WRITE|SF_STATIC),NIL(Sfdisc_t*)); +Sfio_t _Sfstdin = SFNEW(NIL(char*),-1,0,(SF_READ |SF_STATIC),NIL(Sfdisc_t*)); +Sfio_t _Sfstdout = SFNEW(NIL(char*),-1,1,(SF_WRITE|SF_STATIC),NIL(Sfdisc_t*)); +Sfio_t _Sfstderr = SFNEW(NIL(char*),-1,2,(SF_WRITE|SF_STATIC),NIL(Sfdisc_t*)); #undef sfstdin #undef sfstdout @@ -62,11 +59,3 @@ Sfio_t _Sfstderr = SFNEW(NIL(char*),-1,2, Sfio_t* sfstdin = &_Sfstdin; Sfio_t* sfstdout = &_Sfstdout; Sfio_t* sfstderr = &_Sfstderr; - -__EXTERN__(ssize_t,_Sfi); -__EXTERN__(Sfio_t,_Sfstdin); -__EXTERN__(Sfio_t,_Sfstdout); -__EXTERN__(Sfio_t,_Sfstderr); -__EXTERN__(Sfio_t*,sfstdin); -__EXTERN__(Sfio_t*,sfstdout); -__EXTERN__(Sfio_t*,sfstderr); diff --git a/src/lib/libast/sfio/sfhdr.h b/src/lib/libast/sfio/sfhdr.h index f86894911..c868b091e 100644 --- a/src/lib/libast/sfio/sfhdr.h +++ b/src/lib/libast/sfio/sfhdr.h @@ -973,20 +973,11 @@ extern int _sfsetpool(Sfio_t*); extern char* _sfcvt(void*,char*,size_t,int,int*,int*,int*,int); extern char** _sfgetpath(char*); -#if _BLD_sfio && defined(__EXPORT__) -#define extern __EXPORT__ -#endif -#if !_BLD_sfio && defined(__IMPORT__) -#define extern extern __IMPORT__ -#endif - extern Sfextern_t _Sfextern; extern int _sfmode(Sfio_t*, int, int); extern int _sftype(const char*, int*, int*); -#undef extern - #ifndef errno extern int errno; #endif diff --git a/src/lib/libast/sfio/sfpeek.c b/src/lib/libast/sfio/sfpeek.c index c7897a026..53b0dedfc 100644 --- a/src/lib/libast/sfio/sfpeek.c +++ b/src/lib/libast/sfio/sfpeek.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -28,10 +28,6 @@ ** Written by Kiem-Phong Vo (06/27/90). */ -#if _BLD_sfio && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern ssize_t sfpeek(reg Sfio_t* f, /* file to peek */ void** bp, /* start of data area */ reg size_t size) /* size of peek */ diff --git a/src/lib/libast/sfio/sfstrtof.h b/src/lib/libast/sfio/sfstrtof.h index 5dd9c91e0..0c7e95d65 100644 --- a/src/lib/libast/sfio/sfstrtof.h +++ b/src/lib/libast/sfio/sfstrtof.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -160,25 +160,17 @@ typedef struct S2F_part_s #if S2F_static > 0 static -#else -#if S2F_static < 0 || !defined(S2F_static) -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif +#elif S2F_static < 0 || !defined(S2F_static) extern -#undef extern -#endif #endif S2F_number #if S2F_scan S2F_function(void* s, S2F_get_f get) -#else -#if S2F_size +#elif S2F_size S2F_function(const char* str, size_t size, char** end) #else S2F_function(const char* str, char** end) #endif -#endif { #if !S2F_scan register unsigned char* s = (unsigned char*)str; diff --git a/src/lib/libast/stdio/_filbuf.c b/src/lib/libast/stdio/_filbuf.c index 5e6906cb2..a824ed596 100644 --- a/src/lib/libast/stdio/_filbuf.c +++ b/src/lib/libast/stdio/_filbuf.c @@ -23,10 +23,6 @@ #include "stdhdr.h" -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int _filbuf(Sfio_t* f) { diff --git a/src/lib/libast/stdio/_flsbuf.c b/src/lib/libast/stdio/_flsbuf.c index 5964f3ecc..2142c499a 100644 --- a/src/lib/libast/stdio/_flsbuf.c +++ b/src/lib/libast/stdio/_flsbuf.c @@ -29,10 +29,6 @@ NoN(_flsbuf) #else -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern int _flsbuf(int c, Sfio_t* f) { diff --git a/src/lib/libast/stdio/stdhdr.h b/src/lib/libast/stdio/stdhdr.h index bf43c0ec3..fda4b953f 100644 --- a/src/lib/libast/stdio/stdhdr.h +++ b/src/lib/libast/stdio/stdhdr.h @@ -45,10 +45,6 @@ f->bits |= SF_WC; \ } while (0) -#ifdef __EXPORT__ -#define extern __EXPORT__ -#endif - extern int sfdcwide(Sfio_t*); #endif diff --git a/src/lib/libast/string/strdup.c b/src/lib/libast/string/strdup.c index 934be404c..c8308f470 100644 --- a/src/lib/libast/string/strdup.c +++ b/src/lib/libast/string/strdup.c @@ -38,10 +38,6 @@ * return a copy of s using malloc */ -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - /* * Avoid a null-test optimization bug caused by glibc's headers * by naming this function '_ast_strdup' instead of 'strdup'. diff --git a/src/lib/libast/string/strerror.c b/src/lib/libast/string/strerror.c index 2df091435..31dd96ceb 100644 --- a/src/lib/libast/string/strerror.c +++ b/src/lib/libast/string/strerror.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -135,10 +135,6 @@ _ast_strerror(int err) #if !_lib_strerror -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern char* strerror(int err) { diff --git a/src/lib/libast/string/strlcat.c b/src/lib/libast/string/strlcat.c index 572e68237..c51f3ffb0 100644 --- a/src/lib/libast/string/strlcat.c +++ b/src/lib/libast/string/strlcat.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -45,10 +45,6 @@ NoN(strlcat) * min(n,strlen(s))+strlen(t) returned */ -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern size_t strlcat(register char* s, register const char* t, register size_t n) { diff --git a/src/lib/libast/string/strlcpy.c b/src/lib/libast/string/strlcpy.c index 91a370935..e30ade3d0 100644 --- a/src/lib/libast/string/strlcpy.c +++ b/src/lib/libast/string/strlcpy.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -45,10 +45,6 @@ NoN(strlcpy) * strlen(t) returned */ -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - extern size_t strlcpy(register char* s, register const char* t, register size_t n) { diff --git a/src/lib/libast/string/strtoi.h b/src/lib/libast/string/strtoi.h index 2b0908a7f..b3ee430a1 100644 --- a/src/lib/libast/string/strtoi.h +++ b/src/lib/libast/string/strtoi.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -183,11 +183,7 @@ static const S2I_unumber mm[] = S2I_umax / 64, }; -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif extern S2I_type -#undef extern #if S2I_size #if S2I_multiplier S2I_function(const char* a, size_t size, char** e, char* basep, int m) diff --git a/src/lib/libast/tm/tmdata.c b/src/lib/libast/tm/tmdata.c index f44f1b0a8..1a81a95ac 100644 --- a/src/lib/libast/tm/tmdata.c +++ b/src/lib/libast/tm/tmdata.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -271,21 +271,7 @@ static Tm_zone_t zone[] = /* * 2007-03-19 move tm_data from _tm_data_ to (*_tm_datap_) * to allow future Tm_data_t growth - * by 2009 _tm_data_ can be static */ -#if _BLD_ast && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif - -extern Tm_data_t _tm_data_; - -#undef extern - -Tm_data_t _tm_data_ = { format, lex, digit, days, sum, leap, zone }; - -__EXTERN__(Tm_data_t, _tm_data_); - -__EXTERN__(Tm_data_t*, _tm_datap_); - +static Tm_data_t _tm_data_ = { format, lex, digit, days, sum, leap, zone }; Tm_data_t* _tm_datap_ = &_tm_data_; diff --git a/src/lib/libast/tm/tminit.c b/src/lib/libast/tm/tminit.c index b1930cbbc..719b24cad 100644 --- a/src/lib/libast/tm/tminit.c +++ b/src/lib/libast/tm/tminit.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -67,23 +67,9 @@ static const Namval_t options[] = /* * 2007-03-19 move tm_info from _tm_info_ to (*_tm_infop_) * to allow future Tm_info_t growth - * by 2009 _tm_info_ can be static */ -#if _BLD_ast && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif - -extern Tm_info_t _tm_info_; - -#undef extern - -Tm_info_t _tm_info_ = { 0 }; - -__EXTERN__(Tm_info_t, _tm_info_); - -__EXTERN__(Tm_info_t*, _tm_infop_); - +static Tm_info_t _tm_info_ = { 0 }; Tm_info_t* _tm_infop_ = &_tm_info_; #if _tzset_environ diff --git a/src/lib/libast/tm/tmlocale.c b/src/lib/libast/tm/tmlocale.c index e85402336..3ec5f7043 100644 --- a/src/lib/libast/tm/tmlocale.c +++ b/src/lib/libast/tm/tmlocale.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -179,8 +179,6 @@ static const Map_t map[] = LOCALE_SMONTHNAME12, (TM_MONTH+11), }; -#undef extern - /* * convert MS Word date spec w to POSIX strftime format f * next char after f returned diff --git a/src/lib/libast/vmalloc/malloc.c b/src/lib/libast/vmalloc/malloc.c index 9ef7ad663..d49ffc15d 100644 --- a/src/lib/libast/vmalloc/malloc.c +++ b/src/lib/libast/vmalloc/malloc.c @@ -145,10 +145,6 @@ lcl_getenv(const char* s) #define VMUNBLOCK #endif -#if defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif - static int _Vmflinit = 0; #define VMFLINIT() \ { if(!_Vmflinit) vmflinit(); \ @@ -742,8 +738,6 @@ extern void* __libc_valloc(size_t n) { return valloc(n); } #endif /* _map_malloc */ -#undef extern - #if _hdr_malloc /* need the mallint interface for statistics, etc. */ #undef calloc @@ -766,10 +760,6 @@ extern void* __libc_valloc(size_t n) { return valloc(n); } typedef struct mallinfo Mallinfo_t; typedef struct mstats Mstats_t; -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #if _lib_mallopt extern int mallopt(int cmd, int value) { @@ -813,11 +803,9 @@ extern Mstats_t mstats(void) } return ms; } -#endif /*_lib_mstats*/ +#endif /* _lib_mstats */ -#undef extern - -#endif/*_hdr_malloc*/ +#endif /* _hdr_malloc */ #else @@ -828,10 +816,6 @@ extern Mstats_t mstats(void) #define setregmax(n) -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #if !_malloc_hook extern void _ast_free(void* p) { free(p); } @@ -852,8 +836,6 @@ extern void* _ast_pvalloc(size_t n) { return pvalloc(n); } extern void* _ast_valloc(size_t n) { return valloc(n); } #endif -#undef extern - #if _hdr_malloc #undef mallinfo @@ -873,10 +855,6 @@ extern void* _ast_valloc(size_t n) { return valloc(n); } typedef struct mallinfo Mallinfo_t; typedef struct mstats Mstats_t; -#if defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #if _lib_mallopt extern int _ast_mallopt(int cmd, int value) { return mallopt(cmd, value); } #endif @@ -889,8 +867,6 @@ extern Mallinfo_t _ast_mallinfo(void) { return mallinfo(); } extern Mstats_t _ast_mstats(void) { return mstats(); } #endif -#undef extern - #endif /*_hdr_malloc*/ #endif /*!_std_malloc*/ diff --git a/src/lib/libast/vmalloc/vmbest.c b/src/lib/libast/vmalloc/vmbest.c index db2c9f5a2..c38c5e8a0 100644 --- a/src/lib/libast/vmalloc/vmbest.c +++ b/src/lib/libast/vmalloc/vmbest.c @@ -1291,12 +1291,12 @@ Vmalloc_t _Vmheap = NIL(Vmalloc_t*) /* next */ }; -__DEFINE__(Vmalloc_t*, Vmheap, &_Vmheap); -__DEFINE__(Vmalloc_t*, Vmregion, &_Vmheap); -__DEFINE__(Vmethod_t*, Vmbest, &_Vmbest); -__DEFINE__(Vmdisc_t*, Vmdcsystem, (Vmdisc_t*)(&_Vmdcsystem) ); +Vmalloc_t* Vmheap = &_Vmheap; +Vmalloc_t* Vmregion = &_Vmheap; +Vmethod_t* Vmbest = &_Vmbest; +Vmdisc_t* Vmdcsystem = (Vmdisc_t*)(&_Vmdcsystem); #if _mem_sbrk -__DEFINE__(Vmdisc_t*, Vmdcsbrk, (Vmdisc_t*)(&_Vmdcsystem) ); +Vmdisc_t* Vmdcsbrk = (Vmdisc_t*)(&_Vmdcsystem); #endif #ifdef NoF diff --git a/src/lib/libast/vmalloc/vmdcheap.c b/src/lib/libast/vmalloc/vmdcheap.c index 148a835bf..f11b8001c 100644 --- a/src/lib/libast/vmalloc/vmdcheap.c +++ b/src/lib/libast/vmalloc/vmdcheap.c @@ -43,7 +43,7 @@ static void* heapmem(Vmalloc_t* vm, /* region doing allocation from */ } static Vmdisc_t _Vmdcheap = { heapmem, NIL(Vmexcept_f), 0 }; -__DEFINE__(Vmdisc_t*,Vmdcheap,&_Vmdcheap); +Vmdisc_t* Vmdcheap = &_Vmdcheap; #ifdef NoF NoF(vmdcheap) diff --git a/src/lib/libast/vmalloc/vmdebug.c b/src/lib/libast/vmalloc/vmdebug.c index 709839745..139164b80 100644 --- a/src/lib/libast/vmalloc/vmdebug.c +++ b/src/lib/libast/vmalloc/vmdebug.c @@ -637,7 +637,7 @@ static Vmethod_t _Vmdebug = VM_MTDEBUG }; -__DEFINE__(Vmethod_t*,Vmdebug,&_Vmdebug); +Vmethod_t* Vmdebug = &_Vmdebug; #ifdef NoF NoF(vmdebug) diff --git a/src/lib/libast/vmalloc/vmlast.c b/src/lib/libast/vmalloc/vmlast.c index e1ce08e63..e66308bbb 100644 --- a/src/lib/libast/vmalloc/vmlast.c +++ b/src/lib/libast/vmalloc/vmlast.c @@ -367,7 +367,7 @@ static Vmethod_t _Vmlast = VM_MTLAST }; -__DEFINE__(Vmethod_t*,Vmlast,&_Vmlast); +Vmethod_t* Vmlast = &_Vmlast; #ifdef NoF NoF(vmlast) diff --git a/src/lib/libast/vmalloc/vmpool.c b/src/lib/libast/vmalloc/vmpool.c index 2f1f99587..de628f7ed 100644 --- a/src/lib/libast/vmalloc/vmpool.c +++ b/src/lib/libast/vmalloc/vmpool.c @@ -252,7 +252,7 @@ static Vmethod_t _Vmpool = VM_MTPOOL }; -__DEFINE__(Vmethod_t*,Vmpool,&_Vmpool); +Vmethod_t* Vmpool = &_Vmpool; #ifdef NoF NoF(vmpool) diff --git a/src/lib/libast/vmalloc/vmprofile.c b/src/lib/libast/vmalloc/vmprofile.c index 43cd67e5b..04437f2da 100644 --- a/src/lib/libast/vmalloc/vmprofile.c +++ b/src/lib/libast/vmalloc/vmprofile.c @@ -604,7 +604,7 @@ static Vmethod_t _Vmprofile = VM_MTPROFILE }; -__DEFINE__(Vmethod_t*,Vmprofile,&_Vmprofile); +Vmethod_t* Vmprofile = &_Vmprofile; #ifdef NoF NoF(vmprofile) diff --git a/src/lib/libcmd/cmd.h b/src/lib/libcmd/cmd.h index 9439e4c76..176503136 100644 --- a/src/lib/libcmd/cmd.h +++ b/src/lib/libcmd/cmd.h @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * 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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -37,14 +37,8 @@ #define ERROR_CALLBACK ERROR_SET -#if _BLD_cmd && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #include -#undef extern - #if defined(CMD_BUILTIN) && !defined(CMD_STANDALONE) #define CMD_STANDALONE CMD_BUILTIN #endif @@ -150,14 +144,8 @@ main(int argc, char** argv) #define cmdinit(a,b,c,d,e) do{if((c)&&!CMD_CONTEXT(c))c=0;if(_cmd_init(a,b,c,d,e))return -1;}while(0) #endif -#if _BLD_cmd && defined(__EXPORT__) -#define extern extern __EXPORT__ -#endif - extern int _cmd_init(int, char**, Shbltin_t*, const char*, int); -#undef extern - #endif #endif diff --git a/src/lib/libdll/dlfcn.c b/src/lib/libdll/dlfcn.c index 062ba1b63..ce72110b5 100644 --- a/src/lib/libdll/dlfcn.c +++ b/src/lib/libdll/dlfcn.c @@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1997-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 * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -34,10 +34,6 @@ static const char id[] = "\n@(#)$Id: dll library (AT&T Research) 2010-10-20 $\0\ #define T(x) ERROR_dictionary(x) -#if _BLD_dll && defined(__EXPORT__) -#define extern __EXPORT__ -#endif - #if _hdr_dlfcn && _lib_dlopen /* diff --git a/src/lib/libdll/features/dll b/src/lib/libdll/features/dll index b9751325d..c13a95e56 100644 --- a/src/lib/libdll/features/dll +++ b/src/lib/libdll/features/dll @@ -220,10 +220,6 @@ tst - -lm - - output{ printf("extern int dlclose(void*);\n"); printf("extern char* dlerror(void);\n"); #endif - printf("\n"); - printf("#if _BLD_dll && defined(__EXPORT__)\n"); - printf("#define extern __EXPORT__\n"); - printf("#endif\n"); printf("\n"); printf("extern Dllinfo_t* dllinfo(void);\n"); printf("extern void* dllplugin(const char*, const char*, const char*, unsigned long, unsigned long*, int, char*, size_t);\n"); @@ -250,8 +246,6 @@ tst - -lm - - output{ printf("extern Dllscan_t* dllsopen(const char*, const char*, const char*);\n"); printf("extern Dllent_t* dllsread(Dllscan_t*);\n"); printf("extern int dllsclose(Dllscan_t*);\n"); - printf("\n"); - printf("#undef extern\n"); #if _hdr_rld_interface if (i >= 0) {