Skip to content

Commit f0d6f79

Browse files
Add SDL_atomic.inc
1 parent d3b472a commit f0d6f79

File tree

2 files changed

+579
-0
lines changed

2 files changed

+579
-0
lines changed

units/SDL3.pas

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ interface
110110
{$I SDL_dialog.inc} // 3.2.0
111111
{$I SDL_time.inc} // 3.2.0
112112
{$I SDL_filesystem.inc} // 3.2.0
113+
{$I SDL_atomic.inc} // 3.2.0
113114

114115

115116
implementation
@@ -313,5 +314,16 @@ function SDL_WINDOWPOS_ISCENTERED(X: Integer): Boolean;
313314
Result := (X and $FFFF0000) = SDL_WINDOWPOS_CENTERED_MASK;
314315
end;
315316

317+
{ Macros from SDL_atomic.h }
318+
function SDL_AtomicIncRef(a: PSDL_AtomicInt): cint;
319+
begin
320+
SDL_AtomicIncRef:=SDL_AddAtomicInt(a,1);
321+
end;
322+
323+
function SDL_AtomicDecRef(a: PSDL_AtomicInt): cbool;
324+
begin
325+
SDL_AtomicDecRef:=(SDL_AddAtomicInt(a,-1)=1);
326+
end;
327+
316328
end.
317329

0 commit comments

Comments
 (0)