summaryrefslogtreecommitdiff
path: root/defines.h
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2020-05-01 18:32:25 +1000
committerDarren Tucker <dtucker@dtucker.net>2020-05-01 18:41:40 +1000
commite9dc9863723e111ae05e353d69df857f0169544a (patch)
tree894ab9799e2dc72199c07ee73361cec9096fd146 /defines.h
parentaad87b88fc2536b1ea023213729aaf4eaabe1894 (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 'defines.h')
-rw-r--r--defines.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/defines.h b/defines.h
index a347a44ff..b8ea88b2d 100644
--- a/defines.h
+++ b/defines.h
@@ -254,6 +254,13 @@ typedef unsigned int u_int32_t;
254#define __BIT_TYPES_DEFINED__ 254#define __BIT_TYPES_DEFINED__
255#endif 255#endif
256 256
257#if !defined(LLONG_MIN) && defined(LONG_LONG_MIN)
258#define LLONG_MIN LONG_LONG_MIN
259#endif
260#if !defined(LLONG_MAX) && defined(LONG_LONG_MAX)
261#define LLONG_MAX LONG_LONG_MAX
262#endif
263
257#ifndef UINT32_MAX 264#ifndef UINT32_MAX
258# if defined(HAVE_DECL_UINT32_MAX) && (HAVE_DECL_UINT32_MAX == 0) 265# if defined(HAVE_DECL_UINT32_MAX) && (HAVE_DECL_UINT32_MAX == 0)
259# if (SIZEOF_INT == 4) 266# if (SIZEOF_INT == 4)