Skip to content

Commit b65907f

Browse files
committed
Add SDL_copysign and SDL_fabs
1 parent 6691a76 commit b65907f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

units/sdlstdinc.inc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,24 @@ function SDL_ceil(x: cdouble): cdouble; cdecl;
230230
function SDL_ceilf(x: cfloat): cfloat; cdecl;
231231
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_ceilf' {$ENDIF} {$ENDIF};
232232

233+
(**
234+
* Return a number whose absolute value matches that of x,
235+
* but the sign matches that of y.
236+
*
237+
* \since This function is available since SDL 2.0.4.
238+
*)
239+
function SDL_copysign(x, y: cdouble): cdouble; cdecl;
240+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_copysign' {$ENDIF} {$ENDIF};
241+
242+
(**
243+
* Return a number whose absolute value matches that of x,
244+
* but the sign matches that of y.
245+
*
246+
* \since This function is available since SDL 2.0.8.
247+
*)
248+
function SDL_copysignf(x, y: cfloat): cfloat; cdecl;
249+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_copysignf' {$ENDIF} {$ENDIF};
250+
233251
(**
234252
* Calculate the cosine of x, where x is given in radians.
235253
*
@@ -246,6 +264,22 @@ function SDL_cos(x: cdouble): cdouble; cdecl;
246264
function SDL_cosf(x: cfloat): cfloat; cdecl;
247265
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_cosf' {$ENDIF} {$ENDIF};
248266

267+
(**
268+
* Calculate the absolute value of x.
269+
*
270+
* \since This function is available since SDL 2.0.4.
271+
*)
272+
function SDL_fabs(x: cdouble): cdouble; cdecl;
273+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_fabs' {$ENDIF} {$ENDIF};
274+
275+
(**
276+
* Calculate the absolute value of x.
277+
*
278+
* \since This function is available since SDL 2.0.8.
279+
*)
280+
function SDL_fabsf(x: cfloat): cfloat; cdecl;
281+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_fabsf' {$ENDIF} {$ENDIF};
282+
249283
(**
250284
* Calculate the largest integral value that is not greater than x.
251285
*

0 commit comments

Comments
 (0)