diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-24 04:32:52 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-24 04:32:52 +0000 |
commit | 944acb3c4374e07d1bda2e8b0268a34e7764475c (patch) | |
tree | e2bf59b6f4cf455a379924bdec1ae10dd949cff3 /base/third_party | |
parent | 96a221c5858c2c7a5a7306cc2b29987b339f90ca (diff) | |
download | chromium_src-944acb3c4374e07d1bda2e8b0268a34e7764475c.zip chromium_src-944acb3c4374e07d1bda2e8b0268a34e7764475c.tar.gz chromium_src-944acb3c4374e07d1bda2e8b0268a34e7764475c.tar.bz2 |
Sync prtypes.h (NSPR in base) with upstream file revision 3.43.
http://bonsai.mozilla.org/cvslog.cgi?file=mozilla/nsprpub/pr/include/prtypes.h&rev=HEAD&mark=3.43
This picks up a 64-bit Mac OS X fix from upstream bug 478687.
https://bugzilla.mozilla.org/show_bug.cgi?id=478687
BUG=44127, 18323
TEST=64-bit base should all (mostly) build
Review URL: http://codereview.chromium.org/6722011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79251 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/third_party')
-rw-r--r-- | base/third_party/nspr/prtypes.h | 118 |
1 files changed, 43 insertions, 75 deletions
diff --git a/base/third_party/nspr/prtypes.h b/base/third_party/nspr/prtypes.h index 3453144..630df81 100644 --- a/base/third_party/nspr/prtypes.h +++ b/base/third_party/nspr/prtypes.h @@ -135,55 +135,6 @@ #define PR_CALLBACK_DECL #define PR_STATIC_CALLBACK(__x) static __x -#elif defined(WIN16) - -#define PR_CALLBACK_DECL __cdecl - -#if defined(_WINDLL) -#define PR_EXPORT(__type) extern __type _cdecl _export _loadds -#define PR_IMPORT(__type) extern __type _cdecl _export _loadds -#define PR_EXPORT_DATA(__type) extern __type _export -#define PR_IMPORT_DATA(__type) extern __type _export - -#define PR_EXTERN(__type) extern __type _cdecl _export _loadds -#define PR_IMPLEMENT(__type) __type _cdecl _export _loadds -#define PR_EXTERN_DATA(__type) extern __type _export -#define PR_IMPLEMENT_DATA(__type) __type _export - -#define PR_CALLBACK __cdecl __loadds -#define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK - -#else /* this must be .EXE */ -#define PR_EXPORT(__type) extern __type _cdecl _export -#define PR_IMPORT(__type) extern __type _cdecl _export -#define PR_EXPORT_DATA(__type) extern __type _export -#define PR_IMPORT_DATA(__type) extern __type _export - -#define PR_EXTERN(__type) extern __type _cdecl _export -#define PR_IMPLEMENT(__type) __type _cdecl _export -#define PR_EXTERN_DATA(__type) extern __type _export -#define PR_IMPLEMENT_DATA(__type) __type _export - -#define PR_CALLBACK __cdecl __loadds -#define PR_STATIC_CALLBACK(__x) __x PR_CALLBACK -#endif /* _WINDLL */ - -#elif defined(XP_MAC) - -#define PR_EXPORT(__type) extern __declspec(export) __type -#define PR_EXPORT_DATA(__type) extern __declspec(export) __type -#define PR_IMPORT(__type) extern __declspec(export) __type -#define PR_IMPORT_DATA(__type) extern __declspec(export) __type - -#define PR_EXTERN(__type) extern __declspec(export) __type -#define PR_IMPLEMENT(__type) __declspec(export) __type -#define PR_EXTERN_DATA(__type) extern __declspec(export) __type -#define PR_IMPLEMENT_DATA(__type) __declspec(export) __type - -#define PR_CALLBACK -#define PR_CALLBACK_DECL -#define PR_STATIC_CALLBACK(__x) static __x - #elif defined(XP_OS2) && defined(__declspec) #define PR_EXPORT(__type) extern __declspec(dllexport) __type @@ -200,20 +151,26 @@ #define PR_CALLBACK_DECL #define PR_STATIC_CALLBACK(__x) static __x -#elif defined(XP_OS2_VACPP) +#elif defined(SYMBIAN) -#define PR_EXPORT(__type) extern __type -#define PR_EXPORT_DATA(__type) extern __type -#define PR_IMPORT(__type) extern __type -#define PR_IMPORT_DATA(__type) extern __type +#define PR_EXPORT(__type) extern __declspec(dllexport) __type +#define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type +#ifdef __WINS__ +#define PR_IMPORT(__type) extern __declspec(dllexport) __type +#define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type +#else +#define PR_IMPORT(__type) extern __declspec(dllimport) __type +#define PR_IMPORT_DATA(__type) extern __declspec(dllimport) __type +#endif #define PR_EXTERN(__type) extern __type #define PR_IMPLEMENT(__type) __type #define PR_EXTERN_DATA(__type) extern __type #define PR_IMPLEMENT_DATA(__type) __type -#define PR_CALLBACK _Optlink + +#define PR_CALLBACK #define PR_CALLBACK_DECL -#define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK +#define PR_STATIC_CALLBACK(__x) static __x #else /* Unix */ @@ -301,7 +258,7 @@ PR_BEGIN_EXTERN_C ** PRInt8 ** DESCRIPTION: ** The int8 types are known to be 8 bits each. There is no type that -** is equivalent to a plain "char". +** is equivalent to a plain "char". ************************************************************************/ #if PR_BYTES_PER_BYTE == 1 typedef unsigned char PRUint8; @@ -340,7 +297,7 @@ typedef signed char PRInt8; ** TYPES: PRUint16 ** PRInt16 ** DESCRIPTION: -** The int16 types are known to be 16 bits each. +** The int16 types are known to be 16 bits each. ************************************************************************/ #if PR_BYTES_PER_SHORT == 2 typedef unsigned short PRUint16; @@ -365,7 +322,7 @@ typedef short PRInt16; ** TYPES: PRUint32 ** PRInt32 ** DESCRIPTION: -** The int32 types are known to be 32 bits each. +** The int32 types are known to be 32 bits each. ************************************************************************/ #if PR_BYTES_PER_INT == 4 typedef unsigned int PRUint32; @@ -404,12 +361,15 @@ typedef long PRInt32; ** the LL_ macros (see prlong.h). ************************************************************************/ #ifdef HAVE_LONG_LONG -#if PR_BYTES_PER_LONG == 8 +/* 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; -#elif defined(WIN16) -typedef __int64 PRInt64; -typedef unsigned __int64 PRUint64; #elif defined(WIN32) && !defined(__GNUC__) typedef __int64 PRInt64; typedef unsigned __int64 PRUint64; @@ -435,7 +395,7 @@ typedef PRInt64 PRUint64; ** The PRIntn types are most appropriate for automatic variables. They are ** guaranteed to be at least 16 bits, though various architectures may ** define them to be wider (e.g., 32 or even 64 bits). These types are -** never valid for fields of a structure. +** never valid for fields of a structure. ************************************************************************/ #if PR_BYTES_PER_INT >= 2 typedef int PRIntn; @@ -447,14 +407,14 @@ typedef unsigned int PRUintn; /************************************************************************ ** TYPES: PRFloat64 ** DESCRIPTION: -** NSPR's floating point type is always 64 bits. +** NSPR's floating point type is always 64 bits. ************************************************************************/ typedef double PRFloat64; /************************************************************************ ** TYPES: PRSize ** DESCRIPTION: -** A type for representing the size of objects. +** A type for representing the size of objects. ************************************************************************/ typedef size_t PRSize; @@ -462,7 +422,7 @@ typedef size_t PRSize; /************************************************************************ ** TYPES: PROffset32, PROffset64 ** DESCRIPTION: -** A type for representing byte offsets from some location. +** A type for representing byte offsets from some location. ************************************************************************/ typedef PRInt32 PROffset32; typedef PRInt64 PROffset64; @@ -471,7 +431,7 @@ typedef PRInt64 PROffset64; ** TYPES: PRPtrDiff ** DESCRIPTION: ** A type for pointer difference. Variables of this type are suitable -** for storing a pointer or pointer subtraction. +** for storing a pointer or pointer subtraction. ************************************************************************/ typedef ptrdiff_t PRPtrdiff; @@ -479,10 +439,10 @@ typedef ptrdiff_t PRPtrdiff; ** TYPES: PRUptrdiff ** DESCRIPTION: ** A type for pointer difference. Variables of this type are suitable -** for storing a pointer or pointer sutraction. +** for storing a pointer or pointer sutraction. ************************************************************************/ #ifdef _WIN64 -typedef unsigned __int64 PRUptrdiff; +typedef PRUint64 PRUptrdiff; #else typedef unsigned long PRUptrdiff; #endif @@ -493,7 +453,7 @@ typedef unsigned long PRUptrdiff; ** Use PRBool for variables and parameter types. Use PR_FALSE and PR_TRUE ** for clarity of target type in assignments and actual arguments. Use ** 'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans -** just as you would C int-valued conditions. +** just as you would C int-valued conditions. ************************************************************************/ typedef PRIntn PRBool; #define PR_TRUE 1 @@ -508,14 +468,14 @@ typedef PRIntn PRBool; typedef PRUint8 PRPackedBool; /* -** Status code used by some routines that have a single point of failure or +** Status code used by some routines that have a single point of failure or ** special status return. */ typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus; #ifndef __PRUNICHAR__ #define __PRUNICHAR__ -#if defined(WIN32) || defined(XP_MAC) +#ifdef WIN32 typedef wchar_t PRUnichar; #else typedef PRUint16 PRUnichar; @@ -534,8 +494,8 @@ typedef PRUint16 PRUnichar; ** http://java.sun.com/docs/books/vmspec/index.html.) */ #ifdef _WIN64 -typedef __int64 PRWord; -typedef unsigned __int64 PRUword; +typedef PRInt64 PRWord; +typedef PRUint64 PRUword; #else typedef long PRWord; typedef unsigned long PRUword; @@ -580,6 +540,14 @@ typedef unsigned long PRUword; /********* ????????????? End Fix me ?????????????????????????????? *****/ #endif /* NO_NSPR_10_SUPPORT */ +/* +** Compile-time assert. "condition" must be a constant expression. +** The macro can be used only in places where an "extern" declaration is +** allowed. +*/ +#define PR_STATIC_ASSERT(condition) \ + extern void pr_static_assert(int arg[(condition) ? 1 : -1]) + PR_END_EXTERN_C #if !defined(NO_NSPR_10_SUPPORT) |