[fpc-devel] {$I %LINE%} and friends

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Fri Apr 29 10:44:33 CEST 2011



On Fri, 29 Apr 2011, Hans-Peter Diettrich wrote:

> michael.vancanneyt at wisa.be schrieb:
>
>>> But what is the cleaner way? To defer the expansion of {$I %xxx%}
>>> inside macros, or to define c-like macros __LINE__ and __FILE__, maybe
>>> with nicer names?
>> 
>> Defer expansion. The use of {$I } is mandatory, since __LINE__ and friends 
>> are valid
>> pascal identifiers and this should not be changed by a macro.
>
> What about %%LINE%%, or {%LINE%} or {{LINE}}?

Keep it simple; the less directives, the better.

> I wonder why FPC broke Delphi compatibility by adding {$MODE}, instead of 
> choosing its own prefix for added compiler directives and macros.

Because it would mean yet another kind of directive, this is confusing.

Michael.



More information about the fpc-devel mailing list