[fpc-pascal] fpGUI issue on current FPC trunk

James Richters james.richters at productionautomation.net
Wed Dec 4 13:11:26 CET 2024


Hi Graeme, 
I'm not sure if you saw this issue as is was buried in the middle of one of
my emails when you were out.
 
I tried compiling fpGUI with the current FPC trunk (downloaded a few days
ago)
fpg_base.pas the line 38:  TfpgChar        = type String[4];    
Gets this error:
fpg_base.pas(41,32) Error: Parameters or result types cannot contain local
type definitions. Use a separate type definition in a type block.
 
While this does work in FPC3.2.2, it Just doesn't work in the current FPC
trunk, so I changed it to
TfpgChar        = String[4];
 
I thought it was more important to keep it a String[4] than to do something
like an array of Char that might not be able to be assigned the same way... 
I'm not sure exactly when or what FPC changed that causes this to be an
issue, or if there is a better way to fix it, but for the current FPC trunk
it needs to be addressed.
 
Or maybe this is not even supposed to be happening?   Does anyone know why
this is an issue now but it wasn't an issue on FPC 3.2.2? 
 
Here is the original code from fpGUI fpg_base.pas:
 
type
  TfpgCoord       = integer;     // we might use floating point coordinates
in the future...
  TfpgColor       = type longword;    // Always in AARRGGBB (Alpha, Red,
Green, Blue) format!!
  TfpgString      = type AnsiString;
  TfpgChar        = type String[4];
 
  PPoint = ^TPoint;
 
  TRGBTriple = packed record
    Red: byte;
    Green: byte;
    Blue: byte;
    Alpha: byte;
  end;
 
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20241204/0efb406f/attachment-0001.htm>


More information about the fpc-pascal mailing list