ctypes.pp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2004 by Marco van de Voort, member of the
  4. Free Pascal development team
  5. Implements C types for in header conversions
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit ctypes;
  13. interface
  14. {$ifdef unix}
  15. uses unixtype;
  16. {$i aliasctp.inc}
  17. {$else}
  18. Type
  19. { the following type definitions are compiler dependant }
  20. { and system dependant }
  21. cInt8 = shortint;
  22. cUInt8 = byte;
  23. cUInt16= word;
  24. cInt16 = smallint;
  25. cInt32 = longint;
  26. cUInt32= cardinal;
  27. cInt64 = int64;
  28. cUInt64= qword;
  29. cuchar = byte;
  30. cchar = shortint;
  31. cInt = longint; { minimum range is : 32-bit }
  32. cUInt = Cardinal; { minimum range is : 32-bit }
  33. {$ifdef cpu64}
  34. cLong = int64;
  35. cuLong = qword;
  36. {$else}
  37. cLong = longint;
  38. cuLong = Cardinal;
  39. {$endif}
  40. clonglong = int64;
  41. culonglong = qword;
  42. cshort = smallint;
  43. cushort = word;
  44. pcInt = ^cInt;
  45. pcUInt = ^cUInt;
  46. pcLong = ^cLong;
  47. pculong = ^cuLong;
  48. pcshort = ^cshort;
  49. pcushort = ^cushort;
  50. pcchar = ^cchar;
  51. pcuchar = ^cuchar;
  52. cunsigned = cuint;
  53. pcunsigned = ^cunsigned;
  54. { Floating point }
  55. cFloat = Single;
  56. cDouble = Double;
  57. clDouble = Extended;
  58. pcFloat = ^cFloat;
  59. pcDouble = ^cDouble;
  60. pclDouble = ^clDouble;
  61. {$endif}
  62. // Kylix compat types
  63. u_long = culong;
  64. u_short = cushort;
  65. implementation
  66. end.