Recent

Author Topic: TProcessnamemacro vs. TProcess  (Read 708 times)

huckfinn

  • New Member
  • *
  • Posts: 10
TProcessnamemacro vs. TProcess
« on: January 07, 2024, 12:44:01 pm »
Is there any reason that the class TProcess is defined by
 
{$define TProcessnamemacro:=TProcess}?

Why will the debugger not work here?

PascalDragon

  • Hero Member
  • *****
  • Posts: 6004
  • Compiler Developer
Re: TProcessnamemacro vs. TProcess
« Reply #1 on: January 07, 2024, 01:16:48 pm »
Is there any reason that the class TProcess is defined by
 
{$define TProcessnamemacro:=TProcess}?

I think there used to be a TProcessUnicode which had TProcessnamemarco defined as that so that the same include file could be used, but then it was moved into a separate unit instead.

Probably nowadays it could be removed again... 🤔

huckfinn

  • New Member
  • *
  • Posts: 10
Re: TProcessnamemacro vs. TProcess
« Reply #2 on: January 07, 2024, 05:58:08 pm »
So following changes could be made?

1. Remove the macro in ${FPC_ROOT}/packages/fcl-process/process.pp line 54 ff.

Code: Pascal  [Select][+][-]
  1. // REMOVE {$macro on}
  2. {define processunicodestring}
  3. // REMOVE {$define TProcessnamemacro:=TProcess}              
  4.  

2. Correct the definition  {$define processunicodestring} because it is used in

${FPC_ROOT}/packages/fcl-process/processbody.inc lines 15 .. 41
 
Code: Pascal  [Select][+][-]
  1. Type
  2.    {$ifdef processunicodestring}
  3.    TProcessString = Unicodestring;
  4.    TprocessChar   = UnicodeChar;
  5. ...
  6.  

Code: Pascal  [Select][+][-]
  1. // CHANGE {define processunicodestring}
  2. {$define processunicodestring}
  3.  

3. Change the named macro type in

  ${FPC_ROOT}/packages/fcl-process/processbody.inc lines 45 ff.

Code: Pascal  [Select][+][-]
  1.   // REMOVE TProcessnamemacro = Class (TComponent)
  2.   TProcess = Class (TComponent)
  3.   Private
  4.     FOnRunCommandEvent: TOnRunCommandEvent;
  5.     FProcessOptions : TProcessOptions;
  6.     ...
  7.  

I cannot overview possible the side effects. Who is the maintainer of this code to send a correction request?

 

TinyPortal © 2005-2018