Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2024-12

fpGUI issue on current FPC trunk

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

James Richters

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

Reply by email