andre@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: /* andre@0: ** File: prtypes.h andre@0: ** Description: Definitions of NSPR's basic types andre@0: ** andre@0: ** Prototypes and macros used to make up for deficiencies that we have found andre@0: ** in ANSI environments. andre@0: ** andre@0: ** Since we do not wrap and all the other standard headers, authors andre@0: ** of portable code will not know in general that they need these definitions. andre@0: ** Instead of requiring these authors to find the dependent uses in their code andre@0: ** and take the following steps only in those C files, we take steps once here andre@0: ** for all C files. andre@0: **/ andre@0: andre@0: #ifndef prtypes_h___ andre@0: #define prtypes_h___ andre@0: andre@0: #ifdef MDCPUCFG andre@0: #include MDCPUCFG andre@0: #else andre@0: #include "prcpucfg.h" andre@0: #endif andre@0: andre@0: #include andre@0: andre@0: /*********************************************************************** andre@0: ** MACROS: PR_EXTERN andre@0: ** PR_IMPLEMENT andre@0: ** DESCRIPTION: andre@0: ** These are only for externally visible routines and globals. For andre@0: ** internal routines, just use "extern" for type checking and that andre@0: ** will not export internal cross-file or forward-declared symbols. andre@0: ** Define a macro for declaring procedures return types. We use this to andre@0: ** deal with windoze specific type hackery for DLL definitions. Use andre@0: ** PR_EXTERN when the prototype for the method is declared. Use andre@0: ** PR_IMPLEMENT for the implementation of the method. andre@0: ** andre@0: ** Example: andre@0: ** in dowhim.h andre@0: ** PR_EXTERN( void ) DoWhatIMean( void ); andre@0: ** in dowhim.c andre@0: ** PR_IMPLEMENT( void ) DoWhatIMean( void ) { return; } andre@0: ** andre@0: ** andre@0: ***********************************************************************/ andre@0: #if defined(NSPR_STATIC) andre@0: andre@0: #define PR_EXPORT(__type) extern __type andre@0: #define PR_EXPORT_DATA(__type) extern __type andre@0: #define PR_IMPORT(__type) extern __type andre@0: #define PR_IMPORT_DATA(__type) extern __type andre@0: andre@0: #define PR_EXTERN(__type) extern __type andre@0: #define PR_IMPLEMENT(__type) __type andre@0: #define PR_EXTERN_DATA(__type) extern __type andre@0: #define PR_IMPLEMENT_DATA(__type) __type andre@0: andre@0: #define PR_CALLBACK andre@0: #define PR_CALLBACK_DECL andre@0: #define PR_STATIC_CALLBACK(__x) static __x andre@0: andre@0: #elif defined(WIN32) andre@0: andre@0: #define PR_EXPORT(__type) extern __declspec(dllexport) __type andre@0: #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPORT(__type) __declspec(dllimport) __type andre@0: #define PR_IMPORT_DATA(__type) __declspec(dllimport) __type andre@0: andre@0: #define PR_EXTERN(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPLEMENT(__type) __declspec(dllexport) __type andre@0: #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type andre@0: andre@0: #define PR_CALLBACK andre@0: #define PR_CALLBACK_DECL andre@0: #define PR_STATIC_CALLBACK(__x) static __x andre@0: andre@0: #elif defined(XP_BEOS) andre@0: andre@0: #define PR_EXPORT(__type) extern __declspec(dllexport) __type andre@0: #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPORT(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type andre@0: andre@0: #define PR_EXTERN(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPLEMENT(__type) __declspec(dllexport) __type andre@0: #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type andre@0: andre@0: #define PR_CALLBACK andre@0: #define PR_CALLBACK_DECL andre@0: #define PR_STATIC_CALLBACK(__x) static __x andre@0: andre@0: #elif defined(XP_OS2) && defined(__declspec) andre@0: andre@0: #define PR_EXPORT(__type) extern __declspec(dllexport) __type andre@0: #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPORT(__type) extern __declspec(dllimport) __type andre@0: #define PR_IMPORT_DATA(__type) extern __declspec(dllimport) __type andre@0: andre@0: #define PR_EXTERN(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPLEMENT(__type) __declspec(dllexport) __type andre@0: #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type andre@0: andre@0: #define PR_CALLBACK andre@0: #define PR_CALLBACK_DECL andre@0: #define PR_STATIC_CALLBACK(__x) static __x andre@0: andre@0: #elif defined(SYMBIAN) andre@0: andre@0: #define PR_EXPORT(__type) extern __declspec(dllexport) __type andre@0: #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type andre@0: #ifdef __WINS__ andre@0: #define PR_IMPORT(__type) extern __declspec(dllexport) __type andre@0: #define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type andre@0: #else andre@0: #define PR_IMPORT(__type) extern __declspec(dllimport) __type andre@0: #define PR_IMPORT_DATA(__type) extern __declspec(dllimport) __type andre@0: #endif andre@0: andre@0: #define PR_EXTERN(__type) extern __type andre@0: #define PR_IMPLEMENT(__type) __type andre@0: #define PR_EXTERN_DATA(__type) extern __type andre@0: #define PR_IMPLEMENT_DATA(__type) __type andre@0: andre@0: #define PR_CALLBACK andre@0: #define PR_CALLBACK_DECL andre@0: #define PR_STATIC_CALLBACK(__x) static __x andre@0: andre@0: #else /* Unix */ andre@0: andre@0: /* GCC 3.3 and later support the visibility attribute. */ andre@0: #if (__GNUC__ >= 4) || \ andre@0: (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) andre@0: #define PR_VISIBILITY_DEFAULT __attribute__((visibility("default"))) andre@0: #else andre@0: #define PR_VISIBILITY_DEFAULT andre@0: #endif andre@0: andre@0: #define PR_EXPORT(__type) extern PR_VISIBILITY_DEFAULT __type andre@0: #define PR_EXPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type andre@0: #define PR_IMPORT(__type) extern PR_VISIBILITY_DEFAULT __type andre@0: #define PR_IMPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type andre@0: andre@0: #define PR_EXTERN(__type) extern PR_VISIBILITY_DEFAULT __type andre@0: #define PR_IMPLEMENT(__type) PR_VISIBILITY_DEFAULT __type andre@0: #define PR_EXTERN_DATA(__type) extern PR_VISIBILITY_DEFAULT __type andre@0: #define PR_IMPLEMENT_DATA(__type) PR_VISIBILITY_DEFAULT __type andre@0: #define PR_CALLBACK andre@0: #define PR_CALLBACK_DECL andre@0: #define PR_STATIC_CALLBACK(__x) static __x andre@0: andre@0: #endif andre@0: andre@0: #if defined(_NSPR_BUILD_) andre@0: #define NSPR_API(__type) PR_EXPORT(__type) andre@0: #define NSPR_DATA_API(__type) PR_EXPORT_DATA(__type) andre@0: #else andre@0: #define NSPR_API(__type) PR_IMPORT(__type) andre@0: #define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type) andre@0: #endif andre@0: andre@0: /*********************************************************************** andre@0: ** MACROS: PR_BEGIN_MACRO andre@0: ** PR_END_MACRO andre@0: ** DESCRIPTION: andre@0: ** Macro body brackets so that macros with compound statement definitions andre@0: ** behave syntactically more like functions when called. andre@0: ***********************************************************************/ andre@0: #define PR_BEGIN_MACRO do { andre@0: #define PR_END_MACRO } while (0) andre@0: andre@0: /*********************************************************************** andre@0: ** MACROS: PR_BEGIN_EXTERN_C andre@0: ** PR_END_EXTERN_C andre@0: ** DESCRIPTION: andre@0: ** Macro shorthands for conditional C++ extern block delimiters. andre@0: ***********************************************************************/ andre@0: #ifdef __cplusplus andre@0: #define PR_BEGIN_EXTERN_C extern "C" { andre@0: #define PR_END_EXTERN_C } andre@0: #else andre@0: #define PR_BEGIN_EXTERN_C andre@0: #define PR_END_EXTERN_C andre@0: #endif andre@0: andre@0: /*********************************************************************** andre@0: ** MACROS: PR_BIT andre@0: ** PR_BITMASK andre@0: ** DESCRIPTION: andre@0: ** Bit masking macros. XXX n must be <= 31 to be portable andre@0: ***********************************************************************/ andre@0: #define PR_BIT(n) ((PRUint32)1 << (n)) andre@0: #define PR_BITMASK(n) (PR_BIT(n) - 1) andre@0: andre@0: /*********************************************************************** andre@0: ** MACROS: PR_ROUNDUP andre@0: ** PR_MIN andre@0: ** PR_MAX andre@0: ** PR_ABS andre@0: ** DESCRIPTION: andre@0: ** Commonly used macros for operations on compatible types. andre@0: ***********************************************************************/ andre@0: #define PR_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y)) andre@0: #define PR_MIN(x,y) ((x)<(y)?(x):(y)) andre@0: #define PR_MAX(x,y) ((x)>(y)?(x):(y)) andre@0: #define PR_ABS(x) ((x)<0?-(x):(x)) andre@0: andre@0: /*********************************************************************** andre@0: ** MACROS: PR_ARRAY_SIZE andre@0: ** DESCRIPTION: andre@0: ** The number of elements in an array. andre@0: ***********************************************************************/ andre@0: #define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) andre@0: andre@0: PR_BEGIN_EXTERN_C andre@0: andre@0: /* andre@0: ** Starting in NSPR 4.9.5, NSPR's exact-width integer types should match andre@0: ** the exact-width integer types defined in . This allows sloppy andre@0: ** code to use PRInt{N} and int{N}_t interchangeably. andre@0: ** andre@0: ** The 8-bit and 16-bit integer types can only be defined using char and andre@0: ** short. All platforms define the 32-bit integer types using int. So only andre@0: ** the 64-bit integer types could be defined differently. andre@0: ** andre@0: ** NSPR's original strategy was to use the "shortest" 64-bit integer type: andre@0: ** if long is 64-bit, then prefer it over long long. This strategy is also andre@0: ** used by Linux/glibc, FreeBSD, and NetBSD. andre@0: ** andre@0: ** Other platforms use a different strategy: simply define the 64-bit andre@0: ** integer types using long long. We define the PR_ALTERNATE_INT64_TYPEDEF andre@0: ** macro on these platforms. Note that PR_ALTERNATE_INT64_TYPEDEF is for andre@0: ** internal use by NSPR headers only. Do not define or test this macro in andre@0: ** your code. andre@0: ** andre@0: ** NOTE: NSPR can't use because C99 requires C++ code to define andre@0: ** __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS to make all the macros andre@0: ** defined in available. This strange requirement is gone in andre@0: ** C11. When most platforms ignore this C99 requirement, NSPR will be able andre@0: ** to use . A patch to do that is in NSPR bug 634793. andre@0: */ andre@0: andre@0: #if defined(__APPLE__) || defined(__ANDROID__) || defined(__OpenBSD__) andre@0: #define PR_ALTERNATE_INT64_TYPEDEF andre@0: #endif andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRUint8 andre@0: ** PRInt8 andre@0: ** DESCRIPTION: andre@0: ** The int8 types are known to be 8 bits each. There is no type that andre@0: ** is equivalent to a plain "char". andre@0: ************************************************************************/ andre@0: #if PR_BYTES_PER_BYTE == 1 andre@0: typedef unsigned char PRUint8; andre@0: /* andre@0: ** Some cfront-based C++ compilers do not like 'signed char' and andre@0: ** issue the warning message: andre@0: ** warning: "signed" not implemented (ignored) andre@0: ** For these compilers, we have to define PRInt8 as plain 'char'. andre@0: ** Make sure that plain 'char' is indeed signed under these compilers. andre@0: */ andre@0: #if (defined(HPUX) && defined(__cplusplus) \ andre@0: && !defined(__GNUC__) && __cplusplus < 199707L) \ andre@0: || (defined(SCO) && defined(__cplusplus) \ andre@0: && !defined(__GNUC__) && __cplusplus == 1L) andre@0: typedef char PRInt8; andre@0: #else andre@0: typedef signed char PRInt8; andre@0: #endif andre@0: #else andre@0: #error No suitable type for PRInt8/PRUint8 andre@0: #endif andre@0: andre@0: /************************************************************************ andre@0: * MACROS: PR_INT8_MAX andre@0: * PR_INT8_MIN andre@0: * PR_UINT8_MAX andre@0: * DESCRIPTION: andre@0: * The maximum and minimum values of a PRInt8 or PRUint8. andre@0: ************************************************************************/ andre@0: andre@0: #define PR_INT8_MAX 127 andre@0: #define PR_INT8_MIN (-128) andre@0: #define PR_UINT8_MAX 255U andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRUint16 andre@0: ** PRInt16 andre@0: ** DESCRIPTION: andre@0: ** The int16 types are known to be 16 bits each. andre@0: ************************************************************************/ andre@0: #if PR_BYTES_PER_SHORT == 2 andre@0: typedef unsigned short PRUint16; andre@0: typedef short PRInt16; andre@0: #else andre@0: #error No suitable type for PRInt16/PRUint16 andre@0: #endif andre@0: andre@0: /************************************************************************ andre@0: * MACROS: PR_INT16_MAX andre@0: * PR_INT16_MIN andre@0: * PR_UINT16_MAX andre@0: * DESCRIPTION: andre@0: * The maximum and minimum values of a PRInt16 or PRUint16. andre@0: ************************************************************************/ andre@0: andre@0: #define PR_INT16_MAX 32767 andre@0: #define PR_INT16_MIN (-32768) andre@0: #define PR_UINT16_MAX 65535U andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRUint32 andre@0: ** PRInt32 andre@0: ** DESCRIPTION: andre@0: ** The int32 types are known to be 32 bits each. andre@0: ************************************************************************/ andre@0: #if PR_BYTES_PER_INT == 4 andre@0: typedef unsigned int PRUint32; andre@0: typedef int PRInt32; andre@0: #define PR_INT32(x) x andre@0: #define PR_UINT32(x) x ## U andre@0: #elif PR_BYTES_PER_LONG == 4 andre@0: typedef unsigned long PRUint32; andre@0: typedef long PRInt32; andre@0: #define PR_INT32(x) x ## L andre@0: #define PR_UINT32(x) x ## UL andre@0: #else andre@0: #error No suitable type for PRInt32/PRUint32 andre@0: #endif andre@0: andre@0: /************************************************************************ andre@0: * MACROS: PR_INT32_MAX andre@0: * PR_INT32_MIN andre@0: * PR_UINT32_MAX andre@0: * DESCRIPTION: andre@0: * The maximum and minimum values of a PRInt32 or PRUint32. andre@0: ************************************************************************/ andre@0: andre@0: #define PR_INT32_MAX PR_INT32(2147483647) andre@0: #define PR_INT32_MIN (-PR_INT32_MAX - 1) andre@0: #define PR_UINT32_MAX PR_UINT32(4294967295) andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRUint64 andre@0: ** PRInt64 andre@0: ** DESCRIPTION: andre@0: ** The int64 types are known to be 64 bits each. Care must be used when andre@0: ** declaring variables of type PRUint64 or PRInt64. Different hardware andre@0: ** architectures and even different compilers have varying support for andre@0: ** 64 bit values. The only guaranteed portability requires the use of andre@0: ** the LL_ macros (see prlong.h). andre@0: ** andre@0: ** MACROS: PR_INT64 andre@0: ** PR_UINT64 andre@0: ** DESCRIPTION: andre@0: ** The PR_INT64 and PR_UINT64 macros provide a portable way for andre@0: ** specifying 64-bit integer constants. They can only be used if andre@0: ** PRInt64 and PRUint64 are defined as compiler-supported 64-bit andre@0: ** integer types (i.e., if HAVE_LONG_LONG is defined, which is true andre@0: ** for all the supported compilers topday). If PRInt64 and PRUint64 andre@0: ** are defined as structs, the LL_INIT macro defined in prlong.h has andre@0: ** to be used. andre@0: ** andre@0: ** MACROS: PR_INT64_MAX andre@0: ** PR_INT64_MIN andre@0: ** PR_UINT64_MAX andre@0: ** DESCRIPTION: andre@0: ** The maximum and minimum values of a PRInt64 or PRUint64. andre@0: ************************************************************************/ andre@0: #ifdef HAVE_LONG_LONG andre@0: /* Keep this in sync with prlong.h. */ andre@0: #if PR_BYTES_PER_LONG == 8 && !defined(PR_ALTERNATE_INT64_TYPEDEF) andre@0: typedef long PRInt64; andre@0: typedef unsigned long PRUint64; andre@0: #define PR_INT64(x) x ## L andre@0: #define PR_UINT64(x) x ## UL andre@0: #elif defined(WIN32) && !defined(__GNUC__) andre@0: typedef __int64 PRInt64; andre@0: typedef unsigned __int64 PRUint64; andre@0: #define PR_INT64(x) x ## i64 andre@0: #define PR_UINT64(x) x ## ui64 andre@0: #else andre@0: typedef long long PRInt64; andre@0: typedef unsigned long long PRUint64; andre@0: #define PR_INT64(x) x ## LL andre@0: #define PR_UINT64(x) x ## ULL andre@0: #endif /* PR_BYTES_PER_LONG == 8 */ andre@0: andre@0: #define PR_INT64_MAX PR_INT64(0x7fffffffffffffff) andre@0: #define PR_INT64_MIN (-PR_INT64_MAX - 1) andre@0: #define PR_UINT64_MAX PR_UINT64(-1) andre@0: #else /* !HAVE_LONG_LONG */ andre@0: typedef struct { andre@0: #ifdef IS_LITTLE_ENDIAN andre@0: PRUint32 lo, hi; andre@0: #else andre@0: PRUint32 hi, lo; andre@0: #endif andre@0: } PRInt64; andre@0: typedef PRInt64 PRUint64; andre@0: andre@0: #define PR_INT64_MAX (PRInt64){0x7fffffff, 0xffffffff} andre@0: #define PR_INT64_MIN (PRInt64){0xffffffff, 0xffffffff} andre@0: #define PR_UINT64_MAX (PRUint64){0xffffffff, 0xffffffff} andre@0: andre@0: #endif /* !HAVE_LONG_LONG */ andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRUintn andre@0: ** PRIntn andre@0: ** DESCRIPTION: andre@0: ** The PRIntn types are most appropriate for automatic variables. They are andre@0: ** guaranteed to be at least 16 bits, though various architectures may andre@0: ** define them to be wider (e.g., 32 or even 64 bits). These types are andre@0: ** never valid for fields of a structure. andre@0: ************************************************************************/ andre@0: #if PR_BYTES_PER_INT >= 2 andre@0: typedef int PRIntn; andre@0: typedef unsigned int PRUintn; andre@0: #else andre@0: #error 'sizeof(int)' not sufficient for platform use andre@0: #endif andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRFloat64 andre@0: ** DESCRIPTION: andre@0: ** NSPR's floating point type is always 64 bits. andre@0: ************************************************************************/ andre@0: typedef double PRFloat64; andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRSize andre@0: ** DESCRIPTION: andre@0: ** A type for representing the size of objects. andre@0: ************************************************************************/ andre@0: typedef size_t PRSize; andre@0: andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PROffset32, PROffset64 andre@0: ** DESCRIPTION: andre@0: ** A type for representing byte offsets from some location. andre@0: ************************************************************************/ andre@0: typedef PRInt32 PROffset32; andre@0: typedef PRInt64 PROffset64; andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRPtrDiff andre@0: ** DESCRIPTION: andre@0: ** A type for pointer difference. Variables of this type are suitable andre@0: ** for storing a pointer or pointer subtraction. andre@0: ************************************************************************/ andre@0: typedef ptrdiff_t PRPtrdiff; andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRUptrdiff andre@0: ** DESCRIPTION: andre@0: ** A type for pointer difference. Variables of this type are suitable andre@0: ** for storing a pointer or pointer sutraction. andre@0: ************************************************************************/ andre@0: #ifdef _WIN64 andre@0: typedef PRUint64 PRUptrdiff; andre@0: #else andre@0: typedef unsigned long PRUptrdiff; andre@0: #endif andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRBool andre@0: ** DESCRIPTION: andre@0: ** Use PRBool for variables and parameter types. Use PR_FALSE and PR_TRUE andre@0: ** for clarity of target type in assignments and actual arguments. Use andre@0: ** 'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans andre@0: ** just as you would C int-valued conditions. andre@0: ************************************************************************/ andre@0: typedef PRIntn PRBool; andre@0: #define PR_TRUE 1 andre@0: #define PR_FALSE 0 andre@0: andre@0: /************************************************************************ andre@0: ** TYPES: PRPackedBool andre@0: ** DESCRIPTION: andre@0: ** Use PRPackedBool within structs where bitfields are not desirable andre@0: ** but minimum and consistant overhead matters. andre@0: ************************************************************************/ andre@0: typedef PRUint8 PRPackedBool; andre@0: andre@0: /* andre@0: ** Status code used by some routines that have a single point of failure or andre@0: ** special status return. andre@0: */ andre@0: typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus; andre@0: andre@0: #ifndef __PRUNICHAR__ andre@0: #define __PRUNICHAR__ andre@0: #ifdef WIN32 andre@0: typedef wchar_t PRUnichar; andre@0: #else andre@0: typedef PRUint16 PRUnichar; andre@0: #endif andre@0: #endif andre@0: andre@0: /* andre@0: ** WARNING: The undocumented data types PRWord and PRUword are andre@0: ** only used in the garbage collection and arena code. Do not andre@0: ** use PRWord and PRUword in new code. andre@0: ** andre@0: ** A PRWord is an integer that is the same size as a void*. andre@0: ** It implements the notion of a "word" in the Java Virtual andre@0: ** Machine. (See Sec. 3.4 "Words", The Java Virtual Machine andre@0: ** Specification, Addison-Wesley, September 1996. andre@0: ** http://java.sun.com/docs/books/vmspec/index.html.) andre@0: */ andre@0: #ifdef _WIN64 andre@0: typedef PRInt64 PRWord; andre@0: typedef PRUint64 PRUword; andre@0: #else andre@0: typedef long PRWord; andre@0: typedef unsigned long PRUword; andre@0: #endif andre@0: andre@0: #if defined(NO_NSPR_10_SUPPORT) andre@0: #else andre@0: /********* ???????????????? FIX ME ??????????????????????????? *****/ andre@0: /********************** Some old definitions until pr=>ds transition is done ***/ andre@0: /********************** Also, we are still using NSPR 1.0. GC ******************/ andre@0: /* andre@0: ** Fundamental NSPR macros, used nearly everywhere. andre@0: */ andre@0: andre@0: #define PR_PUBLIC_API PR_IMPLEMENT andre@0: andre@0: /* andre@0: ** Macro body brackets so that macros with compound statement definitions andre@0: ** behave syntactically more like functions when called. andre@0: */ andre@0: #define NSPR_BEGIN_MACRO do { andre@0: #define NSPR_END_MACRO } while (0) andre@0: andre@0: /* andre@0: ** Macro shorthands for conditional C++ extern block delimiters. andre@0: */ andre@0: #ifdef NSPR_BEGIN_EXTERN_C andre@0: #undef NSPR_BEGIN_EXTERN_C andre@0: #endif andre@0: #ifdef NSPR_END_EXTERN_C andre@0: #undef NSPR_END_EXTERN_C andre@0: #endif andre@0: andre@0: #ifdef __cplusplus andre@0: #define NSPR_BEGIN_EXTERN_C extern "C" { andre@0: #define NSPR_END_EXTERN_C } andre@0: #else andre@0: #define NSPR_BEGIN_EXTERN_C andre@0: #define NSPR_END_EXTERN_C andre@0: #endif andre@0: andre@0: #include "obsolete/protypes.h" andre@0: andre@0: /********* ????????????? End Fix me ?????????????????????????????? *****/ andre@0: #endif /* NO_NSPR_10_SUPPORT */ andre@0: andre@0: /* andre@0: ** Compile-time assert. "condition" must be a constant expression. andre@0: ** The macro can be used only in places where an "extern" declaration is andre@0: ** allowed. andre@0: */ andre@0: #define PR_STATIC_ASSERT(condition) \ andre@0: extern void pr_static_assert(int arg[(condition) ? 1 : -1]) andre@0: andre@0: PR_END_EXTERN_C andre@0: andre@0: #endif /* prtypes_h___ */ andre@0: