Sign in Join

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

Mailing lists / fpc-devel / 2006-02

Windows Defines

9 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

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

Felipe Monteiro de Carvalho

Hello,

I am working on the Windows CE Widgetset for Lazarus. There were some defines on LCL like this:

{$ifdef win32}
  do something windows specific
{$endif}

But I would like those to be executed for Windows CE also, so we discovered that WINDOWS is defined for both on 2.1.x. Later we found out that it isn´t defined on 2.0.2. MSWINDOWS is defined for win32 on 2.0.2 but isn´t defined for WinCE on 2.1.x. So there is no define for both Win32 and wince that also works on 2.0.2.

Suggestions are appreciated.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Daniël Mantione
to Felipe Monteiro de Carvalho

Op Fri, 17 Feb 2006, schreef Felipe Monteiro de Carvalho:

Show quoted text 14 lines
Hello, I am working on the Windows CE Widgetset for Lazarus. There were some defines on LCL like this: {$ifdef win32} do something windows specific {$endif} But I would like those to be executed for Windows CE also, so we discovered that WINDOWS is defined for both on 2.1.x. Later we found out that it isn´t defined on 2.0.2. MSWINDOWS is defined for win32 on 2.0.2 but isn´t defined for WinCE on 2.1.x. So there is no define for both Win32 and wince that also works on 2.0.2.
{$ifdef win32}
  {$define windows}
{$endif}
{$ifdef wince}
  {$define windows}
{$endif}

... should solve the problem for the time being.

Daniël

Reply by email

Bogusław Brandys
to Felipe Monteiro de Carvalho: I am working on the Windows CE Widgetset for Lazarus. There were some defines on LCL like…
Felipe Monteiro de Carvalho wrote 20 lines
Hello, I am working on the Windows CE Widgetset for Lazarus. There were some defines on LCL like this: {$ifdef win32} do something windows specific {$endif} But I would like those to be executed for Windows CE also, so we discovered that WINDOWS is defined for both on 2.1.x. Later we found out that it isn´t defined on 2.0.2. MSWINDOWS is defined for win32 on 2.0.2 but isn´t defined for WinCE on 2.1.x. So there is no define for both Win32 and wince that also works on 2.0.2. Suggestions are appreciated. thanks, -- Felipe Monteiro de Carvalho

What about using {$ifdef win32} and for WinCE specific {$ifdef wince} ?

Regards
Boguslaw Brandys

Reply by email

Peter Vreman
to Felipe Monteiro de Carvalho: I am working on the Windows CE Widgetset for Lazarus. There were some defines on LCL like…
Show quoted text 16 lines
Hello, I am working on the Windows CE Widgetset for Lazarus. There were some defines on LCL like this: {$ifdef win32} do something windows specific {$endif} But I would like those to be executed for Windows CE also, so we discovered that WINDOWS is defined for both on 2.1.x. Later we found out that it isn´t defined on 2.0.2. MSWINDOWS is defined for win32 on 2.0.2 but isn´t defined for WinCE on 2.1.x. So there is no define for both Win32 and wince that also works on 2.0.2. Suggestions are appreciated.

The WINDOWS define can be merged into 2.0.3.

For 2.0.2 you can use the workaround in each unit or common icnlude file:

{$ifdef win32}
  {$define WINDOWS}
{$endif}

Reply by email

Oro06
to Daniël Mantione: Op Fri, 17 Feb 2006, schreef Felipe Monteiro de Carvalho: {$ifdef win32} {$define windows}
Daniël Mantione wrote 35 lines
Op Fri, 17 Feb 2006, schreef Felipe Monteiro de Carvalho: >Hello, > >I am working on the Windows CE Widgetset for Lazarus. There were some >defines on LCL like this: > >{$ifdef win32} > do something windows specific >{$endif} > >But I would like those to be executed for Windows CE also, so we >discovered that WINDOWS is defined for both on 2.1.x. Later we found >out that it isn´t defined on 2.0.2. MSWINDOWS is defined for win32 on >2.0.2 but isn´t defined for WinCE on 2.1.x. So there is no define for >both Win32 and wince that also works on 2.0.2. > > {$ifdef win32} {$define windows} {$endif} {$ifdef wince} {$define windows} {$endif} ... should solve the problem for the time being. Daniël

this could not work ? (i think i already use it )

{$if defined(win32) or defined(wince)}
{$endif}
Show quoted text 5 lines
_______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Daniël Mantione
to Oro06

Op Fri, 17 Feb 2006, schreef Oro06:

Show quoted text 5 lines
this could not work ? (i think i already use it ) {$if defined(win32) or defined(wince)} {$endif}

Of course it can, but I think the ultimate goal is to make all source code files {$ifdef windows}. Forcing the define in a global include file will make that possible with the current compilers.

Daniël

Reply by email

Peter Vreman
to Daniël Mantione
Show quoted text 9 lines
> this could not work ? (i think i already use it ) > > {$if defined(win32) or defined(wince)} > > {$endif} Of course it can, but I think the ultimate goal is to make all source code files {$ifdef windows}. Forcing the define in a global include file will make that possible with the current compilers.

Merged patch of the WINDOWS define to 2.0.3

Reply by email