FreeWRL

 view release on metacpan or  search on metacpan

JS/js/prtypes.h  view on Meta::CPAN

typedef struct PRCList      PRCList;
typedef struct PRHashEntry  PRHashEntry;
typedef struct PRHashTable  PRHashTable;
typedef struct PRTime       PRTime;

/************************************************************************/

#if defined(XP_PC)

#if defined(_WIN32)

#define PR_PUBLIC_API(__x)      _declspec(dllexport) __x
#define PR_IMPORT_API(__x)      _declspec(dllimport) __x
#define PR_PUBLIC_DATA(__x)     _declspec(dllexport) __x
#define PR_IMPORT_DATA(__x)     _declspec(dllimport) __x
#define PR_CALLBACK
#define PR_STATIC_CALLBACK(__x)	static __x
#define PR_EXTERN(__type) extern _declspec(dllexport) __type
#define PR_IMPLEMENT(__type) _declspec(dllexport) __type

#elif defined(__WATCOMC__) /* WIN386 */

#define PR_PUBLIC_API(__x)      __x
#define PR_IMPORT_API(__x)      __x
#define PR_PUBLIC_DATA(__x)     __x
#define PR_IMPORT_DATA(__x)     __x
#define PR_CALLBACK
#define PR_STATIC_CALLBACK(__x) static __x

#else  /* _WIN16 */

#define PR_PUBLIC_API(__x)      __x _cdecl _loadds _export
#define PR_IMPORT_API(__x)      PR_PUBLIC_API(__x)
#define PR_PUBLIC_DATA(__x)     __x
#define PR_IMPORT_DATA(__x)     __x

#if defined(_WINDLL)
#define PR_CALLBACK             _cdecl _loadds
#define PR_STATIC_CALLBACK(__x)	static __x PR_CALLBACK
#else
#define PR_CALLBACK             _cdecl __export
#define PR_STATIC_CALLBACK(__x)	__x PR_CALLBACK
#endif

#endif /* _WIN16 */

#else  /* Mac or Unix */

#define PR_PUBLIC_API(__x)      __x
#define PR_IMPORT_API(__x)      __x
#define PR_PUBLIC_DATA(__x)     __x
#define PR_IMPORT_DATA(__x)     __x
#define PR_CALLBACK
#define PR_STATIC_CALLBACK(__x)	static __x
#define PR_EXTERN(__type) extern __type
#endif /* Mac or Unix */

/************************************************************************/

/*
 * Macro body brackets so that macros with compound statement definitions
 * behave syntactically more like functions when called.
 */
#define PR_BEGIN_MACRO		do {
#define PR_END_MACRO		} while (0)

/*
 * Macro shorthands for conditional C++ extern block delimiters.
 */
#ifdef __cplusplus
#define PR_BEGIN_EXTERN_C	extern "C" {
#define PR_END_EXTERN_C		}
#else
#define PR_BEGIN_EXTERN_C
#define PR_END_EXTERN_C
#endif

/*
 * Bit masking macros.  XXX n must be <= 31 to be portable
 */
#define PR_BIT(n)	((pruword)1 << (n))
#define PR_BITMASK(n)	(PR_BIT(n) - 1)

/* Commonly used macros */
#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))

/*
 * Compute the log of the least power of 2 greater than or equal to n.
 */
extern PR_PUBLIC_API(int32)
PR_CeilingLog2(uint32 n);

/************************************************************************/

/*
 * Prototypes and macros used to make up for deficiencies in ANSI environments
 * that we have found.
 *
 * Since we do not wrap <stdlib.h> and all the other standard headers, authors
 * of portable code will not know in general that they need these definitions.
 * Instead of requiring these authors to find the dependent uses in their code
 * and take the following steps only in those C files, we take steps once here
 * for all C files.
 */
#ifdef SUNOS4
# include "sunos4.h"
#endif

#endif /* prtypes_h___ */



( run in 0.475 second using v1.01-cache-2.11-cpan-f56aa216473 )