ctypes.pp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2004 by Marco van de Voort, member of the
  5. Free Pascal development team
  6. Implements C types for in header conversions
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. unit ctypes;
  14. interface
  15. {$ifdef unix}
  16. uses unixtype;
  17. {$i aliasctp.inc}
  18. {$else}
  19. Type
  20. { the following type definitions are compiler dependant }
  21. { and system dependant }
  22. cInt8 = shortint;
  23. cUInt8 = byte;
  24. cUInt16= word;
  25. cInt16 = smallint;
  26. cInt32 = longint;
  27. cUInt32= cardinal;
  28. cInt64 = int64;
  29. {$ifndef VER1_0}
  30. cUInt64= qword;
  31. {$else}
  32. cUInt64= int64;
  33. {$endif}
  34. cuchar = byte;
  35. cchar = shortint;
  36. cInt = longint; { minimum range is : 32-bit }
  37. cUInt = Cardinal; { minimum range is : 32-bit }
  38. {$ifdef cpu64}
  39. cLong = int64;
  40. {$ifdef VER1_0}
  41. cuLong = int64;
  42. {$else}
  43. cuLong = qword;
  44. {$endif}
  45. {$else}
  46. cLong = longint;
  47. cuLong = Cardinal;
  48. {$endif}
  49. clonglong = int64;
  50. {$ifndef VER1_0}
  51. culonglong = qword;
  52. {$else VER1_0}
  53. culonglong = int64;
  54. {$endif VER1_0}
  55. cshort = smallint;
  56. cushort = word;
  57. pcInt = ^cInt;
  58. pcUInt = ^cUInt;
  59. pcLong = ^cLong;
  60. pculong = ^cuLong;
  61. pcshort = ^cshort;
  62. pcushort = ^cushort;
  63. pcchar = ^cchar;
  64. pcuchar = ^cuchar;
  65. cunsigned = cuint;
  66. pcunsigned = ^cunsigned;
  67. { Floating point }
  68. cFloat = Single;
  69. cDouble = Double;
  70. clDouble = Extended;
  71. pcFloat = ^cFloat;
  72. pcDouble = ^cDouble;
  73. pclDouble = ^clDouble;
  74. {$endif}
  75. // Kylix compat types
  76. u_long = culong;
  77. u_short = cushort;
  78. implementation
  79. end.
  80. {
  81. $Log$
  82. Revision 1.5 2005-03-13 10:05:13 florian
  83. + floating point c types added
  84. Revision 1.4 2005/03/01 22:45:09 hajny
  85. * Florian's changes from ctypes.inc merged in to make xlib compilable under non-Unix again
  86. Revision 1.3 2005/02/14 17:13:22 peter
  87. * truncate log
  88. Revision 1.2 2005/02/12 17:35:18 marco
  89. * some kylix stuf
  90. Revision 1.1 2005/01/10 10:32:50 marco
  91. * initial version
  92. }