|
|
@@ -21,47 +21,56 @@
|
|
|
// the various numeric types for unsigned and signed numbers of
|
|
|
// various widths.
|
|
|
|
|
|
-#if defined(_LP64)
|
|
|
-// A 64-bit environment.
|
|
|
+#ifdef WIN32_VC
|
|
|
+typedef signed __int8 PN_int8;
|
|
|
+typedef signed __int16 PN_int16;
|
|
|
+typedef signed __int32 PN_int32;
|
|
|
+typedef signed __int64 PN_int64;
|
|
|
+
|
|
|
+typedef unsigned __int8 PN_uint8;
|
|
|
+typedef unsigned __int16 PN_uint16;
|
|
|
+typedef unsigned __int32 PN_uint32;
|
|
|
+typedef unsigned __int64 PN_uint64;
|
|
|
|
|
|
-typedef signed char PN_int8;
|
|
|
-typedef short PN_int16;
|
|
|
-typedef int PN_int32;
|
|
|
+#elif defined(PHAVE_STDINT_H)
|
|
|
|
|
|
-typedef unsigned char PN_uint8;
|
|
|
-typedef unsigned short PN_uint16;
|
|
|
-typedef unsigned int PN_uint32;
|
|
|
-typedef long PN_int64;
|
|
|
-typedef unsigned long PN_uint64;
|
|
|
+#include <stdint.h>
|
|
|
|
|
|
-typedef double PN_float64;
|
|
|
-typedef float PN_float32;
|
|
|
+typedef int8_t PN_int8;
|
|
|
+typedef int16_t PN_int16;
|
|
|
+typedef int32_t PN_int32;
|
|
|
+typedef int64_t PN_int64;
|
|
|
|
|
|
-#else // _LP64
|
|
|
-// A 32-bit environment.
|
|
|
+typedef uint8_t PN_uint8;
|
|
|
+typedef uint16_t PN_uint16;
|
|
|
+typedef uint32_t PN_uint32;
|
|
|
+typedef uint64_t PN_uint64;
|
|
|
+
|
|
|
+#else
|
|
|
|
|
|
+// This is risky, but we have no other choice.
|
|
|
typedef signed char PN_int8;
|
|
|
-typedef short PN_int16;
|
|
|
+typedef short int PN_int16;
|
|
|
typedef int PN_int32;
|
|
|
+#if NATIVE_WORDSIZE == 64
|
|
|
+typedef long int PN_int64;
|
|
|
+#else
|
|
|
+typedef long long int PN_int64;
|
|
|
+#endif
|
|
|
|
|
|
typedef unsigned char PN_uint8;
|
|
|
-typedef unsigned short PN_uint16;
|
|
|
+typedef unsigned short int PN_uint16;
|
|
|
typedef unsigned int PN_uint32;
|
|
|
-
|
|
|
-#ifdef WIN32_VC
|
|
|
-typedef __int64 PN_int64;
|
|
|
-typedef unsigned __int64 PN_uint64;
|
|
|
+#if NATIVE_WORDSIZE == 64
|
|
|
+typedef unsigned long int PN_uint64;
|
|
|
#else
|
|
|
-typedef long long PN_int64;
|
|
|
-typedef unsigned long long PN_uint64;
|
|
|
+typedef unsigned long long int PN_uint64;
|
|
|
+#endif
|
|
|
+
|
|
|
#endif
|
|
|
|
|
|
typedef double PN_float64;
|
|
|
typedef float PN_float32;
|
|
|
|
|
|
-#endif // _LP64
|
|
|
#endif
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|