diff options
Diffstat (limited to 'pr/include/prtypes.h')
-rw-r--r-- | pr/include/prtypes.h | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/pr/include/prtypes.h b/pr/include/prtypes.h index b01673d0..b6836108 100644 --- a/pr/include/prtypes.h +++ b/pr/include/prtypes.h @@ -239,13 +239,15 @@ /*********************************************************************** ** MACROS: PR_ROUNDUP ** PR_MIN -** PR_MAX +** PR_MAX +** PR_ABS ** DESCRIPTION: ** Commonly used macros for operations on compatible types. ***********************************************************************/ #define PR_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y)) #define PR_MIN(x,y) ((x)<(y)?(x):(y)) #define PR_MAX(x,y) ((x)>(y)?(x):(y)) +#define PR_ABS(x) ((x)<0?-(x):(x)) PR_BEGIN_EXTERN_C @@ -278,6 +280,18 @@ typedef signed char PRInt8; #endif /************************************************************************ + * MACROS: PR_INT8_MAX + * PR_INT8_MIN + * PR_UINT8_MAX + * DESCRIPTION: + * The maximum and minimum values of a PRInt8 or PRUint8. +************************************************************************/ + +#define PR_INT8_MAX 127 +#define PR_INT8_MIN (-128) +#define PR_UINT8_MAX 255U + +/************************************************************************ ** TYPES: PRUint16 ** PRInt16 ** DESCRIPTION: @@ -291,6 +305,18 @@ typedef short PRInt16; #endif /************************************************************************ + * MACROS: PR_INT16_MAX + * PR_INT16_MIN + * PR_UINT16_MAX + * DESCRIPTION: + * The maximum and minimum values of a PRInt16 or PRUint16. +************************************************************************/ + +#define PR_INT16_MAX 32767 +#define PR_INT16_MIN (-32768) +#define PR_UINT16_MAX 65535U + +/************************************************************************ ** TYPES: PRUint32 ** PRInt32 ** DESCRIPTION: @@ -311,6 +337,18 @@ typedef long PRInt32; #endif /************************************************************************ + * MACROS: PR_INT32_MAX + * PR_INT32_MIN + * PR_UINT32_MAX + * DESCRIPTION: + * The maximum and minimum values of a PRInt32 or PRUint32. +************************************************************************/ + +#define PR_INT32_MAX PR_INT32(2147483647) +#define PR_INT32_MIN (-PR_INT32_MAX - 1) +#define PR_UINT32_MAX PR_UINT32(4294967295) + +/************************************************************************ ** TYPES: PRUint64 ** PRInt64 ** DESCRIPTION: @@ -426,6 +464,20 @@ typedef PRUint8 PRPackedBool; */ typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus; +#ifdef MOZ_UNICODE +/* + * EXPERIMENTAL: This type may be removed in a future release. + */ +#ifndef __PRUNICHAR__ +#define __PRUNICHAR__ +#if defined(WIN32) || defined(XP_MAC) +typedef wchar_t PRUnichar; +#else +typedef PRUint16 PRUnichar; +#endif +#endif +#endif /* MOZ_UNICODE */ + /* ** WARNING: The undocumented data types PRWord and PRUword are ** only used in the garbage collection and arena code. Do not |