Browse Source

* netware patches for copyright, screenname, threadname directives

peter 24 years ago
parent
commit
652a4b8aaa
3 changed files with 90 additions and 5 deletions
  1. 13 1
      compiler/globals.pas
  2. 38 1
      compiler/scandir.pas
  3. 39 3
      compiler/targets/t_nwm.pas

+ 13 - 1
compiler/globals.pas

@@ -133,6 +133,12 @@ interface
        akttokenpos,                  { position of the last token }
        aktfilepos : tfileposinfo;    { current position }
 
+       { ad 18.05.2001: Screen and Threadname for Netware }
+       nwscreenname : string;
+       nwthreadname : string;
+       nwcopyright  : string;
+
+
        { type of currently parsed block }
        { isn't full implemented (FK)    }
        block_type : tblock_type;
@@ -1217,6 +1223,9 @@ implementation
         usewindowapi:=false;
         description:='Compiled by FPC '+version_string+' - '+target_cpu_string;
         dllversion:='';
+        nwscreenname := '';
+        nwthreadname := '';
+        nwcopyright  := '';
 
       { Init values }
         initmodeswitches:=fpcmodeswitches;
@@ -1273,7 +1282,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.34  2001-05-12 12:11:31  peter
+  Revision 1.35  2001-05-30 21:35:48  peter
+    * netware patches for copyright, screenname, threadname directives
+
+  Revision 1.34  2001/05/12 12:11:31  peter
     * simplify_ppu is now the default, a recompile of the compiler now
       only compiles pp.pas
 

+ 38 - 1
compiler/scandir.pas

@@ -178,6 +178,33 @@ implementation
         description:=current_scanner.readcomment;
       end;
 
+    procedure dir_screenname; {ad}
+      begin
+        if target_info.target <> target_i386_netware then
+          {Message(scan_w_decription_not_support);}
+          comment (V_Warning,'Screenname only supported for target netware');
+        current_scanner.skipspace;
+        nwscreenname:=current_scanner.readcomment;
+      end;
+
+      procedure dir_threadname; {ad}
+      begin
+        if target_info.target <> target_i386_netware then
+          {Message(scan_w_decription_not_support);}
+          comment (V_Warning,'Threadname only supported for target netware');
+        current_scanner.skipspace;
+        nwthreadname:=current_scanner.readcomment;
+      end;
+
+      procedure dir_copyright; {ad}
+      begin
+        if target_info.target <> target_i386_netware then
+          {Message(scan_w_decription_not_support);}
+          comment (V_Warning,'Copyright only supported for target netware');
+        current_scanner.skipspace;
+        nwcopyright:=current_scanner.readcomment;
+      end;
+
     procedure dir_error;
       begin
         do_message(scan_e_user_defined);
@@ -744,6 +771,7 @@ implementation
         AddDirective('ASMMODE',{$ifdef FPCPROCVAR}@{$endif}dir_asmmode);
         AddDirective('ASSERTIONS',{$ifdef FPCPROCVAR}@{$endif}dir_assertions);
         AddDirective('BOOLEVAL',{$ifdef FPCPROCVAR}@{$endif}dir_booleval);
+        AddDirective('COPYRIGHT',{$ifdef FPCPROCVAR}@{$endif}dir_copyright);
         AddDirective('D',{$ifdef FPCPROCVAR}@{$endif}dir_description);
         AddDirective('DEBUGINFO',{$ifdef FPCPROCVAR}@{$endif}dir_debuginfo);
         AddDirective('DESCRIPTION',{$ifdef FPCPROCVAR}@{$endif}dir_description);
@@ -787,10 +815,16 @@ implementation
         AddDirective('RANGECHECKS',{$ifdef FPCPROCVAR}@{$endif}dir_rangechecks);
         AddDirective('REFERENCEINFO',{$ifdef FPCPROCVAR}@{$endif}dir_referenceinfo);
         AddDirective('SATURATION',{$ifdef FPCPROCVAR}@{$endif}dir_saturation);
+        {ad 18.05.2001: Screen and Threadname for Netware}
+        AddDirective('SCREENNAME',{$ifdef FPCPROCVAR}@{$endif}dir_screenname);
+
         AddDirective('SMARTLINK',{$ifdef FPCPROCVAR}@{$endif}dir_smartlink);
         AddDirective('STACKFRAMES',{$ifdef FPCPROCVAR}@{$endif}dir_stackframes);
         AddDirective('STATIC',{$ifdef FPCPROCVAR}@{$endif}dir_static);
         AddDirective('STOP',{$ifdef FPCPROCVAR}@{$endif}dir_stop);
+        {ad 18.05.2001: Screen and Threadname for Netware}
+        AddDirective('THREADNAME',{$ifdef FPCPROCVAR}@{$endif}dir_threadname);
+
         AddDirective('TYPEDADDRESS',{$ifdef FPCPROCVAR}@{$endif}dir_typedaddress);
         AddDirective('TYPEINFO',{$ifdef FPCPROCVAR}@{$endif}dir_typeinfo);
         AddDirective('UNITPATH',{$ifdef FPCPROCVAR}@{$endif}dir_unitpath);
@@ -809,7 +843,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.2  2001-04-18 22:01:58  peter
+  Revision 1.3  2001-05-30 21:35:49  peter
+    * netware patches for copyright, screenname, threadname directives
+
+  Revision 1.2  2001/04/18 22:01:58  peter
     * registration of targets and assemblers
 
   Revision 1.1  2001/04/13 18:00:36  peter

+ 39 - 3
compiler/targets/t_nwm.pas

@@ -266,6 +266,7 @@ Var
   ProgNam      : string [80];
   NlmNam       : string [80];
   hp2          : texported_item;  { for exports }
+  p            : byte;
 begin
   WriteResponseFile:=False;
 
@@ -278,11 +279,43 @@ begin
   { Open link.res file }
   LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
 
+  p := Pos ('"', Description);
+  while (p > 0) do
+  begin
+    delete (Description,p,1);
+    p := Pos ('"', Description);
+  end;
   if Description <> '' then
     LinkRes.Add('DESCRIPTION "' + Description + '"');
   LinkRes.Add('VERSION '+tostr(dllmajor)+','+tostr(dllminor)+','+tostr(dllrevision));
-  LinkRes.Add('SCREENNAME "' + ProgNam + '"');  { for that, we have }
-  LinkRes.Add('THREADNAME "' + ProgNam + '"');  { to add comiler directives }
+  {if nwscreenname = '' then nwscreenname := ProgNam;
+  if nwthreadname = '' then nwthreadname := ProgNam;}
+  p := Pos ('"', nwscreenname);
+  while (p > 0) do
+  begin
+    delete (nwscreenname,p,1);
+    p := Pos ('"', nwscreenname);
+  end;
+  p := Pos ('"', nwthreadname);
+  while (p > 0) do
+  begin
+    delete (nwthreadname,p,1);
+    p := Pos ('"', nwthreadname);
+  end;
+  p := Pos ('"', nwcopyright);
+  while (p > 0) do
+  begin
+    delete (nwcopyright,p,1);
+    p := Pos ('"', nwcopyright);
+  end;
+
+  if nwscreenname <> '' then
+    LinkRes.Add('SCREENNAME "' + nwscreenname + '"');
+  if nwthreadname <> '' then
+    LinkRes.Add('THREADNAME "' + nwthreadname + '"');
+  if nwcopyright <> '' then
+    LinkRes.Add('COPYRIGHT "' + nwcopyright + '"');
+
   if stacksize > 1024 then
   begin
     str (stacksize, s);
@@ -476,7 +509,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.3  2001-04-18 22:02:04  peter
+  Revision 1.4  2001-05-30 21:35:49  peter
+    * netware patches for copyright, screenname, threadname directives
+
+  Revision 1.3  2001/04/18 22:02:04  peter
     * registration of targets and assemblers
 
   Revision 1.2  2001/04/13 01:22:21  peter