1 |
# size_max.m4 serial 2 |
# size_max.m4 serial 3 |
2 |
dnl Copyright (C) 2003 Free Software Foundation, Inc. |
dnl Copyright (C) 2003, 2005 Free Software Foundation, Inc. |
3 |
dnl This file is free software; the Free Software Foundation |
dnl This file is free software; the Free Software Foundation |
4 |
dnl gives unlimited permission to copy and/or distribute it, |
dnl gives unlimited permission to copy and/or distribute it, |
5 |
dnl with or without modifications, as long as this notice is preserved. |
dnl with or without modifications, as long as this notice is preserved. |
26 |
dnl than the type 'unsigned long'. |
dnl than the type 'unsigned long'. |
27 |
dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', |
dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', |
28 |
dnl which is guaranteed to work from LONG_MIN to LONG_MAX. |
dnl which is guaranteed to work from LONG_MIN to LONG_MAX. |
29 |
_AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, |
_AC_COMPUTE_INT([(size_t)~(size_t)0 / 10], res_hi, |
30 |
[#include <stddef.h>], result=?) |
[#include <stddef.h>], result=?) |
31 |
_AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, |
_AC_COMPUTE_INT([(size_t)~(size_t)0 % 10], res_lo, |
32 |
[#include <stddef.h>], result=?) |
[#include <stddef.h>], result=?) |
33 |
_AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, |
_AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, |
34 |
[#include <stddef.h>], result=?) |
[#include <stddef.h>], result=?) |
48 |
fi |
fi |
49 |
else |
else |
50 |
dnl Shouldn't happen, but who knows... |
dnl Shouldn't happen, but who knows... |
51 |
result='~(size_t)0' |
result='((size_t)~(size_t)0)' |
52 |
fi |
fi |
53 |
fi |
fi |
54 |
AC_MSG_RESULT([$result]) |
AC_MSG_RESULT([$result]) |