IdCTypes.pas 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. unit IdCTypes;
  2. // TODO: deprecate this unit and move the declarations to the IdGlobal unit.
  3. interface
  4. {$I IdCompilerDefines.inc}
  5. {This unit should not contain ANY program code. It is meant to be extremely
  6. thin. The idea is that the unit will contain type mappings that used for headers
  7. and API calls using the headers. The unit is here because in cross-platform
  8. headers, the types may not always be the same as they would for Win32 on x86
  9. Intel architecture. We also want to be completely compatiable with Borland
  10. Delphi for Win32.}
  11. {$IFDEF HAS_UNIT_ctypes}
  12. uses
  13. ctypes;
  14. {$ENDIF}
  15. {
  16. IMPORTANT!!!
  17. The types below are defined to hide architecture differences for various C++
  18. types while also making this header compile with Borland Delphi.
  19. }
  20. type
  21. {$IFDEF FPC}
  22. TIdC_LONG = cLong;
  23. PIdC_LONG = pcLong;
  24. TIdC_ULONG = cuLong;
  25. PIdC_ULONG = pculong;
  26. TIdC_LONGLONG = clonglong;
  27. PIdC_LONGLONG = pclonglong;
  28. TIdC_ULONGLONG = culonglong;
  29. PIdC_ULONGLONG = pculonglong;
  30. TIdC_SHORT = cshort;
  31. PIdC_SHORT = pcshort;
  32. TIdC_USHORT = cuShort;
  33. PIdC_USHORT = pcuShort;
  34. TIdC_INT = cInt;
  35. PIdC_INT = pcInt;
  36. TIdC_UINT = cUInt;
  37. PIdC_UINT = pcUInt;
  38. TIdC_SIGNED = csigned;
  39. PIdC_SIGNED = pcsigned;
  40. TIdC_UNSIGNED = cunsigned;
  41. PIdC_UNSIGNED = pcunsigned;
  42. TIdC_INT8 = cint8;
  43. PIdC_INT8 = pcint8;
  44. TIdC_UINT8 = cuint8;
  45. PIdC_UINT8 = pcuint8;
  46. TIdC_INT16 = cint16;
  47. PIdC_INT16 = pcint16;
  48. TIdC_UINT16 = cuint16;
  49. PIdC_UINT16 = pcuint16;
  50. TIdC_INT32 = cint32;
  51. PIdC_INT32 = pcint32;
  52. TIdC_UINT32 = cint32;
  53. PIdC_UINT32 = pcuint32;
  54. TIdC_INT64 = cint64;
  55. PIdC_INT64 = pcint64;
  56. TIdC_UINT64 = cuint64;
  57. PIdC_UINT64 = pcuint64;
  58. TIdC_FLOAT = cfloat;
  59. PIdC_FLOAT = pcfloat;
  60. TIdC_DOUBLE = cdouble;
  61. PIdC_DOUBLE = pcdouble;
  62. TIdC_LONGDOUBLE = clongdouble;
  63. PIdC_LONGDOUBLE = pclongdouble;
  64. {$ELSE}
  65. //this is necessary because Borland still doesn't support QWord
  66. // (unsigned 64bit type).
  67. {$IFNDEF HAS_QWord}
  68. qword = {$IFDEF HAS_UInt64}UInt64{$ELSE}Int64{$ENDIF};
  69. {$ENDIF}
  70. TIdC_LONG = LongInt;
  71. PIdC_LONG = ^TIdC_LONG;
  72. TIdC_ULONG = LongWord;
  73. PIdC_ULONG = ^TIdC_ULONG;
  74. TIdC_LONGLONG = Int64;
  75. PIdC_LONGLONG = ^TIdC_LONGLONG;
  76. TIdC_ULONGLONG = QWord;
  77. PIdC_ULONGLONG = ^TIdC_ULONGLONG;
  78. TIdC_SHORT = Smallint;
  79. PIdC_SHORT = ^TIdC_SHORT;
  80. TIdC_USHORT = Word;
  81. PIdC_USHORT = ^TIdC_USHORT;
  82. TIdC_INT = Integer;
  83. PIdC_INT = ^TIdC_INT;
  84. TIdC_UINT = Cardinal;
  85. PIdC_UINT = ^TIdC_UINT;
  86. TIdC_SIGNED = Integer;
  87. PIdC_SIGNED = ^TIdC_SIGNED;
  88. TIdC_UNSIGNED = Cardinal;
  89. PIdC_UNSIGNED = ^TIdC_UNSIGNED;
  90. TIdC_INT8 = Shortint;
  91. PIdC_INT8 = ^TIdC_INT8;
  92. TIdC_UINT8 = Byte;
  93. PIdC_UINT8 = ^TIdC_UINT8;
  94. TIdC_INT16 = Smallint;
  95. PIdC_INT16 = ^TIdC_INT16;
  96. TIdC_UINT16 = Word;
  97. PIdC_UINT16 = ^TIdC_UINT16;
  98. TIdC_INT32 = Integer;
  99. PIdC_INT32 = ^TIdC_INT32;
  100. TIdC_UINT32 = Cardinal;
  101. PIdC_UINT32 = ^TIdC_UINT32;
  102. TIdC_INT64 = Int64;
  103. PIdC_INT64 = ^TIdC_INT64;
  104. TIdC_UINT64 = QWord;
  105. PIdC_UINT64 = ^TIdC_UINT64;
  106. TIdC_FLOAT = Single;
  107. PIdC_FLOAT = ^TIdC_FLOAT;
  108. TIdC_DOUBLE = Double;
  109. PIdC_DOUBLE = ^TIdC_DOUBLE;
  110. TIdC_LONGDOUBLE = Extended;
  111. PIdC_LONGDOUBLE = ^TIdC_LONGDOUBLE;
  112. //Some headers require this in D5 or earlier.
  113. //FreePascal already has this in its system unit.
  114. {$IFNDEF HAS_PByte}PByte = ^Byte;{$ENDIF}
  115. {$IFNDEF HAS_PWord}PWord = ^Word;{$ENDIF}
  116. {$ENDIF}
  117. implementation
  118. end.