Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2715)

Unified Diff: base/third_party/nspr/prtypes.h

Issue 6722011: Sync prtypes.h (NSPR in base) with upstream file revision 3.43 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/third_party/nspr/prtypes.h
===================================================================
--- base/third_party/nspr/prtypes.h (revision 78986)
+++ base/third_party/nspr/prtypes.h (working copy)
@@ -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 @@
** 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 @@
** 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 @@
** 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 @@
** 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 @@
** 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 @@
/************************************************************************
** 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 @@
/************************************************************************
** 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 @@
** 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 @@
** 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 @@
** 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 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 @@
** 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 @@
/********* ????????????? 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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698