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

cleanup: get rid of KSHELL and _BLD_shell preprocessor macros

Once upon a time it might have been possible to build certain parts
of ksh, such as the emacs and vi editors and possibly even the
name/value library (nval(3)) as independent libraries. But given
the depressing amount of bit rot in the code that we inherited, I
am certain that disabling either of these macros had been resulting
in a broken build for many years before AT&T abandoned this code
base. These are certainly not going to be useful now.

Meanwhile the KSHELL macro got in the way of me today, because the
Mamfile did not define it for all the .c files, but some headers
declared some functionality conditionally upon that macro. So
including <io.h> in, e.g., nvdisc.c did not declare the same
functions as including that header in files with KSHELL defined.
This inconsistency is now gone as well, for various files.

I'm currently working on making it possible once again to build
libshell as a dynamic library; that should be good enough. And that
never involved disabling either of these macros.
This commit is contained in:
Martijn Dekker 2021-12-08 22:16:11 +01:00
parent 2b8eaa6609
commit aa3048880b
18 changed files with 102 additions and 285 deletions

View file

@ -2152,7 +2152,6 @@ static void comsubst(Mac_t *mp,register Shnode_t* t, int type)
mp->shp->inlineno = c;
type = 1;
}
#if KSHELL
if(t)
{
fcsave(&save);
@ -2203,9 +2202,6 @@ static void comsubst(Mac_t *mp,register Shnode_t* t, int type)
sh_onstate(SH_HISTORY);
if(was_verbose)
sh_onstate(SH_VERBOSE);
#else
sp = sfpopen(NIL(Sfio_t*),str,"r");
#endif
*mp = savemac;
np = sh_scoped(mp->shp,IFSNOD);
nv_putval(np,mp->ifsp,NV_RDONLY);