Bug 489231: The definitions of LL_ constants such as LL_MAXUINT in prlong.h
authorwtc%google.com
Fri, 01 May 2009 00:59:01 +0000
changeset 4089 dc3f5e91fe80f3c236e2881a263ac39f13f7abae
parent 4086 bc74b79e0d342426b18da9880de4b4f513d414b8
child 4090 1f258c60b7342c9d3120cab137d1964da35fb5b1
push idunknown
push userunknown
push dateunknown
bugs489231
Bug 489231: The definitions of LL_ constants such as LL_MAXUINT in prlong.h need to be kept in sync with the definitions of the PRInt64/PRUint64 types in prtypes.h. The patch is contributed by Josh Aas <joshmoz@gmail.com>. r=wtc. Modified Files: prlong.h prtypes.h
pr/include/prlong.h
pr/include/prtypes.h
--- a/pr/include/prlong.h
+++ b/pr/include/prlong.h
@@ -61,17 +61,18 @@ PR_BEGIN_EXTERN_C
 ***********************************************************************/
 NSPR_API(PRInt64) LL_MaxInt(void);
 NSPR_API(PRInt64) LL_MinInt(void);
 NSPR_API(PRInt64) LL_Zero(void);
 NSPR_API(PRUint64) LL_MaxUint(void);
 
 #if defined(HAVE_LONG_LONG)
 
-#if PR_BYTES_PER_LONG == 8
+/* Keep this in sync with prtypes.h. */
+#if PR_BYTES_PER_LONG == 8 && !defined(__APPLE__)
 #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(__GNUC__)
 #define LL_MAXINT   9223372036854775807i64
 #define LL_MININT   (-LL_MAXINT - 1i64)
--- a/pr/include/prtypes.h
+++ b/pr/include/prtypes.h
@@ -349,16 +349,17 @@ typedef long PRInt32;
 ** DESCRIPTION:
 **  The int64 types are known to be 64 bits each. Care must be used when
 **      declaring variables of type PRUint64 or PRInt64. Different hardware
 **      architectures and even different compilers have varying support for
 **      64 bit values. The only guaranteed portability requires the use of
 **      the LL_ macros (see prlong.h).
 ************************************************************************/
 #ifdef HAVE_LONG_LONG
+/* Keep this in sync with prlong.h. */
 /*
  * On 64-bit Mac OS X, uint64 needs to be defined as unsigned long long to
  * match uint64_t, otherwise our uint64 typedef conflicts with the uint64
  * typedef in cssmconfig.h, which CoreServices.h includes indirectly.
  */
 #if PR_BYTES_PER_LONG == 8 && !defined(__APPLE__)
 typedef long PRInt64;
 typedef unsigned long PRUint64;