mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
restore C90 compat: do not repeat a typedef (re: 3e0da770)
We try to stay compatibile with C90. Turns out that repeating a
typedef is valid only from C11 onwards, as a feature taken from
C++. So I goofed and broke the build on old or strict compilers.
src/cmd/ksh93/include/{name,shell}.h:
- union Value: Since we will now once again have to typecast to use
nvalue.bfp in any case, just make it a void pointer; that is how
pointers that require typecasts are handled in every other case.
- Since the funptr() macro needs a typecast to Shbltin_f which is
defined in libast's shcmd.h, move this macro to shell.h which
(unlike name.h) includes that header.
src/cmd/ksh93/sh/{init,nvdisc}.c:
- Typecast to void* when assigning to *->nvalue.bfp.
src/lib/libast/include/shcmd.h:
- Use shell_h_defined (introduced in 4491bc6a) and defs_h_defined
to check if ksh's shell.h or defs.h were included before shcmd.h,
instead of random macros defined by them; much clearer.
This commit is contained in:
parent
24c3d77e3c
commit
366efa4b06
5 changed files with 7 additions and 8 deletions
|
|
@ -69,7 +69,7 @@ struct Shbltin_s
|
|||
int invariant;
|
||||
};
|
||||
|
||||
#if defined(SH_VERSION) || defined(_SH_PRIVATE)
|
||||
#if defined(shell_h_defined) || defined(defs_h_defined)
|
||||
# undef Shell_t
|
||||
# undef Namval_t
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue