Skip to content

Commit 350e4d4

Browse files
Update type definition structure (sdltype.inc, sdlstdinc.inc)
- shift all defitions from sdltype.inc into sdlstdinc.inc - reanme wrongly named sdltype.inc into sdltypes.inc (the header is called SDL_types.h) - SDL_types.h and therefore sdltypes.inc are deprecated but kept with a deprecation message - remove deprecated sdltypes.inc from sdl2 include list
1 parent 8d4a858 commit 350e4d4

File tree

4 files changed

+86
-79
lines changed

4 files changed

+86
-79
lines changed

sdl2.pas

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
"sdl_timer.h",
4848
"sdl_touch.h",
4949
"sdl_version.h",
50-
"sdl_video.h",
51-
"sdl_types.h"
50+
"sdl_video.h"
5251
5352
I will not translate:
5453
"sdl_opengl.h",
@@ -136,7 +135,7 @@ interface
136135
{$ENDIF}
137136
{$ENDIF}
138137

139-
{$I sdltype.inc}
138+
{$I sdlstdinc.inc}
140139
{$I sdlversion.inc}
141140
{$I sdlerror.inc}
142141
{$I sdlplatform.inc}
@@ -171,7 +170,6 @@ interface
171170
{$I sdlfilesystem.inc}
172171
{$I sdllog.inc}
173172
{$I sdlsystem.inc}
174-
{$I sdlstdinc.inc}
175173
{$I sdl.inc}
176174

177175
implementation

sdlstdinc.inc

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,76 @@
1-
//from sdl_stdinc.h
1+
//types from SDL_stdinc.h
2+
type
3+
4+
TSDL_Bool = (SDL_FALSE,SDL_TRUE);
5+
6+
DWord = LongWord;
7+
8+
PUInt8Array = ^TUInt8Array;
9+
PUInt8 = ^UInt8;
10+
PPUInt8 = ^PUInt8;
11+
UInt8 = Byte;
12+
{$EXTERNALSYM UInt8}
13+
TUInt8Array = array [0..MAXINT shr 1] of UInt8;
14+
15+
PUInt16 = ^UInt16;
16+
UInt16 = word;
17+
{$EXTERNALSYM UInt16}
18+
19+
PSInt8 = ^SInt8;
20+
SInt8 = Shortint;
21+
{$EXTERNALSYM SInt8}
22+
23+
PSInt16 = ^SInt16;
24+
SInt16 = smallint;
25+
{$EXTERNALSYM SInt16}
26+
27+
PUInt32 = ^UInt32;
28+
UInt32 = Cardinal;
29+
{$EXTERNALSYM UInt32}
30+
31+
PSInt32 = ^SInt32;
32+
SInt32 = LongInt;
33+
{$EXTERNALSYM SInt32}
34+
35+
PFloat = ^Float;
36+
PInt = ^LongInt;
37+
38+
PShortInt = ^ShortInt;
39+
40+
{$IFNDEF Has_Int64}
41+
PUInt64 = ^UInt64;
42+
UInt64 = record
43+
hi: UInt32;
44+
lo: UInt32;
45+
end;
46+
{$EXTERNALSYM UInt64}
47+
48+
PInt64 = ^Int64;
49+
Int64 = record
50+
hi: UInt32;
51+
lo: UInt32;
52+
end;
53+
{$EXTERNALSYM Int64}
54+
55+
PSInt64 = ^SInt64;
56+
SInt64 = Int64;
57+
{$EXTERNALSYM SInt64}
58+
{$ELSE}
59+
PSInt64 = ^SInt64;
60+
SInt64 = Int64;
61+
{$ENDIF}
62+
63+
{$IFNDEF WIN64}
64+
size_t = UInt32;
65+
{$ELSE}
66+
size_t = UInt64;
67+
{$ENDIF}
68+
{$EXTERNALSYM SIZE_T}
69+
70+
Float = Single;
71+
{$EXTERNALSYM Float}
272

373
{**
4-
* Free memory returned by functions like SDL_GetBasePath(), SDL_GetPrefPath(), etc.
5-
*}
6-
Procedure SDL_free(mem: Pointer); cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_free' {$ENDIF} {$ENDIF};
74+
* Free memory returned by functions like SDL_GetBasePath(), SDL_GetPrefPath(), etc.
75+
*}
76+
procedure SDL_free(mem: Pointer); cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_free' {$ENDIF} {$ENDIF};

sdltype.inc

Lines changed: 0 additions & 71 deletions
This file was deleted.

sdltypes.inc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//types from SDLtypes.h
2+
3+
{**
4+
* \file SDL_types.h
5+
*
6+
* \deprecated
7+
*}
8+
9+
{* DEPRECATED *}
10+
//#include "SDL_stdinc.h"

0 commit comments

Comments
 (0)