Browse Source

* TSearchPathString for the string type of the searchpaths, which is
ansistring under FPC/Delphi

peter 26 years ago
parent
commit
38ee2fd8b4
7 changed files with 90 additions and 45 deletions
  1. 13 9
      compiler/globals.pas
  2. 17 1
      compiler/globtype.pas
  3. 12 7
      compiler/t_go32v1.pas
  4. 12 7
      compiler/t_go32v2.pas
  5. 12 7
      compiler/t_linux.pas
  6. 12 7
      compiler/t_os2.pas
  7. 12 7
      compiler/t_win32.pas

+ 13 - 9
compiler/globals.pas

@@ -100,7 +100,7 @@ unit globals;
        librarysearchpath,
        unitsearchpath,
        objectsearchpath,
-       includesearchpath  : string;
+       includesearchpath  : TSearchPathString;
 
        { deffile }
        usewindowapi  : boolean;
@@ -236,9 +236,9 @@ unit globals;
     Function FixPath(s:string;allowdot:boolean):string;
     function FixFileName(const s:string):string;
     procedure SplitBinCmd(const s:string;var bstr,cstr:string);
-    procedure AddPathToList(var list:string;s:string;first:boolean);
-    function  getpathfromlist(var list:string):string;
-    function  search(const f : string;path : string;var b : boolean) : string;
+    procedure AddPathToList(var list:TSearchPathString;s:string;first:boolean);
+    function  getpathfromlist(var list:TSearchPathString):string;
+    function search(const f : string;path : TSearchPathString;var b : boolean) : string;
     procedure SynchronizeFileTime(const fn1,fn2:string);
     function FindExe(bin:string;var found:boolean):string;
     Procedure Shell(const command:string);
@@ -994,7 +994,7 @@ unit globals;
 
 
 
-   procedure AddPathToList(var list:string;s:string;first:boolean);
+   procedure AddPathToList(var list:TSearchPathString;s:string;first:boolean);
      var
        LastAdd,
        starti,i,j : longint;
@@ -1008,7 +1008,7 @@ unit globals;
      { Support default macro's }
        DefaultReplacements(s);
      { Fix List }
-       if (length(list)>0) and (list[length(list)]<>';') then
+       if (list<>'') and (list[length(list)]<>';') then
         list:=list+';';
        GetDir(0,CurrentDir);
        CurrentDir:=FixPath(CurrentDir,false);
@@ -1060,7 +1060,7 @@ unit globals;
      end;
 
 
-   function getpathfromlist(var list:string):string;
+   function getpathfromlist(var list:TSearchPathString):string;
      var
        s : string;
        i : longint;
@@ -1080,7 +1080,7 @@ unit globals;
      end;
 
 
-   function search(const f : string;path : string;var b : boolean) : string;
+   function search(const f : string;path : TSearchPathString;var b : boolean) : string;
       Var
         singlepathstring : string;
         i : longint;
@@ -1315,7 +1315,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.27  1999-10-26 12:30:41  peter
+  Revision 1.28  1999-11-04 10:55:31  peter
+    * TSearchPathString for the string type of the searchpaths, which is
+      ansistring under FPC/Delphi
+
+  Revision 1.27  1999/10/26 12:30:41  peter
     * const parameter is now checked
     * better and generic check if a node can be used for assigning
     * export fixes

+ 17 - 1
compiler/globtype.pas

@@ -25,6 +25,18 @@ interface
     const
        maxidlen = 64;
 
+    type
+       { Compiler dependent types }
+{$ifdef TP}
+       TSearchPathString = string;
+{$endif}
+{$ifdef FPC}
+       TSearchPathString = ansistring;
+{$endif}
+{$ifdef Delphi}
+       TSearchPathString = ansistring;
+{$endif}
+
     type
        { System independent float names }
 {$ifdef i386}
@@ -179,7 +191,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.20  1999-10-22 10:39:34  peter
+  Revision 1.21  1999-11-04 10:55:31  peter
+    * TSearchPathString for the string type of the searchpaths, which is
+      ansistring under FPC/Delphi
+
+  Revision 1.20  1999/10/22 10:39:34  peter
     * split type reading from pdecl to ptype unit
     * parameter_dec routine is now used for procedure and procvars
 

+ 12 - 7
compiler/t_go32v1.pas

@@ -72,6 +72,7 @@ Function TLinkergo32v1.WriteResponseFile(isdll:boolean) : Boolean;
 Var
   linkres  : TLinkRes;
   i        : longint;
+  HPath    : TSearchPathString;
   s,s2     : string;
   linklibc : boolean;
 begin
@@ -83,17 +84,17 @@ begin
   { Write path to search libraries }
   if assigned(current_module^.locallibrarysearchpath) then
    begin
-     S:=current_module^.locallibrarysearchpath^;
-     while s<>'' do
+     HPath:=current_module^.locallibrarysearchpath^;
+     while HPath<>'' do
       begin
-        s2:=GetPathFromList(s);
+        s2:=GetPathFromList(HPath);
         LinkRes.Add('-L'+s2);
       end;
    end;
-  S:=LibrarySearchPath;
-  while s<>'' do
+  HPath:=LibrarySearchPath;
+  while HPath<>'' do
    begin
-     s2:=GetPathFromList(s);
+     s2:=GetPathFromList(HPath);
      LinkRes.Add('-L'+s2);
    end;
 
@@ -188,7 +189,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.2  1999-10-22 14:42:40  peter
+  Revision 1.3  1999-11-04 10:55:31  peter
+    * TSearchPathString for the string type of the searchpaths, which is
+      ansistring under FPC/Delphi
+
+  Revision 1.2  1999/10/22 14:42:40  peter
     * reset linklibc
 
   Revision 1.1  1999/10/21 14:29:38  peter

+ 12 - 7
compiler/t_go32v2.pas

@@ -71,6 +71,7 @@ Function TLinkerGo32v2.WriteResponseFile(isdll:boolean) : Boolean;
 Var
   linkres  : TLinkRes;
   i        : longint;
+  HPath    : TSearchPathString;
   s,s2     : string;
   linklibc : boolean;
 begin
@@ -82,17 +83,17 @@ begin
   { Write path to search libraries }
   if assigned(current_module^.locallibrarysearchpath) then
    begin
-     S:=current_module^.locallibrarysearchpath^;
-     while s<>'' do
+     HPath:=current_module^.locallibrarysearchpath^;
+     while HPath<>'' do
       begin
-        s2:=GetPathFromList(s);
+        s2:=GetPathFromList(HPath);
         LinkRes.Add('-L'+s2);
       end;
    end;
-  S:=LibrarySearchPath;
-  while s<>'' do
+  HPath:=LibrarySearchPath;
+  while HPath<>'' do
    begin
-     s2:=GetPathFromList(s);
+     s2:=GetPathFromList(HPath);
      LinkRes.Add('-L'+s2);
    end;
 
@@ -290,7 +291,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.2  1999-10-22 14:42:40  peter
+  Revision 1.3  1999-11-04 10:55:31  peter
+    * TSearchPathString for the string type of the searchpaths, which is
+      ansistring under FPC/Delphi
+
+  Revision 1.2  1999/10/22 14:42:40  peter
     * reset linklibc
 
   Revision 1.1  1999/10/21 14:29:38  peter

+ 12 - 7
compiler/t_linux.pas

@@ -233,6 +233,7 @@ Var
   cprtobj,
   gprtobj,
   prtobj       : string[80];
+  HPath        : TSearchPathString;
   s,s2         : string;
   found,
   linkdynamic,
@@ -270,17 +271,17 @@ begin
   { Write path to search libraries }
   if assigned(current_module^.locallibrarysearchpath) then
    begin
-     S:=current_module^.locallibrarysearchpath^;
-     while s<>'' do
+     HPath:=current_module^.locallibrarysearchpath^;
+     while HPath<>'' do
       begin
-        s2:=GetPathFromList(s);
+        s2:=GetPathFromList(HPath);
         LinkRes.Add('SEARCH_DIR('+s2+')');
       end;
    end;
-  S:=LibrarySearchPath;
-  while s<>'' do
+  HPath:=LibrarySearchPath;
+  while HPath<>'' do
    begin
-     s2:=GetPathFromList(s);
+     s2:=GetPathFromList(HPath);
      LinkRes.Add('SEARCH_DIR('+s2+')');
    end;
 
@@ -434,7 +435,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.1  1999-10-21 14:29:38  peter
+  Revision 1.2  1999-11-04 10:55:31  peter
+    * TSearchPathString for the string type of the searchpaths, which is
+      ansistring under FPC/Delphi
+
+  Revision 1.1  1999/10/21 14:29:38  peter
     * redesigned linker object
     + library support for linux (only procedures can be exported)
 

+ 12 - 7
compiler/t_os2.pas

@@ -370,6 +370,7 @@ Function TLinkeros2.WriteResponseFile(isdll:boolean) : Boolean;
 Var
   linkres  : TLinkRes;
   i        : longint;
+  HPath    : TSearchPathString;
   s,s2     : string;
 begin
   WriteResponseFile:=False;
@@ -380,17 +381,17 @@ begin
   { Write path to search libraries }
   if assigned(current_module^.locallibrarysearchpath) then
    begin
-     S:=current_module^.locallibrarysearchpath^;
-     while s<>'' do
+     HPath:=current_module^.locallibrarysearchpath^;
+     while HPath<>'' do
       begin
-        s2:=GetPathFromList(s);
+        s2:=GetPathFromList(HPath);
         LinkRes.Add('-L'+s2);
       end;
    end;
-  S:=LibrarySearchPath;
-  while s<>'' do
+  HPath:=LibrarySearchPath;
+  while HPath<>'' do
    begin
-     s2:=GetPathFromList(s);
+     s2:=GetPathFromList(HPath);
      LinkRes.Add('-L'+s2);
    end;
 
@@ -490,7 +491,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.1  1999-10-21 14:29:38  peter
+  Revision 1.2  1999-11-04 10:55:31  peter
+    * TSearchPathString for the string type of the searchpaths, which is
+      ansistring under FPC/Delphi
+
+  Revision 1.1  1999/10/21 14:29:38  peter
     * redesigned linker object
     + library support for linux (only procedures can be exported)
 

+ 12 - 7
compiler/t_win32.pas

@@ -642,6 +642,7 @@ Function TLinkerWin32.WriteResponseFile(isdll:boolean) : Boolean;
 Var
   linkres  : TLinkRes;
   i        : longint;
+  HPath    : TSearchPathString;
   s,s2     : string;
   linklibc : boolean;
 begin
@@ -653,17 +654,17 @@ begin
   { Write path to search libraries }
   if assigned(current_module^.locallibrarysearchpath) then
    begin
-     S:=current_module^.locallibrarysearchpath^;
-     while s<>'' do
+     HPath:=current_module^.locallibrarysearchpath^;
+     while HPath<>'' do
       begin
-        s2:=GetPathFromList(s);
+        s2:=GetPathFromList(HPath);
         LinkRes.Add('SEARCH_DIR('+s2+')');
       end;
    end;
-  S:=LibrarySearchPath;
-  while s<>'' do
+  HPath:=LibrarySearchPath;
+  while HPath<>'' do
    begin
-     s2:=GetPathFromList(s);
+     s2:=GetPathFromList(HPath);
      LinkRes.Add('SEARCH_DIR('+s2+')');
    end;
 
@@ -1046,7 +1047,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.4  1999-11-02 15:06:58  peter
+  Revision 1.5  1999-11-04 10:55:31  peter
+    * TSearchPathString for the string type of the searchpaths, which is
+      ansistring under FPC/Delphi
+
+  Revision 1.4  1999/11/02 15:06:58  peter
     * import library fixes for win32
     * alignment works again