echo $ECHO_N "(cached) $ECHO_C" >&6
else
+ tcl_cv_type_64bit=none
+ # See if the compiler knows natively about __int64
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- tcl_cv_type_64bit=__int64
+ tcl_type_64bit=__int64
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-tcl_cv_type_64bit=none
- if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+tcl_type_64bit="long long"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ # See if we should use long anyway Note that we substitute in the
+ # type that is our current guess for a 64-bit type inside this check
+ # program, so it should be modified only carefully...
+ if test "$cross_compiling" = yes; then
+ :
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <unistd.h>
- int main() {exit(!(sizeof(long long) > sizeof(long)));}
+ int main() {exit(!(sizeof(${tcl_type_64bit}) > sizeof(long)));}
_ACEOF
rm -f conftest$ac_exeext
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- tcl_cv_type_64bit="long long"
+ tcl_cv_type_64bit=${tcl_type_64bit}
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+( exit $ac_status )
+:
fi
rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
fi
if test "${tcl_cv_type_64bit}" = none ; then
+ cat >>confdefs.h <<\_ACEOF
+#define TCL_WIDE_INT_IS_LONG 1
+_ACEOF
+
echo "$as_me:$LINENO: result: using long" >&5
echo "${ECHO_T}using long" >&6
elif test "${tcl_cv_type_64bit}" = "__int64" ; then
AC_DEFUN(TEA_TCL_64BIT_FLAGS, [
AC_MSG_CHECKING([for 64-bit integer type])
AC_CACHE_VAL(tcl_cv_type_64bit,[
+ tcl_cv_type_64bit=none
+ # See if the compiler knows natively about __int64
AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
- tcl_cv_type_64bit=__int64,tcl_cv_type_64bit=none
- AC_TRY_RUN([#include <unistd.h>
- int main() {exit(!(sizeof(long long) > sizeof(long)));}
- ], tcl_cv_type_64bit="long long"))])
+ tcl_type_64bit=__int64, tcl_type_64bit="long long")
+ # See if we should use long anyway Note that we substitute in the
+ # type that is our current guess for a 64-bit type inside this check
+ # program, so it should be modified only carefully...
+ AC_TRY_RUN([#include <unistd.h>
+ int main() {exit(!(sizeof(]${tcl_type_64bit}[) > sizeof(long)));}
+ ], tcl_cv_type_64bit=${tcl_type_64bit},:,:)])
if test "${tcl_cv_type_64bit}" = none ; then
+ AC_DEFINE(TCL_WIDE_INT_IS_LONG)
AC_MSG_RESULT([using long])
elif test "${tcl_cv_type_64bit}" = "__int64" ; then
# We actually want to use the default tcl.h checks in this