Browse Source

Compilable PascalCoinMainer

maciej-izak 7 years ago
parent
commit
c4319ec00e
3 changed files with 14 additions and 2 deletions
  1. 8 0
      PasOpenCL/CL_GL.pas
  2. 2 2
      PascalCoinMiner.pp
  3. 4 0
      Units/PascalCoin/UGPUMining.pas

+ 8 - 0
PasOpenCL/CL_GL.pas

@@ -107,7 +107,9 @@ const
   CL_CGL_SHAREGROUP_KHR         =  $200C;
 
 
+{$IFDEF DYNLINK}
 type
+{$ENDIF}
 {$IFDEF CL_VERSION_1_0}
   {$IFDEF DYNLINK}TclCreateFromGLBuffer = {$ENDIF}function {$IFNDEF DYNLINK}clCreateFromGLBuffer{$ENDIF}(
                                       context: Pcl_context;                     (* context *)
@@ -226,6 +228,7 @@ type
                                        ): TCL_int;
                                        extdecl; {$IFNDEF DYNLINK}external name 'clGetGLContextInfoKHR';{$ENDIF}
 {$ENDIF}
+{$IFDEF DYNLINK}
 var
 {$IFDEF CL_VERSION_1_0}
   clCreateFromGLBuffer:       TclCreateFromGLBuffer;
@@ -244,6 +247,7 @@ var
 {$IFDEF CL_VERSION_1_2}
   clCreateFromGLTexture:      TclCreateFromGLTexture;
 {$ENDIF}
+{$ENDIF}
 
 function InitCL_GL: Boolean;
 
@@ -251,6 +255,7 @@ implementation
 
 function InitCL_GL: Boolean;
 begin
+  {$IFDEF DYNLINK}
   Result := False;
   if OCL_LibHandle <> nil then
   begin
@@ -272,6 +277,9 @@ begin
     {$ENDIF}
     Result := True;
   end;
+  {$ELSE}
+  Result := true;
+  {$ENDIF}
 end;
 
 end.

+ 2 - 2
PascalCoinMiner.pp

@@ -40,7 +40,7 @@ type
     procedure OnMinerValuesChanged(Sender : TObject);
     procedure OnFoundNOnce(Sender : TCustomMinerDeviceThread; Timestamp, nOnce : Cardinal);
     procedure WriteLine(nline : Integer; txt : String);
-    procedure OnInThreadNewLog(logtype : TLogType; Time : TDateTime; ThreadID : Cardinal; Const sender, logtext : AnsiString);
+    procedure OnInThreadNewLog(logtype : TLogType; Time : TDateTime; ThreadID : TThreadID; Const sender, logtext : AnsiString);
   protected
     FWindow32X1,FWindow32Y1,FWindow32X2,FWindow32Y2: DWord;
     FLock : TCriticalSection;
@@ -169,7 +169,7 @@ begin
 end;
 
 procedure TPascalMinerApp.OnInThreadNewLog(logtype: TLogType; Time: TDateTime;
-  ThreadID: Cardinal; const sender, logtext: AnsiString);
+  ThreadID: TThreadID; const sender, logtext: AnsiString);
 var msg : String;
   i,nline : Integer;
 begin

+ 4 - 0
Units/PascalCoin/UGPUMining.pas

@@ -105,7 +105,11 @@ end;
 constructor TGPUDriver.Create;
 begin
   FPlatforms := Nil;
+  {$IFDEF DYNLINK}
   FHasOpenCL:=InitOpenCL;
+  {$ELSE}
+  FHasOpenCL:=true;
+  {$ENDIF}
   _GPUDriver := Self;
 end;