Răsfoiți Sursa

+ register a win16 dll scanner. Not functional yet.

git-svn-id: trunk@42230 -
nickysn 6 ani în urmă
părinte
comite
fe49522e6f
1 a modificat fișierele cu 36 adăugiri și 0 ștergeri
  1. 36 0
      compiler/systems/t_win16.pas

+ 36 - 0
compiler/systems/t_win16.pas

@@ -78,6 +78,16 @@ implementation
         constructor create;override;
         constructor create;override;
       end;
       end;
 
 
+      { TDLLScannerWin16 }
+
+      TDLLScannerWin16=class(tDLLScanner)
+      private
+        importfound : boolean;
+{        procedure CheckDLLFunc(const dllname,funcname:string);}
+      public
+        function Scan(const binname:string):boolean;override;
+      end;
+
 {****************************************************************************
 {****************************************************************************
                                TImportLibWin16
                                TImportLibWin16
 ****************************************************************************}
 ****************************************************************************}
@@ -397,6 +407,31 @@ begin
   CObjInput:=TOmfObjInput;
   CObjInput:=TOmfObjInput;
 end;
 end;
 
 
+{****************************************************************************
+                               TDLLScannerWin16
+****************************************************************************}
+
+function TDLLScannerWin16.Scan(const binname: string): boolean;
+var
+  hs,
+  dllname : TCmdStr;
+begin
+  result:=false;
+  { is there already an import library the we will use that one }
+  if FindLibraryFile(binname,target_info.staticClibprefix,target_info.staticClibext,hs) then
+    exit;
+  { check if we can find the dll }
+  hs:=binname;
+  if ExtractFileExt(hs)='' then
+    hs:=ChangeFileExt(hs,target_info.sharedlibext);
+  if not FindDll(hs,dllname) then
+    exit;
+  importfound:=false;
+  {todo: ReadDLLImports(dllname,@CheckDLLFunc);}
+  if importfound then
+    current_module.dllscannerinputlist.Pack;
+  result:=importfound;
+end;
 
 
 {*****************************************************************************
 {*****************************************************************************
                                      Initialize
                                      Initialize
@@ -407,5 +442,6 @@ initialization
   RegisterLinker(ld_win16,TExternalLinkerWin16WLink);
   RegisterLinker(ld_win16,TExternalLinkerWin16WLink);
   RegisterImport(system_i8086_win16,TImportLibWin16);
   RegisterImport(system_i8086_win16,TImportLibWin16);
   RegisterExport(system_i8086_win16,TExportLibWin16);
   RegisterExport(system_i8086_win16,TExportLibWin16);
+  RegisterDLLScanner(system_i8086_win16,TDLLScannerWin16);
   RegisterTarget(system_i8086_win16_info);
   RegisterTarget(system_i8086_win16_info);
 end.
 end.