diff --git a/src/shared/utils.pas b/src/shared/utils.pas
index 946e4f5a07c7a31a5422fad1f2f479fb83ffce6a..26150aa3f2e4627706b19df003439de4c7d4a045 100644 (file)
--- a/src/shared/utils.pas
+++ b/src/shared/utils.pas
'.dfzip'
);
+{$IF DEFINED(FREEBSD) OR DEFINED(DARWIN)}
+const NilThreadId = nil;
+{$ELSE}
+const NilThreadId = 0;
+{$ENDIF}
+
// ////////////////////////////////////////////////////////////////////////// //
type
function readInt64BE (st: TStream): Int64;
function readUInt64BE (st: TStream): UInt64;
+function nlerp (a, b: Integer; t: Single): Integer; inline;
function nmin (a, b: Byte): Byte; inline; overload;
function nmin (a, b: ShortInt): ShortInt; inline; overload;
@@ -1528,6 +1535,8 @@ function readUInt64BE (st: TStream): UInt64; begin readIntegerBE(st, @result, 8)
// ////////////////////////////////////////////////////////////////////////// //
+function nlerp (a, b: Integer; t: Single): Integer; inline; begin result := round((1.0 - t) * a + t * b); end;
+
function nmin (a, b: Byte): Byte; inline; overload; begin if (a < b) then result := a else result := b; end;
function nmin (a, b: ShortInt): ShortInt; inline; overload; begin if (a < b) then result := a else result := b; end;
function nmin (a, b: Word): Word; inline; overload; begin if (a < b) then result := a else result := b; end;