Simplify integer type tests using Autoconf's ones (G. Dos Reis)

This commit is contained in:
Juan Jose Garcia Ripoll 2010-08-11 23:53:26 +02:00
parent 2f1e68128e
commit 5d76e2e302
2 changed files with 663 additions and 289 deletions

137
src/aclocal.m4 vendored
View file

@ -445,6 +445,21 @@ int main() {
}]])],[ECL_FILE_CNT=3],[])
fi
])
dnl ---------------------------------------------------------------------
dnl Check availability of standard sized integer types of a given width.
dnl On success, define the global variables ECL_INTx_T and ECL_UNITx_T to
dnl hold the names of the corresponding standard C integer types.
AC_DEFUN(ECL_CHECK_SIZED_INTEGER_TYPE,[
AC_TYPE_INT$1_T
AC_TYPE_UINT$1_T
if test "x$ac_cv_c_int$1_t" = xyes; then
eval ECL_INT$1_T="int$1_t"
eval ECL_UINT$1_T="uint$1_t"
AC_DEFINE_UNQUOTED([ecl_int$1_t],[int$1_t])
AC_DEFINE_UNQUOTED([ecl_uint$1_t],[uint$1_t])
fi])
dnl
dnl --------------------------------------------------------------
dnl Check the existence of different integer types and that they
@ -458,91 +473,12 @@ if test -z "${ECL_STDINT_HEADER}"; then
AC_CHECK_HEADER([inttypes.h],[AC_DEFINE(HAVE_INTTYPES_H)
ECL_STDINT_HEADER="#include <inttypes.h>"],[])
fi
if test -n "${ECL_STDINT_HEADER}" -a -z "${ECL_UINT8_T}"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#endif]], [[
{
uint8_t i = 0x80;
if (i == 0)
return 0;
if ((i << 1))
return 0;
if ((i - 1) != 0x7F)
return 0;
return 1;
}]])],[ECL_UINT8_T=uint8_t;ECL_INT8_T=int8_t],[])
fi
if test -z "${ECL_UINT8_T}"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
{
unsigned char c = 0x80;
if (i == 0)
return 0;
if ((i << 1))
return 0;
if ((i - 1) != 0x7F)
return 0;
return 1;
}]])],[ECL_UINT8_T="unsigned char";ECL_INT8_T="signed char"],[])
fi
if test -n "${ECL_STDINT_HEADER}" -a -z "${ECL_UINT16_T}"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#endif]], [[
{
uint16_t i = 0x8000UL;
if (i == 0)
return 0;
if ((i << 1))
return 0;
if ((i - 1) != 0x7FFFUL)
return 0;
return 1;
}]])],[ECL_UINT16_T=uint16_t;ECL_INT16_T=int16_t],[])
fi
if test -n "${ECL_STDINT_HEADER}" -a -z "${ECL_UINT32_T}"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#endif]], [[
{
uint32_t i = 0x80000000UL;
if (i == 0)
return 0;
if ((i << 1))
return 0;
if ((i - 1) != 0x7FFFFFFFUL)
return 0;
return 1;
}]])],[ECL_UINT32_T=uint32_t;ECL_INT32_T=int32_t],[])
fi
if test -n "${ECL_STDINT_HEADER}" -a -z "${ECL_UINT64_T}"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#endif]], [[
{
uint64_t i = 1;
i <<= 63; if (i == 0) return 0;
i <<= 1; if (i) return 0;
return 1;
}]])],[ECL_UINT64_T=uint64_t;ECL_INT64_T=int64_t],[])
fi
ECL_CHECK_SIZED_INTEGER_TYPE(8)
ECL_CHECK_SIZED_INTEGER_TYPE(16)
ECL_CHECK_SIZED_INTEGER_TYPE(32)
ECL_CHECK_SIZED_INTEGER_TYPE(64)
if test "${ECL_UINT16_T}${CL_FIXNUM_BITS}" = "16"; then
ECL_UINT16_T="cl_index"
ECL_INT16_T="cl_fixnum"
@ -555,38 +491,9 @@ if test "${ECL_UINT64_T}${CL_FIXNUM_BITS}" = "64"; then
ECL_UINT64_T="cl_index"
ECL_INT64_T="cl_fixnum"
fi
AC_MSG_CHECKING(uint8_t type)
if test "x${ECL_UINT8_T}" = "x" -o "x${ECL_UINT8_T}" = xno; then
AC_MSG_RESULT(none)
AC_MSG_ERROR(Can not build ECL without byte types)
else
AC_DEFINE_UNQUOTED([ecl_uint8_t],[$ECL_UINT8_T])
AC_DEFINE_UNQUOTED([ecl_int8_t],[$ECL_INT8_T])
AC_MSG_RESULT(${ECL_UINT8_T})
fi
AC_MSG_CHECKING(uint16_t type)
if test "x${ECL_UINT16_T}" = "x" -o "x${ECL_UINT16_T}" = xno; then
AC_MSG_RESULT(none)
else
AC_DEFINE_UNQUOTED([ecl_uint16_t],[$ECL_UINT16_T])
AC_DEFINE_UNQUOTED([ecl_int16_t],[$ECL_INT16_T])
AC_MSG_RESULT(${ECL_UINT16_T})
fi
AC_MSG_CHECKING(uint32_t type)
if test "x${ECL_UINT32_T}" = "x" -o "x${ECL_UINT32_T}" = xno; then
AC_MSG_RESULT(none)
else
AC_DEFINE_UNQUOTED([ecl_uint32_t],[$ECL_UINT32_T])
AC_DEFINE_UNQUOTED([ecl_int32_t],[$ECL_INT32_T])
AC_MSG_RESULT(${ECL_UINT32_T})
fi
AC_MSG_CHECKING(uint64_t type)
if test "x${ECL_UINT64_T}" = "x" -o "x${ECL_UINT64_T}" = xno; then
AC_MSG_RESULT(none)
else
AC_DEFINE_UNQUOTED([ecl_uint64_t],[$ECL_UINT64_T])
AC_DEFINE_UNQUOTED([ecl_int64_t],[$ECL_INT64_T])
AC_MSG_RESULT(${ECL_UINT64_T})
fi
])
dnl

815
src/configure vendored
View file

@ -9015,34 +9015,30 @@ fi
fi
if test -n "${ECL_STDINT_HEADER}" -a -z "${ECL_UINT8_T}"; then
cat >conftest.$ac_ext <<_ACEOF
{ $as_echo "$as_me:$LINENO: checking for int8_t" >&5
$as_echo_n "checking for int8_t... " >&6; }
if test "${ac_cv_c_int8_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_c_int8_t=no
for ac_type in 'int8_t' 'int' 'long int' \
'long long int' 'short int' 'signed char'; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#endif
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 1))];
test_array [0] = 0
{
uint8_t i = 0x80;
if (i == 0)
return 0;
if ((i << 1))
return 0;
if ((i - 1) != 0x7F)
return 0;
return 1;
}
;
return 0;
}
@ -9065,38 +9061,20 @@ $as_echo "$ac_try_echo") >&5
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ECL_UINT8_T=uint8_t;ECL_INT8_T=int8_t
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test -z "${ECL_UINT8_T}"; then
cat >conftest.$ac_ext <<_ACEOF
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 1)
< ($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 2))];
test_array [0] = 0
{
unsigned char c = 0x80;
if (i == 0)
return 0;
if ((i << 1))
return 0;
if ((i - 1) != 0x7F)
return 0;
return 1;
}
;
return 0;
}
@ -9119,7 +9097,19 @@ $as_echo "$ac_try_echo") >&5
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ECL_UINT8_T="unsigned char";ECL_INT8_T="signed char"
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
case $ac_type in
int8_t) ac_cv_c_int8_t=yes ;;
*) ac_cv_c_int8_t=$ac_type ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@ -9128,35 +9118,43 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_int8_t" != no && break
done
fi
if test -n "${ECL_STDINT_HEADER}" -a -z "${ECL_UINT16_T}"; then
cat >conftest.$ac_ext <<_ACEOF
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int8_t" >&5
$as_echo "$ac_cv_c_int8_t" >&6; }
case $ac_cv_c_int8_t in #(
no|yes) ;; #(
*)
cat >>confdefs.h <<_ACEOF
#define int8_t $ac_cv_c_int8_t
_ACEOF
;;
esac
{ $as_echo "$as_me:$LINENO: checking for uint8_t" >&5
$as_echo_n "checking for uint8_t... " >&6; }
if test "${ac_cv_c_uint8_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_c_uint8_t=no
for ac_type in 'uint8_t' 'unsigned int' 'unsigned long int' \
'unsigned long long int' 'unsigned short int' 'unsigned char'; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#endif
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(($ac_type) -1 >> (8 - 1) == 1)];
test_array [0] = 0
{
uint16_t i = 0x8000UL;
if (i == 0)
return 0;
if ((i << 1))
return 0;
if ((i - 1) != 0x7FFFUL)
return 0;
return 1;
}
;
return 0;
}
@ -9179,7 +9177,11 @@ $as_echo "$ac_try_echo") >&5
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ECL_UINT16_T=uint16_t;ECL_INT16_T=int16_t
case $ac_type in
uint8_t) ac_cv_c_uint8_t=yes ;;
*) ac_cv_c_uint8_t=$ac_type ;;
esac
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@ -9188,35 +9190,61 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_uint8_t" != no && break
done
fi
if test -n "${ECL_STDINT_HEADER}" -a -z "${ECL_UINT32_T}"; then
cat >conftest.$ac_ext <<_ACEOF
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint8_t" >&5
$as_echo "$ac_cv_c_uint8_t" >&6; }
case $ac_cv_c_uint8_t in #(
no|yes) ;; #(
*)
cat >>confdefs.h <<\_ACEOF
#define _UINT8_T 1
_ACEOF
cat >>confdefs.h <<_ACEOF
#define uint8_t $ac_cv_c_uint8_t
_ACEOF
;;
esac
if test "x$ac_cv_c_int8_t" = xyes; then
eval ECL_INT8_T="int8_t"
eval ECL_UINT8_T="uint8_t"
cat >>confdefs.h <<_ACEOF
#define ecl_int8_t int8_t
_ACEOF
cat >>confdefs.h <<_ACEOF
#define ecl_uint8_t uint8_t
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for int16_t" >&5
$as_echo_n "checking for int16_t... " >&6; }
if test "${ac_cv_c_int16_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_c_int16_t=no
for ac_type in 'int16_t' 'int' 'long int' \
'long long int' 'short int' 'signed char'; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#endif
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 1))];
test_array [0] = 0
{
uint32_t i = 0x80000000UL;
if (i == 0)
return 0;
if ((i << 1))
return 0;
if ((i - 1) != 0x7FFFFFFFUL)
return 0;
return 1;
}
;
return 0;
}
@ -9239,40 +9267,20 @@ $as_echo "$ac_try_echo") >&5
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ECL_UINT32_T=uint32_t;ECL_INT32_T=int32_t
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test -n "${ECL_STDINT_HEADER}" -a -z "${ECL_UINT64_T}"; then
cat >conftest.$ac_ext <<_ACEOF
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#endif
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 1)
< ($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 2))];
test_array [0] = 0
{
uint64_t i = 1;
i <<= 63; if (i == 0) return 0;
i <<= 1; if (i) return 0;
return 1;
}
;
return 0;
}
@ -9295,7 +9303,19 @@ $as_echo "$ac_try_echo") >&5
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ECL_UINT64_T=uint64_t;ECL_INT64_T=int64_t
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
case $ac_type in
int16_t) ac_cv_c_int16_t=yes ;;
*) ac_cv_c_int16_t=$ac_type ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@ -9304,7 +9324,519 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_int16_t" != no && break
done
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int16_t" >&5
$as_echo "$ac_cv_c_int16_t" >&6; }
case $ac_cv_c_int16_t in #(
no|yes) ;; #(
*)
cat >>confdefs.h <<_ACEOF
#define int16_t $ac_cv_c_int16_t
_ACEOF
;;
esac
{ $as_echo "$as_me:$LINENO: checking for uint16_t" >&5
$as_echo_n "checking for uint16_t... " >&6; }
if test "${ac_cv_c_uint16_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_c_uint16_t=no
for ac_type in 'uint16_t' 'unsigned int' 'unsigned long int' \
'unsigned long long int' 'unsigned short int' 'unsigned char'; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(($ac_type) -1 >> (16 - 1) == 1)];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
case $ac_type in
uint16_t) ac_cv_c_uint16_t=yes ;;
*) ac_cv_c_uint16_t=$ac_type ;;
esac
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_uint16_t" != no && break
done
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint16_t" >&5
$as_echo "$ac_cv_c_uint16_t" >&6; }
case $ac_cv_c_uint16_t in #(
no|yes) ;; #(
*)
cat >>confdefs.h <<_ACEOF
#define uint16_t $ac_cv_c_uint16_t
_ACEOF
;;
esac
if test "x$ac_cv_c_int16_t" = xyes; then
eval ECL_INT16_T="int16_t"
eval ECL_UINT16_T="uint16_t"
cat >>confdefs.h <<_ACEOF
#define ecl_int16_t int16_t
_ACEOF
cat >>confdefs.h <<_ACEOF
#define ecl_uint16_t uint16_t
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for int32_t" >&5
$as_echo_n "checking for int32_t... " >&6; }
if test "${ac_cv_c_int32_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_c_int32_t=no
for ac_type in 'int32_t' 'int' 'long int' \
'long long int' 'short int' 'signed char'; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1))];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1)
< ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
case $ac_type in
int32_t) ac_cv_c_int32_t=yes ;;
*) ac_cv_c_int32_t=$ac_type ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_int32_t" != no && break
done
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5
$as_echo "$ac_cv_c_int32_t" >&6; }
case $ac_cv_c_int32_t in #(
no|yes) ;; #(
*)
cat >>confdefs.h <<_ACEOF
#define int32_t $ac_cv_c_int32_t
_ACEOF
;;
esac
{ $as_echo "$as_me:$LINENO: checking for uint32_t" >&5
$as_echo_n "checking for uint32_t... " >&6; }
if test "${ac_cv_c_uint32_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_c_uint32_t=no
for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \
'unsigned long long int' 'unsigned short int' 'unsigned char'; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(($ac_type) -1 >> (32 - 1) == 1)];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
case $ac_type in
uint32_t) ac_cv_c_uint32_t=yes ;;
*) ac_cv_c_uint32_t=$ac_type ;;
esac
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_uint32_t" != no && break
done
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5
$as_echo "$ac_cv_c_uint32_t" >&6; }
case $ac_cv_c_uint32_t in #(
no|yes) ;; #(
*)
cat >>confdefs.h <<\_ACEOF
#define _UINT32_T 1
_ACEOF
cat >>confdefs.h <<_ACEOF
#define uint32_t $ac_cv_c_uint32_t
_ACEOF
;;
esac
if test "x$ac_cv_c_int32_t" = xyes; then
eval ECL_INT32_T="int32_t"
eval ECL_UINT32_T="uint32_t"
cat >>confdefs.h <<_ACEOF
#define ecl_int32_t int32_t
_ACEOF
cat >>confdefs.h <<_ACEOF
#define ecl_uint32_t uint32_t
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for int64_t" >&5
$as_echo_n "checking for int64_t... " >&6; }
if test "${ac_cv_c_int64_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_c_int64_t=no
for ac_type in 'int64_t' 'int' 'long int' \
'long long int' 'short int' 'signed char'; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1))];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1)
< ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
case $ac_type in
int64_t) ac_cv_c_int64_t=yes ;;
*) ac_cv_c_int64_t=$ac_type ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_int64_t" != no && break
done
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5
$as_echo "$ac_cv_c_int64_t" >&6; }
case $ac_cv_c_int64_t in #(
no|yes) ;; #(
*)
cat >>confdefs.h <<_ACEOF
#define int64_t $ac_cv_c_int64_t
_ACEOF
;;
esac
{ $as_echo "$as_me:$LINENO: checking for uint64_t" >&5
$as_echo_n "checking for uint64_t... " >&6; }
if test "${ac_cv_c_uint64_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_c_uint64_t=no
for ac_type in 'uint64_t' 'unsigned int' 'unsigned long int' \
'unsigned long long int' 'unsigned short int' 'unsigned char'; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(($ac_type) -1 >> (64 - 1) == 1)];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
case $ac_type in
uint64_t) ac_cv_c_uint64_t=yes ;;
*) ac_cv_c_uint64_t=$ac_type ;;
esac
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_uint64_t" != no && break
done
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5
$as_echo "$ac_cv_c_uint64_t" >&6; }
case $ac_cv_c_uint64_t in #(
no|yes) ;; #(
*)
cat >>confdefs.h <<\_ACEOF
#define _UINT64_T 1
_ACEOF
cat >>confdefs.h <<_ACEOF
#define uint64_t $ac_cv_c_uint64_t
_ACEOF
;;
esac
if test "x$ac_cv_c_int64_t" = xyes; then
eval ECL_INT64_T="int64_t"
eval ECL_UINT64_T="uint64_t"
cat >>confdefs.h <<_ACEOF
#define ecl_int64_t int64_t
_ACEOF
cat >>confdefs.h <<_ACEOF
#define ecl_uint64_t uint64_t
_ACEOF
fi
if test "${ECL_UINT16_T}${CL_FIXNUM_BITS}" = "16"; then
ECL_UINT16_T="cl_index"
ECL_INT16_T="cl_fixnum"
@ -9317,76 +9849,11 @@ if test "${ECL_UINT64_T}${CL_FIXNUM_BITS}" = "64"; then
ECL_UINT64_T="cl_index"
ECL_INT64_T="cl_fixnum"
fi
{ $as_echo "$as_me:$LINENO: checking uint8_t type" >&5
$as_echo_n "checking uint8_t type... " >&6; }
if test "x${ECL_UINT8_T}" = "x" -o "x${ECL_UINT8_T}" = xno; then
{ $as_echo "$as_me:$LINENO: result: none" >&5
$as_echo "none" >&6; }
{ { $as_echo "$as_me:$LINENO: error: Can not build ECL without byte types" >&5
$as_echo "$as_me: error: Can not build ECL without byte types" >&2;}
{ (exit 1); exit 1; }; }
else
cat >>confdefs.h <<_ACEOF
#define ecl_uint8_t $ECL_UINT8_T
_ACEOF
cat >>confdefs.h <<_ACEOF
#define ecl_int8_t $ECL_INT8_T
_ACEOF
{ $as_echo "$as_me:$LINENO: result: ${ECL_UINT8_T}" >&5
$as_echo "${ECL_UINT8_T}" >&6; }
fi
{ $as_echo "$as_me:$LINENO: checking uint16_t type" >&5
$as_echo_n "checking uint16_t type... " >&6; }
if test "x${ECL_UINT16_T}" = "x" -o "x${ECL_UINT16_T}" = xno; then
{ $as_echo "$as_me:$LINENO: result: none" >&5
$as_echo "none" >&6; }
else
cat >>confdefs.h <<_ACEOF
#define ecl_uint16_t $ECL_UINT16_T
_ACEOF
cat >>confdefs.h <<_ACEOF
#define ecl_int16_t $ECL_INT16_T
_ACEOF
{ $as_echo "$as_me:$LINENO: result: ${ECL_UINT16_T}" >&5
$as_echo "${ECL_UINT16_T}" >&6; }
fi
{ $as_echo "$as_me:$LINENO: checking uint32_t type" >&5
$as_echo_n "checking uint32_t type... " >&6; }
if test "x${ECL_UINT32_T}" = "x" -o "x${ECL_UINT32_T}" = xno; then
{ $as_echo "$as_me:$LINENO: result: none" >&5
$as_echo "none" >&6; }
else
cat >>confdefs.h <<_ACEOF
#define ecl_uint32_t $ECL_UINT32_T
_ACEOF
cat >>confdefs.h <<_ACEOF
#define ecl_int32_t $ECL_INT32_T
_ACEOF
{ $as_echo "$as_me:$LINENO: result: ${ECL_UINT32_T}" >&5
$as_echo "${ECL_UINT32_T}" >&6; }
fi
{ $as_echo "$as_me:$LINENO: checking uint64_t type" >&5
$as_echo_n "checking uint64_t type... " >&6; }
if test "x${ECL_UINT64_T}" = "x" -o "x${ECL_UINT64_T}" = xno; then
{ $as_echo "$as_me:$LINENO: result: none" >&5
$as_echo "none" >&6; }
else
cat >>confdefs.h <<_ACEOF
#define ecl_uint64_t $ECL_UINT64_T
_ACEOF
cat >>confdefs.h <<_ACEOF
#define ecl_int64_t $ECL_INT64_T
_ACEOF
{ $as_echo "$as_me:$LINENO: result: ${ECL_UINT64_T}" >&5
$as_echo "${ECL_UINT64_T}" >&6; }
fi