Debian Codegraph @

src/base/castleutils_types.inc

raw
1 {%MainUnit castleutils.pas}
2 {
3 Copyright 2002-2018 Michalis Kamburelis.
4
5 This file is part of "Castle Game Engine".
6
7 "Castle Game Engine" is free software; see the file COPYING.txt,
8 included in this distribution, for details about the copyright.
9
10 "Castle Game Engine" is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 ----------------------------------------------------------------------------
15 }
16
17 { @section(Very very basic types that are needed by many included files) }
18
19 {$ifdef read_interface}
20
21 type
22 { Floating-point type with best precision. }
23 Float = {$ifdef FPC} Math.Float {$else} Extended {$endif};
24 PFloat = {$ifdef FPC} Math.PFloat {$else} PExtended {$endif};
25
26 PCardinal = ^Cardinal;
27 PLongWord = ^LongWord;
28 PShortint = ^Shortint;
29
30 {$ifdef FPC}
31 { Pointer to a boolean.
32 Defined as ^Byte in some Delphi Windows unit,
33 for FPC 1.0.x PBoolean is not available at all. }
34 PBoolean = ^Boolean;
35 {$endif}
36
37 { Infinite array of bytes. }
38 PByteArray = ^TByteArray;
39 TByteArray = array[0..MaxInt div SizeOf(Byte)-1] of Byte;
40
41 { Pointer to TObject.
42 Don't call this PObject or PTObject to avoid possible name clashes
43 with other units (pointers are often used in situations that prevent
44 good type-checking, so better to avoid name clashes to avoid some
45 nasty errors). }
46 PtrObject = ^TObject;
47
48 { Size (signed) used for various list types Count, Capacity, index variables.
49
50 Delphi uses Integer for this.
51 FPC uses SizeInt for this (which may have larger size than Integer,
52 FPC docs say it is matching pointer size, so 64-bit on 64-bit platforms). }
53 TListSize = {$ifdef FPC} SizeInt {$else} Integer {$endif};
54
55 {$endif}