summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtchang%redhat.com <devnull@localhost>2005-01-12 02:46:40 +0000
committerwtchang%redhat.com <devnull@localhost>2005-01-12 02:46:40 +0000
commit169c27e2e80eaddfd4f3b4e439dc92b5d3af5b84 (patch)
tree09c5c6630633765fe26452c8b7aba5492f3d39da
parent5416f9bd9eca079ab5185c641cf075c02de1b1d3 (diff)
downloadnspr-hg-169c27e2e80eaddfd4f3b4e439dc92b5d3af5b84.tar.gz
Bugzilla Bug 277704: define the LL_MAXINT, LL_MININT, ... macros as
constants rather than functions on platforms that have a 64-bit integer type. The patch is contributed by Christian Biesinger <cbiesinger@gmx.at>. r=wtc. \ Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r--pr/include/prlong.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/pr/include/prlong.h b/pr/include/prlong.h
index f0e81506..09b43217 100644
--- a/pr/include/prlong.h
+++ b/pr/include/prlong.h
@@ -75,18 +75,25 @@ NSPR_API(PRInt64) LL_Zero(void);
NSPR_API(PRUint64) LL_MaxUint(void);
#endif
-#define LL_MAXINT LL_MaxInt()
-#define LL_MININT LL_MinInt()
-#define LL_ZERO LL_Zero()
-#define LL_MAXUINT LL_MaxUint()
-
#if defined(HAVE_LONG_LONG)
#if PR_BYTES_PER_LONG == 8
+#define LL_MAXINT 9223372036854775807L
+#define LL_MININT (-LL_MAXINT - 1L)
+#define LL_ZERO 0L
+#define LL_MAXUINT 18446744073709551615UL
#define LL_INIT(hi, lo) ((hi ## L << 32) + lo ## L)
#elif (defined(WIN32) || defined(WIN16)) && !defined(__GNUC__)
+#define LL_MAXINT 9223372036854775807i64
+#define LL_MININT (-LL_MAXINT - 1i64)
+#define LL_ZERO 0i64
+#define LL_MAXUINT 18446744073709551615ui64
#define LL_INIT(hi, lo) ((hi ## i64 << 32) + lo ## i64)
#else
+#define LL_MAXINT 9223372036854775807LL
+#define LL_MININT (-LL_MAXINT - 1LL)
+#define LL_ZERO 0LL
+#define LL_MAXUINT 18446744073709551615ULL
#define LL_INIT(hi, lo) ((hi ## LL << 32) + lo ## LL)
#endif
@@ -201,6 +208,11 @@ NSPR_API(PRUint64) LL_MaxUint(void);
#else /* !HAVE_LONG_LONG */
+#define LL_MAXINT LL_MaxInt()
+#define LL_MININT LL_MinInt()
+#define LL_ZERO LL_Zero()
+#define LL_MAXUINT LL_MaxUint()
+
#ifdef IS_LITTLE_ENDIAN
#define LL_INIT(hi, lo) {PR_UINT32(lo), PR_UINT32(hi)}
#else