On 16.10.2010 12:35, Uffe Kousgaard wrote:
"Jonas Maebe"<jonas.ma...@elis.ugent.be>  wrote in
message news:6ef537cb-d266-4034-8c96-8286158ac...@elis.ugent.be...

1) Whenever I compile "single = min(single,single)" I have to add math.min
or the win32 compiler complains and expects longints instead. Is there a
difference between the RTL in the two versions?

Compile with -vh to see which declaration the compiler finds when the
compilation fails.

Max(LongInt,LongInt): LongInt

TCriticalSection is not a class, it's a Win API struct.

It is a class in D7, SyncObjs.pas. And understood by the WinCE compiler, at
least it seems so.

Even if it just maps to the WinAPI, it is still a class.

TCriticalSection is a WinAPI struct if you include the unit Windows.
If you include the unit SyncObjs it's a Object Pascal class that uses FPC's cross platform TRTLCriticalSection.

The problem is if you include both units it depends on the order of the unit which type wins.

E.g.

uses
  Windows, SyncObjs;

var
  cs: TCriticalSection; // will be SyncObjs.TCriticalSection (a class)

but

uses
  SyncObjs, Windows;

var
  cs: TCriticalSection; // will be Windows.TCriticalSection (a record)

This is the same in Delphi by the way.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to