diff options
author | Darren Tucker <dtucker@dtucker.net> | 2020-05-01 18:32:25 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2020-05-01 18:41:40 +1000 |
commit | e9dc9863723e111ae05e353d69df857f0169544a (patch) | |
tree | 894ab9799e2dc72199c07ee73361cec9096fd146 /configure.ac | |
parent | aad87b88fc2536b1ea023213729aaf4eaabe1894 (diff) |
Use LONG_LONG_MAX and friends if available.
If we don't have LLONG_{MIN,MAX} but do have LONG_LONG_{MIN,MAX}
then use those instead. We do calculate these values in configure,
but it turns out that at least one compiler (old HP ANSI C) can't
parse "-9223372036854775808LL" without mangling it. (It can parse
"-9223372036854775807LL" which is presumably why its limits.h defines
LONG_LONG_MIN as the latter minus 1.)
Fixes rekey test when compiled with the aforementioned compiler.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index e696ac751..e89d4f17f 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -93,6 +93,7 @@ AC_SUBST([LD]) | |||
93 | AC_C_INLINE | 93 | AC_C_INLINE |
94 | 94 | ||
95 | AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>]) | 95 | AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>]) |
96 | AC_CHECK_DECL([LONG_LONG_MAX], [have_long_long_max=1], , [#include <limits.h>]) | ||
96 | AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [ | 97 | AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [ |
97 | #include <sys/types.h> | 98 | #include <sys/types.h> |
98 | #include <sys/param.h> | 99 | #include <sys/param.h> |
@@ -3611,7 +3612,7 @@ if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then | |||
3611 | fi | 3612 | fi |
3612 | 3613 | ||
3613 | # compute LLONG_MIN and LLONG_MAX if we don't know them. | 3614 | # compute LLONG_MIN and LLONG_MAX if we don't know them. |
3614 | if test -z "$have_llong_max"; then | 3615 | if test -z "$have_llong_max" && test -z "$have_long_long_max"; then |
3615 | AC_MSG_CHECKING([for max value of long long]) | 3616 | AC_MSG_CHECKING([for max value of long long]) |
3616 | AC_RUN_IFELSE( | 3617 | AC_RUN_IFELSE( |
3617 | [AC_LANG_PROGRAM([[ | 3618 | [AC_LANG_PROGRAM([[ |