1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 11:42:21 +00:00

Fix math feature tests when compiling with tcc (re: 92f7ca54) (#303)

Commit 92f7ca54 broke compilation with tcc on Linux. The following
error would occur while compiling ksh with tcc:

  In file included from /home/johno/GitRepos/KornShell/ksh/src/cmd/ksh93/data/strdata.c:105:
  ./FEATURE/math:91: error: too many basic types
  mamake [cmd/ksh93]: *** exit code 1 making strdata.o

The build failure is fixed by backporting the relevant bugfix from
the 93v- version of iffe.

src/cmd/INIT/iffe.sh:
- Backport the 2013 iffe bugfix for the intrinsic function test to
  rule out type names (dated 2013-08-11 in the 93v- changelog).
This commit is contained in:
Johnothan King 2021-05-11 23:49:42 -07:00 committed by Martijn Dekker
parent ac56614a95
commit 2e6346ef52

View file

@ -4066,6 +4066,9 @@ $std
$usr $usr
$pre $pre
$inc $inc
#ifdef _IFFE_type
$v i;
#else
typedef int (*_IFFE_fun)(); typedef int (*_IFFE_fun)();
#ifdef _IFFE_extern #ifdef _IFFE_extern
_BEGIN_EXTERNS_ _BEGIN_EXTERNS_
@ -4073,6 +4076,7 @@ extern int $v();
_END_EXTERNS_ _END_EXTERNS_
#endif #endif
static _IFFE_fun i=(_IFFE_fun)$v;int main(){return ((unsigned int)i)^0xaaaa;} static _IFFE_fun i=(_IFFE_fun)$v;int main(){return ((unsigned int)i)^0xaaaa;}
#endif
" "
d=-D_IFFE_extern d=-D_IFFE_extern
if compile $cc -c $tmp.c <&$nullin >&$nullout if compile $cc -c $tmp.c <&$nullin >&$nullout
@ -4100,6 +4104,8 @@ static _IFFE_fun i=(_IFFE_fun)$v;int main(){return ((unsigned int)i)^0xaaaa;}
;; ;;
esac esac
fi fi
else if compile $cc -D_IFFE_type -c $tmp.c <&$nullin >&$nullout
then c=1
else case $intrinsic in else case $intrinsic in
'') copy $tmp.c " '') copy $tmp.c "
$tst $tst
@ -4117,9 +4123,11 @@ static int ((*i)())=foo;int main(){return(i==0);}
intrinsic=$? intrinsic=$?
;; ;;
esac esac
c=$intrinsic
fi
case $o in case $o in
mth) report $intrinsic 1 "$v() in math lib" "$v() not in math lib" "default for function $v()" ;; mth) report $c 1 "$v() in math lib" "$v() not in math lib" "default for function $v()" ;;
*) report $intrinsic 1 "$v() in default lib(s)" "$v() not in default lib(s)" "default for function $v()" ;; *) report $c 1 "$v() in default lib(s)" "$v() not in default lib(s)" "default for function $v()" ;;
esac esac
fi fi
;; ;;