Recent

Author Topic: can fpc alias types as delphi sytem.types ?  (Read 2646 times)

alexraynepe196

  • New Member
  • *
  • Posts: 26
can fpc alias types as delphi sytem.types ?
« on: November 03, 2021, 06:17:34 pm »
Hallow!
in my delphi code used System.Types unit.
fpc RTL have an types unit too.
and is there any way for provide delphi-way alias system.type to -> fpc-rtl types ?
or only way to solve porting - ifdefs in code?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10399
  • FPC developer.
Re: can fpc alias types as delphi sytem.types ?
« Reply #1 on: November 03, 2021, 08:35:35 pm »
Best is to remove the prefixes, and then in the Delphi XE2+ project add system,winapi etc to the "default prefixes".

That way it stays working with FPC, old and new Delphi

Thaddy

  • Hero Member
  • *****
  • Posts: 12208
Re: can fpc alias types as delphi sytem.types ?
« Reply #2 on: November 04, 2021, 09:50:19 am »
The other option is to use Lazarus' macro feature, but that makes it editor dependent.
Alas, the standard FPC macro feature does not support dots...
(I once filed a bug report for that)
If it would support dots, it would be a doddle to write such a macro.
« Last Edit: November 04, 2021, 12:22:43 pm by Thaddy »
Manuals, manuals, manuals first.
You have incompetence and sheer incompetence.

 

TinyPortal © 2005-2018