00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _ptypes_h_
00021 #define _ptypes_h_
00022
00023 #include <pclasses/config.h>
00024 #include <sys/types.h>
00025 #include <stddef.h>
00026
00027 #ifdef WIN32
00028 typedef int ssize_t;
00029 #endif
00030
00031 namespace P {
00032
00033 typedef char int8_t;
00034 typedef unsigned char uint8_t;
00035
00036 #if SIZEOF_SHORT == 2
00037 typedef short int16_t;
00038 typedef unsigned short uint16_t;
00039 #elif SIZEOF_INT == 2
00040 typedef int int16_t;
00041 typedef unsigned int uint16_t;
00042 #elif SIZEOF_LONG_INT == 2
00043 typedef long int int16_t;
00044 typedef unsigned long int uint16_t;
00045 #endif
00046
00047 #if SIZEOF_SHORT == 4
00048 typedef short int32_t;
00049 typedef unsigned short uint32_t;
00050 #elif SIZEOF_INT == 4
00051 typedef int int32_t;
00052 typedef unsigned int uint32_t;
00053 #elif SIZEOF_LONG_INT == 4
00054 typedef long int int32_t;
00055 typedef unsigned long int uint32_t;
00056 #endif
00057
00058 #if SIZEOF_SHORT == 8
00059 typedef short int64_t;
00060 typedef unsigned short uint64_t;
00061 #define HAVE_64BIT_INT 1
00062 #elif SIZEOF_INT == 8
00063 typedef int int64_t;
00064 typedef unsigned int uint64_t;
00065 #define HAVE_64BIT_INT 1
00066 #elif SIZEOF_LONG_INT == 8
00067 typedef long int int64_t;
00068 typedef unsigned long int uint64_t;
00069 #define HAVE_64BIT_INT 1
00070 #elif defined(HAVE___INT64)
00071 typedef __int64 int64_t;
00072 typedef unsigned __int64 uint64_t;
00073 #define HAVE_64BIT_INT 1
00074 #elif defined(HAVE_LONGLONG) && SIZEOF_LONG_LONG == 8
00075 typedef long long int64_t;
00076 typedef unsigned long long uint64_t;
00077 #define HAVE_64BIT_INT 1
00078 #endif
00079
00080 using ::size_t;
00081 using ::ssize_t;
00082 using ::off_t;
00083
00084 #ifdef HAVE_LARGEFILE64
00085 typedef uint64_t off64_t;
00086 #endif
00087
00088 #ifdef _MSC_VER
00089 #define P_64BIT_CONSTANT(x) x##i64
00090 #define P_U64BIT_CONSTANT(x) x##ui64
00091 #else
00092 #define P_64BIT_CONSTANT(x) x##ll
00093 #define P_U64BIT_CONSTANT(x) x##ull
00094 #endif
00095
00096 }
00097
00098 #endif