[lazarus] LCL: create non-win32 directory

Florian Klaempfl Florian.Klaempfl at gmx.de
Wed Oct 15 18:00:32 EDT 2003


Mattias Gaertner wrote:
> On Mon, 06 Oct 2003 14:55:18 +0200
> Micha Nelissen <M.Nelissen at student.tue.nl> wrote:
> 
> 
>>Hi,
>>
>>Problem: unit messages is both present in the lcl and in the fpc rtl for 
>>  the win32 port. So, the messages unit does not exist in the non-win32 
>>rtl.
>>
>>Therefore the suggestion is to move all 'emulation units', like the 
>>messages unit, to a non-win32 directory and compile it only when the 
>>target is not win32. 
> 
> 
> The target is not given to the LCL (the lcl without interfaces). It is given
> to the LCL interfaces. The LCL is platform independent.

But the makefile knows about the target I guess :) So simply add 
lazarus/nonwin32 to the unit search path if the target isn't win32. The 
messages.pp is moved to this directory and the compiler finds it only 
for non-win32 (gtk/native whatever doesn't matter in this case) targets.

I sent Micha a patch which solves all these issues for 1.1 with type 
aliases. lmessages.pp uses the types from messages.pp of the rtl when 
compiled with 1.1 and on win32. Else it defines them and 
lazarus/nonwin32/messages.pp uses them :)

> The messages.pp exists only for Delphi compatibility and *not* for win32
> compatibility. Therefore messages.pp only uses messages from the
> lmessages.pp.
> Normally no LCL application should use the win32 messages. Of course the
> win32 intf and win32 specific components will need the win32 messages.pp
> from the RTL. Hmm. Tricky.
> 
> Either we copy the messages.pp from rtl to a new unit win32messages.pp in
> the lcl/interfaces/win32 dir. (My favourite). Or we remove messages.pp from
> the LCL and porting Delphi units will become more difficult. Think about
> someone working under win32, porting a unit  to Lazarus. He will have the
> messages unit in the rtl and the program will compile, maybe even work. But
> the program will fail on all other platforms.








More information about the Lazarus mailing list