Types.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. //
  2. // Types.h
  3. //
  4. // Library: Foundation
  5. // Package: Core
  6. // Module: Types
  7. //
  8. // Definitions of fixed-size integer types for various platforms
  9. //
  10. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef Foundation_Types_INCLUDED
  16. #define Foundation_Types_INCLUDED
  17. #include "Poco/Foundation.h"
  18. namespace Poco {
  19. #if defined(_MSC_VER)
  20. //
  21. // Windows/Visual C++
  22. //
  23. typedef signed char Int8;
  24. typedef unsigned char UInt8;
  25. typedef signed short Int16;
  26. typedef unsigned short UInt16;
  27. typedef signed int Int32;
  28. typedef unsigned int UInt32;
  29. typedef signed __int64 Int64;
  30. typedef unsigned __int64 UInt64;
  31. #if defined(_WIN64)
  32. #define POCO_PTR_IS_64_BIT 1
  33. typedef signed __int64 IntPtr;
  34. typedef unsigned __int64 UIntPtr;
  35. #else
  36. typedef signed long IntPtr;
  37. typedef unsigned long UIntPtr;
  38. #endif
  39. #define POCO_HAVE_INT64 1
  40. #elif defined(__GNUC__) || defined(__clang__)
  41. //
  42. // Unix/GCC/Clang
  43. //
  44. typedef signed char Int8;
  45. typedef unsigned char UInt8;
  46. typedef signed short Int16;
  47. typedef unsigned short UInt16;
  48. typedef signed int Int32;
  49. typedef unsigned int UInt32;
  50. #if defined(_WIN64)
  51. #define POCO_PTR_IS_64_BIT 1
  52. typedef signed long long IntPtr;
  53. typedef unsigned long long UIntPtr;
  54. typedef signed long long Int64;
  55. typedef unsigned long long UInt64;
  56. #else
  57. typedef signed long IntPtr;
  58. typedef unsigned long UIntPtr;
  59. #if defined(__LP64__)
  60. #define POCO_PTR_IS_64_BIT 1
  61. #define POCO_LONG_IS_64_BIT 1
  62. typedef signed long Int64;
  63. typedef unsigned long UInt64;
  64. #else
  65. typedef signed long long Int64;
  66. typedef unsigned long long UInt64;
  67. #endif
  68. #endif
  69. #define POCO_HAVE_INT64 1
  70. #elif defined(__DECCXX)
  71. //
  72. // Compaq C++
  73. //
  74. typedef signed char Int8;
  75. typedef unsigned char UInt8;
  76. typedef signed short Int16;
  77. typedef unsigned short UInt16;
  78. typedef signed int Int32;
  79. typedef unsigned int UInt32;
  80. typedef signed __int64 Int64;
  81. typedef unsigned __int64 UInt64;
  82. typedef signed long IntPtr;
  83. typedef unsigned long UIntPtr;
  84. #define POCO_PTR_IS_64_BIT 1
  85. #define POCO_LONG_IS_64_BIT 1
  86. #define POCO_HAVE_INT64 1
  87. #elif defined(__HP_aCC)
  88. //
  89. // HP Ansi C++
  90. //
  91. typedef signed char Int8;
  92. typedef unsigned char UInt8;
  93. typedef signed short Int16;
  94. typedef unsigned short UInt16;
  95. typedef signed int Int32;
  96. typedef unsigned int UInt32;
  97. typedef signed long IntPtr;
  98. typedef unsigned long UIntPtr;
  99. #if defined(__LP64__)
  100. #define POCO_PTR_IS_64_BIT 1
  101. #define POCO_LONG_IS_64_BIT 1
  102. typedef signed long Int64;
  103. typedef unsigned long UInt64;
  104. #else
  105. typedef signed long long Int64;
  106. typedef unsigned long long UInt64;
  107. #endif
  108. #define POCO_HAVE_INT64 1
  109. #elif defined(__SUNPRO_CC)
  110. //
  111. // SUN Forte C++
  112. //
  113. typedef signed char Int8;
  114. typedef unsigned char UInt8;
  115. typedef signed short Int16;
  116. typedef unsigned short UInt16;
  117. typedef signed int Int32;
  118. typedef unsigned int UInt32;
  119. typedef signed long IntPtr;
  120. typedef unsigned long UIntPtr;
  121. #if defined(__sparcv9)
  122. #define POCO_PTR_IS_64_BIT 1
  123. #define POCO_LONG_IS_64_BIT 1
  124. typedef signed long Int64;
  125. typedef unsigned long UInt64;
  126. #else
  127. typedef signed long long Int64;
  128. typedef unsigned long long UInt64;
  129. #endif
  130. #define POCO_HAVE_INT64 1
  131. #elif defined(__IBMCPP__)
  132. //
  133. // IBM XL C++
  134. //
  135. typedef signed char Int8;
  136. typedef unsigned char UInt8;
  137. typedef signed short Int16;
  138. typedef unsigned short UInt16;
  139. typedef signed int Int32;
  140. typedef unsigned int UInt32;
  141. typedef signed long IntPtr;
  142. typedef unsigned long UIntPtr;
  143. #if defined(__64BIT__)
  144. #define POCO_PTR_IS_64_BIT 1
  145. #define POCO_LONG_IS_64_BIT 1
  146. typedef signed long Int64;
  147. typedef unsigned long UInt64;
  148. #else
  149. typedef signed long long Int64;
  150. typedef unsigned long long UInt64;
  151. #endif
  152. #define POCO_HAVE_INT64 1
  153. #elif defined(__sgi)
  154. //
  155. // MIPSpro C++
  156. //
  157. typedef signed char Int8;
  158. typedef unsigned char UInt8;
  159. typedef signed short Int16;
  160. typedef unsigned short UInt16;
  161. typedef signed int Int32;
  162. typedef unsigned int UInt32;
  163. typedef signed long IntPtr;
  164. typedef unsigned long UIntPtr;
  165. #if _MIPS_SZLONG == 64
  166. #define POCO_PTR_IS_64_BIT 1
  167. #define POCO_LONG_IS_64_BIT 1
  168. typedef signed long Int64;
  169. typedef unsigned long UInt64;
  170. #else
  171. typedef signed long long Int64;
  172. typedef unsigned long long UInt64;
  173. #endif
  174. #define POCO_HAVE_INT64 1
  175. #elif defined(_DIAB_TOOL)
  176. typedef signed char Int8;
  177. typedef unsigned char UInt8;
  178. typedef signed short Int16;
  179. typedef unsigned short UInt16;
  180. typedef signed int Int32;
  181. typedef unsigned int UInt32;
  182. typedef signed long IntPtr;
  183. typedef unsigned long UIntPtr;
  184. typedef signed long long Int64;
  185. typedef unsigned long long UInt64;
  186. #define POCO_HAVE_INT64 1
  187. #endif
  188. } // namespace Poco
  189. #endif // Foundation_Types_INCLUDED