00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00039 #ifndef BLOCXX_TYPES_HPP_INCLUDE_GUARD_
00040 #define BLOCXX_TYPES_HPP_INCLUDE_GUARD_
00041 #include "blocxx/BLOCXX_config.h"
00042
00043 #ifdef BLOCXX_WIN32
00044
00045 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
00046 #include <wtypes.h>
00047
00048 #ifdef max
00049 #undef max
00050 #endif
00051
00052 #endif
00053
00054 #ifndef __cplusplus
00055 #error "BLOCXX_Types.hpp can only be included by c++ files"
00056 #endif
00057
00058 extern "C"
00059 {
00060 #include <sys/types.h>
00061 }
00062
00063 namespace BLOCXX_NAMESPACE
00064 {
00065
00066 typedef unsigned char UInt8;
00067 typedef signed char Int8;
00068 #if BLOCXX_SIZEOF_SHORT_INT == 2
00069 typedef unsigned short UInt16;
00070 typedef short Int16;
00071 #define BLOCXX_INT16_IS_SHORT 1
00072 #elif BLOCXX_SIZEOF_INT == 2
00073 typedef unsigned int UInt16;
00074 typedef int Int16;
00075 #define BLOCXX_INT16_IS_INT 1
00076 #endif
00077 #if BLOCXX_SIZEOF_INT == 4
00078 typedef unsigned int UInt32;
00079 typedef int Int32;
00080 #define BLOCXX_INT32_IS_INT 1
00081 #elif BLOCXX_SIZEOF_LONG_INT == 4
00082 typedef unsigned long UInt32;
00083 typedef long Int32;
00084 #define BLOCXX_INT32_IS_LONG 1
00085 #endif
00086 #if BLOCXX_SIZEOF_LONG_INT == 8
00087 typedef unsigned long UInt64;
00088 typedef long Int64;
00089 #define BLOCXX_INT64_IS_LONG 1
00090 #elif BLOCXX_SIZEOF_LONG_LONG_INT == 8
00091 typedef unsigned long long UInt64;
00092 typedef long long Int64;
00093 #define BLOCXX_INT64_IS_LONG_LONG 1
00094 #else
00095 #error "Compiler must support 64 bit long"
00096 #endif
00097 #if BLOCXX_SIZEOF_DOUBLE == 8
00098 typedef double Real64;
00099 #define BLOCXX_REAL64_IS_DOUBLE 1
00100 #elif BLOCXX_SIZEOF_LONG_DOUBLE == 8
00101 typedef long double Real64;
00102 #define BLOCXX_REAL64_IS_LONG_DOUBLE 1
00103 #endif
00104 #if BLOCXX_SIZEOF_FLOAT == 4
00105 typedef float Real32;
00106 #define BLOCXX_REAL32_IS_FLOAT 1
00107 #elif BLOCXX_SIZEOF_DOUBLE == 4
00108 typedef double Real32;
00109 #define BLOCXX_REAL32_IS_DOUBLE 1
00110 #endif
00111
00112 #ifdef BLOCXX_WIN32
00113
00114 typedef HANDLE FileHandle;
00115 typedef HANDLE Descriptor;
00116 #define BLOCXX_INVALID_HANDLE INVALID_HANDLE_VALUE
00117 #define BLOCXX_INVALID_FILEHANDLE INVALID_HANDLE_VALUE
00118 typedef PSID UserId;
00119 typedef PSID uid_t;
00120 typedef PSID gid_t;
00121 typedef int mode_t;
00122 typedef long ssize_t;
00123 typedef HANDLE pid_t;
00124 typedef HANDLE ProcId;
00125 typedef struct {} siginfo_t;
00126
00127 #define BLOCXX_SHAREDLIB_EXTENSION ".dll"
00128 #define BLOCXX_FILENAME_SEPARATOR "\\"
00129 #define BLOCXX_FILENAME_SEPARATOR_C '\\'
00130 #define BLOCXX_PATHNAME_SEPARATOR ";"
00131
00132 #else //ifdef BLOCXX_WIN32
00133
00134 typedef int FileHandle;
00135 typedef int Descriptor;
00136 #define BLOCXX_INVALID_HANDLE -1
00137 #define BLOCXX_INVALID_FILEHANDLE -1
00138 typedef uid_t UserId;
00139 typedef pid_t ProcId;
00140
00141 #if defined BLOCXX_DARWIN
00142 #define BLOCXX_SHAREDLIB_EXTENSION ".dylib.bundle"
00143 #elif defined BLOCXX_HPUX && !defined(BLOCXX_ARCH_IA64)
00144 #define BLOCXX_SHAREDLIB_EXTENSION ".sl"
00145 #elif defined BLOCXX_HPUX
00146 #define BLOCXX_SHAREDLIB_EXTENSION ".so"
00147 #elif defined BLOCXX_NETWARE
00148 #define BLOCXX_SHAREDLIB_EXTENSION ".nlm"
00149 #else
00150 #define BLOCXX_SHAREDLIB_EXTENSION ".so"
00151 #endif
00152
00153 #define BLOCXX_FILENAME_SEPARATOR "/"
00154 #define BLOCXX_FILENAME_SEPARATOR_C '/'
00155 #define BLOCXX_PATHNAME_SEPARATOR ":"
00156 #endif //ifdef BLOCXX_WIN32
00157
00158 }
00159
00160 #endif