diff --git a/src/cmd/ksh93/bltins/print.c b/src/cmd/ksh93/bltins/print.c index 2d51a8b81..443e6c83a 100644 --- a/src/cmd/ksh93/bltins/print.c +++ b/src/cmd/ksh93/bltins/print.c @@ -243,11 +243,7 @@ int b_print(int argc, char *argv[], Shbltin_t *context) break; case ':': /* The following is for backward compatibility */ -#if OPT_VERSION >= 19990123 if(strcmp(opt_info.name,"-R")==0) -#else - if(strcmp(opt_info.option,"-R")==0) -#endif { rflag = 1; if(error_info.errors==0) diff --git a/src/cmd/ksh93/bltins/typeset.c b/src/cmd/ksh93/bltins/typeset.c index 21b56953d..52b9c899e 100644 --- a/src/cmd/ksh93/bltins/typeset.c +++ b/src/cmd/ksh93/bltins/typeset.c @@ -1043,11 +1043,7 @@ int b_builtin(int argc,char *argv[],Shbltin_t *context) if(list) sfprintf(sfstdout, "%s %08lu %s\n", arg, ver, path); #else -#if (_AST_VERSION>=20040404) if(!(library = dllplug(SH_ID,arg,NIL(char*),RTLD_LAZY,NIL(char*),0))) -#else - if(!(library = dllfind(arg,NIL(char*),RTLD_LAZY,NIL(char*),0))) -#endif { errormsg(SH_DICT,ERROR_exit(0),"%s: %s",arg,dlerror()); return(1); diff --git a/src/cmd/ksh93/include/defs.h b/src/cmd/ksh93/include/defs.h index f30b7dfc1..df5cdfbf6 100644 --- a/src/cmd/ksh93/include/defs.h +++ b/src/cmd/ksh93/include/defs.h @@ -29,6 +29,9 @@ #define defs_h_defined #include +#if !defined(AST_VERSION) || AST_VERSION < 20111111L +#error libast version 20111111 or later is required +#endif #if !SHOPT_MULTIBYTE /* disable multibyte without need for further '#if SHOPT_MULTIBYTE' */ # undef mbwide diff --git a/src/cmd/ksh93/include/fault.h b/src/cmd/ksh93/include/fault.h index 3e76b22f7..cf0d93fe2 100644 --- a/src/cmd/ksh93/include/fault.h +++ b/src/cmd/ksh93/include/fault.h @@ -98,11 +98,7 @@ struct checkpt int topfd; int mode; struct openlist *olist; -#if (ERROR_VERSION >= 20030214L) Error_context_t err; -#else - struct errorcontext err; -#endif }; #define sh_pushcontext(shp,bp,n)( (bp)->mode=(n) , (bp)->olist=0, \ diff --git a/src/cmd/ksh93/include/jobs.h b/src/cmd/ksh93/include/jobs.h index fd780c6ac..93e0ed3a2 100644 --- a/src/cmd/ksh93/include/jobs.h +++ b/src/cmd/ksh93/include/jobs.h @@ -118,14 +118,9 @@ extern struct jobs job; #ifdef vmlocked #define vmbusy() vmlocked(Vmregion) #else -#if VMALLOC_VERSION >= 20070911L #define vmbusy() (vmstat(0,0)!=0) #endif #endif -#endif -#ifndef vmbusy -#define vmbusy() 0 -#endif #define job_lock() (job.in_critical++) #define job_unlock() \ diff --git a/src/cmd/ksh93/include/streval.h b/src/cmd/ksh93/include/streval.h index 30008b5de..6e1155fcd 100644 --- a/src/cmd/ksh93/include/streval.h +++ b/src/cmd/ksh93/include/streval.h @@ -29,9 +29,7 @@ #include #include #include "defs.h" -#if _AST_VERSION >= 20030127L -# include -#endif +#include #if _ast_fltmax_double #define LDBL_LLONG_MAX DBL_LLONG_MAX diff --git a/src/cmd/ksh93/sh/expand.c b/src/cmd/ksh93/sh/expand.c index bfe33cf80..a9726101c 100644 --- a/src/cmd/ksh93/sh/expand.c +++ b/src/cmd/ksh93/sh/expand.c @@ -74,7 +74,6 @@ static struct glob *membase; -#if GLOB_VERSION >= 20010916L static char *nextdir(glob_t *gp, char *dir) { Shell_t *shp = sh_getinterp(); @@ -88,7 +87,6 @@ static char *nextdir(glob_t *gp, char *dir) return(pp->name); return(0); } -#endif int path_expand(Shell_t *shp,const char *pattern, struct argnod **arghead) { @@ -108,9 +106,7 @@ int path_expand(Shell_t *shp,const char *pattern, struct argnod **arghead) #if KSHELL extra += scantree(shp->alias_tree,pattern,arghead); extra += scantree(shp->fun_tree,pattern,arghead); -# if GLOB_VERSION >= 20010916L gp->gl_nextdir = nextdir; -# endif #endif /* KSHELL */ flags |= GLOB_COMPLETE; flags &= ~GLOB_NOCHECK; diff --git a/src/cmd/ksh93/sh/fault.c b/src/cmd/ksh93/sh/fault.c index 6c7919a28..5d138a23b 100644 --- a/src/cmd/ksh93/sh/fault.c +++ b/src/cmd/ksh93/sh/fault.c @@ -45,7 +45,7 @@ static int cursig = -1; #if !_std_malloc # include #endif -#if defined(VMFL) && (VMALLOC_VERSION>=20031205L) +#if defined(VMFL) /* * This exception handler is called after vmalloc() unlocks the region */ @@ -154,7 +154,7 @@ void sh_fault(register int sig) shp->trapnote |= SH_SIGSET; if(sig <= shp->gd->sigmax) shp->sigflag[sig] |= SH_SIGSET; -#if defined(VMFL) && (VMALLOC_VERSION>=20031205L) +#if defined(VMFL) if(abortsig(sig)) { /* abort inside malloc, process when malloc returns */ diff --git a/src/cmd/ksh93/sh/init.c b/src/cmd/ksh93/sh/init.c index f95fc7fb8..51c128e0c 100644 --- a/src/cmd/ksh93/sh/init.c +++ b/src/cmd/ksh93/sh/init.c @@ -361,19 +361,11 @@ static void put_cdpath(register Namval_t* np,const char *val,int flags,Namfun_t * This function needs to be modified to handle international * error message translations */ -#if ERROR_VERSION >= 20000101L static char* msg_translate(const char* catalog, const char* message) { NOT_USED(catalog); return((char*)message); } -#else - static char* msg_translate(const char* message, int type) - { - NOT_USED(type); - return((char*)message); - } -#endif /* Trap for LC_ALL, LC_CTYPE, LC_MESSAGES, LC_COLLATE and LANG */ static void put_lang(Namval_t* np,const char *val,int flags,Namfun_t *fp) @@ -467,10 +459,6 @@ static void put_cdpath(register Namval_t* np,const char *val,int flags,Namfun_t sh_lexstates[ST_BRACE]=(char*)sh_lexrstates[ST_BRACE]; } } -#if ERROR_VERSION < 20000101L - if(type==LC_ALL || type==LC_MESSAGES) - error_info.translate = msg_translate; -#endif } #endif /* _hdr_locale */ @@ -1243,9 +1231,7 @@ Shell_t *sh_init(register int argc,register char *argv[], Shinit_f userinit) shp->stk = stkstd; sfsetbuf(shp->strbuf,(char*)0,64); sh_onstate(SH_INIT); -#if ERROR_VERSION >= 20000102L error_info.catalog = e_dict; -#endif #if SHOPT_REGRESS { Opt_t* nopt; @@ -1325,17 +1311,8 @@ Shell_t *sh_init(register int argc,register char *argv[], Shinit_f userinit) char *cp=nv_getval(L_ARGNOD); char buff[PATH_MAX+1]; shp->gd->shpath = 0; -#if _AST_VERSION >= 20090202L if((n = pathprog(NiL, buff, sizeof(buff))) > 0 && n <= sizeof(buff)) shp->gd->shpath = strdup(buff); -#else - sfprintf(shp->strbuf,"/proc/%d/exe",getpid()); - if((n=readlink(sfstruse(shp->strbuf),buff,sizeof(buff)-1))>0) - { - buff[n] = 0; - shp->gd->shpath = strdup(buff); - } -#endif else if((cp && (sh_type(cp)&SH_TYPE_SH)) || (argc>0 && strchr(cp= *argv,'/'))) { if(*cp=='/') @@ -1472,11 +1449,9 @@ Shell_t *sh_init(register int argc,register char *argv[], Shinit_f userinit) shp->bltindata.shtrap = sh_trap; shp->bltindata.shexit = sh_exit; shp->bltindata.shbltin = sh_addbuiltin; -#if _AST_VERSION >= 20080617L shp->bltindata.shgetenv = sh_getenv; shp->bltindata.shsetenv = sh_setenviron; astintercept(&shp->bltindata,1); -#endif #if 0 #define NV_MKINTTYPE(x,y,z) nv_mkinttype(#x,sizeof(x),(x)-1<0,(y),(Namdisc_t*)z); NV_MKINTTYPE(pid_t,"process id",0); diff --git a/src/cmd/ksh93/sh/lex.c b/src/cmd/ksh93/sh/lex.c index 54507541c..2aa71a776 100644 --- a/src/cmd/ksh93/sh/lex.c +++ b/src/cmd/ksh93/sh/lex.c @@ -2263,15 +2263,7 @@ struct argnod *sh_endword(Shell_t *shp,int mode) break; } *--dp = 0; -#if ERROR_VERSION >= 20000317L msg = ERROR_translate(0,error_info.id,0,ep); -#else -# if ERROR_VERSION >= 20000101L - msg = ERROR_translate(error_info.id,ep); -# else - msg = ERROR_translate(ep,2); -# endif -#endif n = strlen(msg); dp = ep+n; if(sp-dp <= 1) diff --git a/src/cmd/ksh93/sh/name.c b/src/cmd/ksh93/sh/name.c index 278710893..a2db5cd91 100644 --- a/src/cmd/ksh93/sh/name.c +++ b/src/cmd/ksh93/sh/name.c @@ -1864,7 +1864,6 @@ void nv_putval(register Namval_t *np, const char *string, int flags) if(sp==up->cp && !(flags&NV_APPEND)) return; dot = strlen(sp); -#if (_AST_VERSION>=20030127L) if(nv_isattr(np,NV_BINARY)) { int oldsize = (flags&NV_APPEND)?nv_size(np):0; @@ -1899,7 +1898,6 @@ void nv_putval(register Namval_t *np, const char *string, int flags) return; } else -#endif { if(size==0 && nv_isattr(np,NV_HOST)!=NV_HOST &&nv_isattr(np,NV_LJUST|NV_RJUST|NV_ZFILL)) nv_setsize(np,size=dot); @@ -2809,7 +2807,6 @@ char *nv_getval(register Namval_t *np) return(fmtbase(ll,numeric, numeric&&numeric!=10)); } done: -#if (_AST_VERSION>=20030127L) /* * if NV_RAW flag is on, return pointer to binary data * otherwise, base64 encode the data and return this string @@ -2823,7 +2820,6 @@ done: *ep = 0; return(cp); } -#endif if(!nv_isattr(np,NV_LJUST|NV_RJUST) && (numeric=nv_size(np)) && up->cp && up->cp[numeric]) { char *cp = getbuf(numeric+1); diff --git a/src/cmd/ksh93/sh/path.c b/src/cmd/ksh93/sh/path.c index d0a7e90bd..5fef2b119 100644 --- a/src/cmd/ksh93/sh/path.c +++ b/src/cmd/ksh93/sh/path.c @@ -830,11 +830,7 @@ Pathcomp_t *path_absolute(Shell_t *shp,register const char *name, Pathcomp_t *pp if (dll = dllplugin(SH_ID, stakptr(m), NiL, SH_PLUGIN_VERSION, NiL, RTLD_LAZY, NiL, 0)) sh_addlib(shp,dll,stakptr(m),oldpp); #else -#if (_AST_VERSION>=20040404) if (dll = dllplug(SH_ID, stakptr(m), NiL, RTLD_LAZY, NiL, 0)) -#else - if (dll = dllfind(stakptr(m), NiL, RTLD_LAZY, NiL, 0)) -#endif { /* * this detects the 2007-05-11 builtin context change and also diff --git a/src/cmd/ksh93/sh/string.c b/src/cmd/ksh93/sh/string.c index 305448e6d..b0d17600c 100644 --- a/src/cmd/ksh93/sh/string.c +++ b/src/cmd/ksh93/sh/string.c @@ -703,15 +703,7 @@ char *sh_fmtqf(const char *string, int single, int fold) const char *_sh_translate(const char *message) { -#if ERROR_VERSION >= 20000317L return(ERROR_translate(0,0,e_dict,message)); -#else -#if ERROR_VERSION >= 20000101L - return(ERROR_translate(e_dict,message)); -#else - return(ERROR_translate(message,1)); -#endif -#endif } /* @@ -750,9 +742,7 @@ char *sh_checkid(char *str, char *last) return(last); } -#if _AST_VERSION <= 20000317L char *fmtident(const char *string) { return((char*)string); } -#endif diff --git a/src/cmd/ksh93/sh/subshell.c b/src/cmd/ksh93/sh/subshell.c index 141b8d8e6..87c7d65b2 100644 --- a/src/cmd/ksh93/sh/subshell.c +++ b/src/cmd/ksh93/sh/subshell.c @@ -72,11 +72,7 @@ static struct subshell struct Link *svar; /* save shell variable table */ Dt_t *sfun; /* function scope for subshell */ Pathcomp_t *pathlist; /* for PATH variable */ -#if (ERROR_VERSION >= 20030214L) struct Error_context_s *errcontext; -#else - struct errorcontext *errcontext; -#endif Shopt_t options;/* save shell options */ pid_t subpid; /* child process id */ Sfio_t* saveout;/*saved standard output */