Fix 386er problem by using ecvt_r

parent fbd00c7b
Pipeline #1317 canceled with stage
......@@ -429,8 +429,6 @@ Dynamic NC generation disabled."
;;
i*86)
machine=386
test -z "$ac_cv_func_ecvt_r" && ac_cv_func_ecvt_r=no
AC_REPLACE_FUNCS(ecvt_r)
CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr"
CFLAGS_1="$CFLAGS"
CFLAGS="$CFLAGS_1 -march=athlon64 -mtune=generic"
......@@ -1229,6 +1227,12 @@ AC_CHECK_FUNC(getopt_long,[true],[AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1)])
AC_CHECK_FUNCS(expm1 log1p)
AC_CHECK_FUNCS(mcheck mprobe)
AC_REPLACE_FUNCS(rint)
if test $machine = 386
then
test -z "$ac_cv_func_ecvt_r" && ac_cv_func_ecvt_r=no
AC_REPLACE_FUNCS(ecvt_r)
AC_DEFINE(ECVT_FLAG,,[Define if you want to use ECVT])
fi
#No check for select, because our replacement is no good under
#anything but DOS
AC_CHECK_HEADERS(sys/mman.h sys/epoll.h fnmatch.h alloca.h wchar.h endian.h spawn.h)
......
......@@ -626,9 +626,11 @@ struct Cellpair represent(Float r, Address c_addr, UCell u, Cell *np)
}
repstr("infinity",c_addr,u);
} else {
int ret;
ok = -1;
r = fabs(r);
snprintf(buf,u+8,"%.*e",r,u-1);
if(snprintf(buf,u+8,"%.*e",r,u-1)<0)
fprintf(stderr,"represent error: %s\n", strerror(errno));
for (s=buf, t=c_addr;; s++) {
char c = *s;
if ('0'<=c && c<='9')
......@@ -636,6 +638,7 @@ struct Cellpair represent(Float r, Address c_addr, UCell u, Cell *np)
else if (c != '.')
break;
}
fprintf(stderr, "ret=%d, r=%s, t=%p, c_addr=%p, u=%ld\n", ret, buf, t, c_addr, u);
/* fprintf(stderr,"r=%.*e, t=%p, c_addr=%p, u=%ld\n",r,u-1,t,c_addr,u);*/
assert(t == c_addr+u);
assert(*s == 'e');
......
......@@ -2589,7 +2589,7 @@ else
r3 = r2;
represent ( r c_addr u -- n f1 f2 ) float
#ifdef HAVE_ECVT_R
#ifdef ECVT_FLAG
char sig[0x40];
size_t siglen;
int flag;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment