Sign in Join

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

Mailing lists / fpc-devel / 2011-10

Delphi incompatibly regarding PtrInt and NativeInt

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

I got an email from a Delphi XE2 user busy working on a 64-bit patch for tiOPF3. A few things he noted, which I see is different to how FPC done it.

Under 64-bit FPC we have the following:

  PtrInt = Int64;
  NativeInt  = PtrInt;

But apparently under 64-bit Delphi XE2

  PtrInt = Integer;        // Integer always being 32-bit, so is the
                           // pointer then
  NativeInt = Int64;

I don't have a copy of Delphi XE2 available, so can't test this myself. Just thought I would mention it in case anybody here can collaborate.

I did find this XE2 documentation though.

http://docwiki.embarcadero.com/VCL/en/System.NativeInt

If this is all correct, the changes apply to both FPC 2.6.0 (upcoming release) and FPC 2.7.1 (trunk) for FPC to stay compatible with Delphi.

Then again, changing PtrInt to meant 32-bit size in FPC would break a crap load of code that was recently changes. But such is life if you create a clone compiler.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Marco van de Voort
to Graeme Geldenhuys

In our previous episode, Graeme Geldenhuys said:

Show quoted text 13 lines
I got an email from a Delphi XE2 user busy working on a 64-bit patch for tiOPF3. A few things he noted, which I see is different to how FPC done it. Under 64-bit FPC we have the following: PtrInt = Int64; NativeInt = PtrInt; But apparently under 64-bit Delphi XE2 PtrInt = Integer; // Integer always being 32-bit, so is the // pointer then

ptrint in XE (and I assume XE2 too) does not exist in the base system, only in some directx header. (dxtypes)

So there is no clash of types between Delphi and FPC in the base system, just embarcadero using some duplicate identifier in some undocumented peripheral header unit that FPC does not or not yet support.

Somebody/You can petition Embarcadero to rename the ptrint type in the (minor) directx unit. If they by some miracle happen to do it, it might save some minor confusion.

In short: much ado about nothing.

Reply by email