summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d2ad22)
raw | patch | inline | side by side (parent: 3d2ad22)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 29 Dec 2018 09:02:45 +0000 (12:02 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 10 Feb 2019 10:05:11 +0000 (13:05 +0300) |
src/lib/vampimg/ImagingUtility.pas | patch | blob | history | |
src/shared/a_modes.inc | patch | blob | history | |
src/shared/envvars.pas | patch | blob | history | |
src/shared/utils.pas | patch | blob | history |
index c137e1d1386823beaaeefdd0d2aec47e21d5c93e..257ca2655c32f7ecdd007717bb23999a069c362b 100644 (file)
{$IF Defined(MSWINDOWS)}
Windows;
{$ELSEIF Defined(FPC)}
- Dos, BaseUnix, Unix;
+ Dos
+ {$IFDEF Unix}
+ , BaseUnix, Unix
+ {$ENDIF}
+ ;
{$ELSEIF Defined(DELPHI)}
Posix.SysTime;
{$IFEND}
Posix.SysTime.GetTimeOfDay(Time, nil);
Result := Int64(Time.tv_sec) * 1000000 + Time.tv_usec;
end;
-{$ELSEIF Defined(FPC)}
+{$ELSEIF Defined(FPC) and Defined(UNIX)}
function GetTimeMicroseconds: Int64;
var
TimeVal: TTimeVal;
fpGetTimeOfDay(@TimeVal, nil);
Result := Int64(TimeVal.tv_sec) * 1000000 + TimeVal.tv_usec;
end;
+{$ELSE}
+ function GetTimeMicroseconds: Int64;
+ begin
+ {$WARNING GetTimeMicroseconds stub!}
+ result := 0
+ end;
{$IFEND}
function GetTimeMilliseconds: Int64;
diff --git a/src/shared/a_modes.inc b/src/shared/a_modes.inc
index fc8cc51c991dc635defab80fef4b0e2aacbc1f7e..efb88c0e1360fd905b236de0110d9e96e1a9b619 100644 (file)
--- a/src/shared/a_modes.inc
+++ b/src/shared/a_modes.inc
{$COPERATORS ON}
{$EXTENDEDSYNTAX ON}
{$IFDEF CPU386}
- {$FPUTYPE SSE}
+ {$IFDEF GO32V2}
+ {$ELSE}
+ {$FPUTYPE SSE}
+ {$ENDIF}
{$ENDIF}
{$GOTO ON}
{$IEEEERRORS OFF}
{$VARSTRINGCHECKS OFF}
{$S-} // disable stack checking
-{$MMX-} // get lost, mmx
+{$IFDEF GO32V2}
+{$ELSE}
+ {$MMX-} // get lost, mmx
+{$ENDIF}
{$IF DEFINED(D2F_DEBUG)}
{$STACKFRAMES ON}
diff --git a/src/shared/envvars.pas b/src/shared/envvars.pas
index 5c60fd0d7c1adefe3508ebaf7f5d3cc948512820..55d58702b4487b0cf2d85de10921d0b42b877dab 100644 (file)
--- a/src/shared/envvars.pas
+++ b/src/shared/envvars.pas
Result := -1;
end;
{$ELSE}
-{$LINKLIB c}
-const clib = 'c';
-function setenv(const VarStr: PChar; const VarVal: PChar; Repl: cint): cint;
-cdecl; external clib name 'setenv';
+ {$IFDEF GO32V2}
+ function setenv(const VarStr: PChar; const VarVal: PChar; Repl: cint): cint;
+ begin
+ {$WARNING setenv stub!}
+ result := 0
+ end;
+ {$ELSE}
+ {$LINKLIB c}
+ const clib = 'c';
+ function setenv(const VarStr: PChar; const VarVal: PChar; Repl: cint): cint; cdecl; external clib name 'setenv';
+ {$ENDIF}
{$ENDIF}
function SetEnvVar(const VarName: AnsiString; const VarVal: AnsiString): Boolean;
diff --git a/src/shared/utils.pas b/src/shared/utils.pas
index 16006052e826e21e09f2f0cdfd1cc3247f095864..641cae7ddf44bc4d36a1360e0d3e6bd46394ace1 100644 (file)
--- a/src/shared/utils.pas
+++ b/src/shared/utils.pas
@@ -1392,7 +1392,46 @@ function nclamp (v, a, b: Extended): Extended; inline; overload; begin if (v < a
{$IFDEF WINDOWS}
function snprintf (buf: PAnsiChar; bufsize: SizeUInt; const fmt: PAnsiChar): SizeUInt; cdecl; varargs; external 'msvcrt.dll' name '_snprintf';
{$ELSE}
+ {$IFDEF GO32V2}
+
+function snprintf (buf: PAnsiChar; bufsize: SizeUInt; const fmt: PAnsiChar): SizeUInt;
+begin
+ {$WARNING snprintf not implemented!}
+ buf[0] := #0;
+ result := 0
+end;
+
+function snprintf (buf: PAnsiChar; bufsize: SizeUInt; const fmt: PAnsiChar; x: LongInt): SizeUInt; overload;
+begin
+ {$WARNING snprintf+longint not implemented!}
+ buf[0] := #0;
+ result := 0
+end;
+
+function snprintf (buf: PAnsiChar; bufsize: SizeUInt; const fmt: PAnsiChar; x: PAnsiChar): SizeUInt; overload;
+begin
+ {$WARNING snprintf+string not implemented!}
+ buf[0] := #0;
+ result := 0
+end;
+
+function snprintf (buf: PAnsiChar; bufsize: SizeUInt; const fmt: PAnsiChar; x: Char): SizeUInt; overload;
+begin
+ {$WARNING snprintf+char not implemented!}
+ buf[0] := #0;
+ result := 0
+end;
+
+function snprintf (buf: PAnsiChar; bufsize: SizeUInt; const fmt: PAnsiChar; x: Double): SizeUInt; overload;
+begin
+ {$WARNING snprintf+double not implemented!}
+ buf[0] := #0;
+ result := 0
+end;
+
+ {$ELSE}
function snprintf (buf: PAnsiChar; bufsize: SizeUInt; const fmt: PAnsiChar): SizeUInt; cdecl; varargs; external 'libc' name 'snprintf';
+ {$ENDIF}
{$ENDIF}