[lazarus] Win32 Code Analysis

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Fri Mar 30 16:02:09 EST 2001




On Fri, 30 Mar 2001, Cryst wrote:

> I looked into doing this a while back. The job is big.  I looked at it as
> two parts. First do the FPC and then the Lazarus. Just so that development
> time would be shortened.
>
> I wanted to re-compile the fpc in Delphi so I would not loose the
> cross-platform compatiblity. The first part of the job was renaming all the
> .pp files to .pas files. I have no idea why FPC uses .pp as the extension,
> but using .pas makes the Delphi compatiablity much more easy. After a long
> time renaming files, (I suppose I could have been more effecient) I started
> recompiling the fpc under Delphi. Unfortunetly the FPC has all these
> extensions to the language which makes it not-Delphi compatible.

We see these 'extensions' as useful :)

> I started
> ifdef'ing my way around them but after a while decided that it was too big a
> job for the amount of payback.
>
> Then I looked at Lazarus. Same type of problem. Gave up.
>
> This is not to discourage you though. I simply didn't have the time to
> spend, but with multiple hands the work would go much faster. So in view of
> this, I have some questions
>
> 1. Why are the source files named with the extension .pp.  If the fpc
> compiler is Delphi compatible, why would the defualt extension be different?
> Is there a reason for this that I'm just not seeing?  What would be the
> disadvantages to moving all lazarus (and fpc) source to .pas extensions?

Using .pp files marks them as files intended for Free Pascal.
This can be an indication that FPC extensions are used, but this can
also be useful for instance to be able to start up a different editor
when double clicking a file in e.g. the windows explorer.

And: The compiler does not name the files; it is the programmer that does
this.

> 2. Is there a way of making global macros in delphi that is simular to C.
> What I mean is is there a nice way of emulating fpc's extensions (like ++)
> in Delphi so that a common source that uses the extensions can be
> maintained, without all the ugly ifdef's (which defeat the purpose of the
> extensions in the first place).

None that I know of. Kylix introduces some extensions to directives,
but none that will do this.

It is always up to the programmer to code compiler-independent, the compiler
should not enforce anything.

Michael.






More information about the Lazarus mailing list