.
[gnulib.git] / m4 / ullong_max.m4
1 # ullong_max.m4 - define ULLONG_MAX if necessary
2
3 dnl Copyright (C) 2005 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 # Written by Paul Eggert.
9
10 AC_DEFUN([gl_ULLONG_MAX],
11 [
12   dnl Avoid _AC_COMPUTE_INT-related macros, as they may not work with
13   dnl types wider than long int, due to problems with expr.
14   AC_CACHE_CHECK([whether ULONG_MAX < ULLONG_MAX],
15     [gl_cv_ulong_max_lt_ullong_max],
16     [AC_COMPILE_IFELSE(
17       [AC_LANG_BOOL_COMPILE_TRY(
18          [AC_INCLUDES_DEFAULT],
19          [[(unsigned long int) -1 < (unsigned long long int) -1]])],
20       [gl_cv_ulong_max_lt_ullong_max=yes],
21       [gl_cv_ulong_max_lt_ullong_max=no])])
22   if test $gl_cv_ulong_max_lt_ullong_max = yes; then
23     AC_DEFINE([ULONG_MAX_LT_ULLONG_MAX], 1,
24       [Define if ULONG_MAX < ULLONG_MAX, even if your compiler does not
25        support ULLONG_MAX.])
26   fi
27 ])