From d930eeef282cd1a2dbe817a752f9d233d52a6d1a Mon Sep 17 00:00:00 2001 From: Loesje_ Date: Wed, 13 Oct 2010 18:14:49 +0000 Subject: [PATCH] * Fixed compilation on Linux git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1343 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/geckoport/nsInit.pas | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/components/geckoport/nsInit.pas b/components/geckoport/nsInit.pas index d92a52405..cf696d6db 100755 --- a/components/geckoport/nsInit.pas +++ b/components/geckoport/nsInit.pas @@ -295,7 +295,6 @@ function NS_CurrentProcessDirectory(buf: PAnsiChar; bufLen: Cardinal): Boolean; type TAnsiCharArray = array [0..High(Word) div SizeOf(AnsiChar)] of AnsiChar; TMaxPathChar = array[0..MAX_PATH] of AnsiChar; -// HINST = TLibHandle; PDependentLib = ^TDependentLib; TDependentLib = record libHandle: HMODULE; @@ -325,9 +324,12 @@ procedure ZeroArray(out AArray; const ASize: SizeInt); implementation uses - {$IFDEF MSWINDOWS} Windows, {$ELSE} DynLibs, {$ENDIF} nsError, nsMemory; + {$IFDEF MSWINDOWS} Windows, {$ELSE} DynLibs, {$ENDIF} nsError, nsMemory,math; type +{$IFNDEF MSWINDOWS} + HINST = TLibHandle; +{$ENDIF} XPCOMExitRoutine = function : Longword; stdcall; InitFunc = function(out servMgr: nsIServiceManager; binDir: nsIFile; provider: nsIDirectoryServiceProvider): Longword; cdecl; @@ -887,11 +889,15 @@ function GRE_GetGREPathWithProperties( buf: PAnsiChar; buflen: PRUint32): nsresult; var env: string; +{$IFDEF MSWINDOWS} hRegKey: HKEY; +{$ENDIF} ok: PRBool; versions: PGREVersionRangeArray; properties: PGREPropertyArray; GeckoVersion: String; + +{$IFDEF MSWINDOWS} function GRE_FireFox(): string; var Reg: TRegistry; @@ -919,6 +925,8 @@ var Reg.CloseKey; Reg.Free; end; +{$ENDIF} + begin versions := PGREVersionRangeArray(aVersions); properties := PGREPropertyArray(aProperties); @@ -1564,7 +1572,7 @@ var proc: Pointer; begin Result := False; - module := LoadLibraryA(filename); + module := LoadLibrary(filename); if module=0 then Exit; proc := GetProcAddress(module, 'NS_GetFrozenFunctions'); @@ -1573,6 +1581,7 @@ begin FreeLibrary(module); end; +{$IFDEF MSWINDOWS} function CheckGeckoVersion(path: PAnsiChar; const reqVer: TGREVersion): Boolean; const BUFSIZE = 4096; @@ -1687,6 +1696,7 @@ NoCurrentUser:; NS_StrCopy(buf, cuPath); end; end; +{$ENDIF} var GRELocation: TMaxPathChar;