Sign in Join

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

Mailing lists / fpc-devel / 2010-11

Documentation on Real types

9 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi Michael,

Do you think it is worth mention the information listed below in the FPC Language Reference? I made DocView annotations in my local ref.inf document, but it might be useful to others as well, hence my thought of adding it to the official docs.

At first glance, I couldn't see that the 2.4.0 ref.pdf mentions this info. It does mention some times are processor dependant, but it doesn't make it as clear as below. Please correct me if I am wrong.

Op 2010-11-01 16:33, Hans-Peter Diettrich het geskryf:

Show quoted text 11 lines
> > FPC has Extended and it's rang is 19-20 significant digits with range: > 1.9E-4932 – 1.1E4932 > It's size is 10 bytes. AFAIK this type is not available on x64 architecture, and the use of the FPU is discouraged as well - has somebody a reference to this strange change? Are 128 bit reals available now, as a replacement? That's why a x64 system even cannot cross-compile for i386 (and other) targets, without using an FPU emulator.

...and...

Op 2010-11-01 14:23, Jonas Maebe het geskryf:

> My question was more: Is Extended usable/enabled on Win64 or is > it Extended=Double as well? Extended = double on Win64 in FPC as well.

Regards,
- Graeme -

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

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys

Some other annotations I have in my ref.inf document is C Types, and how they map to Object Pascal types. Maybe this would be useful too in the official docs - after all, many developers translate/port C headers or libraries to FPC. If it will be useful to add to the docs, I'm not 100% sure if this must go in the Lang Ref or RTL docs (eg: System or CTypes units).

Some alias types I have made notes about:

DWord -> Cardinal

Long -\
clong - --> LongInt
cint -/

Short -> SmallInt
Uint -> Cardinal
ULong -> Cardianl
Handle -> DWord (Win32); LongInt(Linux)

etc...

Regards,
- Graeme -

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

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys

Well, the CTypes unit is documented, so I see no need to add this ?

You should not use native pascal types when translating, always use the types from the ctypes unit. That's its purpose, after all.

Michael.

Graeme Geldenhuys wrote 34 lines
Some other annotations I have in my ref.inf document is C Types, and how they map to Object Pascal types. Maybe this would be useful too in the official docs - after all, many developers translate/port C headers or libraries to FPC. If it will be useful to add to the docs, I'm not 100% sure if this must go in the Lang Ref or RTL docs (eg: System or CTypes units). Some alias types I have made notes about: DWord -> Cardinal Long -\ clong - --> LongInt cint -/ Short -> SmallInt Uint -> Cardinal ULong -> Cardianl Handle -> DWord (Win32); LongInt(Linux) etc... Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/ _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Marco van de Voort
to Michael Van Canneyt

In our previous episode, Michael Van Canneyt said:

Well, the CTypes unit is documented, so I see no need to add this ? You should not use native pascal types when translating, always use the types from the ctypes unit. That's its purpose, after all.

Like for in 64-bit *nix where clong is 64-bit (ptrint) and not longint.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Well, the CTypes unit is documented, so I see no need to add this ? You should not use…

Op 2010-11-02 10:04, Michael Van Canneyt het geskryf:

You should not use native pascal types when translating, always use the types from the ctypes unit. That's its purpose, after all.

Until recently (thanks to Marco), I never even knew that unit existed. :-) I've been using it since then, but never actually looked if it was documented or not. If it is, then all is well.

Regards,
- Graeme -

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

Reply by email

Marco van de Voort
to Graeme Geldenhuys

In our previous episode, Graeme Geldenhuys said:

Show quoted text 6 lines
Op 2010-11-02 10:04, Michael Van Canneyt het geskryf: > > You should not use native pascal types when translating, always use the > types from the ctypes unit. That's its purpose, after all. Until recently (thanks to Marco),

???!?

I never even knew that unit existed. :-)

You don't use any FPC *nix headers ? E.g. X11 ?

Reply by email

Henry Vermaak
to Marco van de Voort
Marco van de Voort wrote 13 lines
In our previous episode, Graeme Geldenhuys said: > Op 2010-11-02 10:04, Michael Van Canneyt het geskryf: >> >> You should not use native pascal types when translating, always use the >> types from the ctypes unit. That's its purpose, after all. > > Until recently (thanks to Marco), ???!? > I never even knew that unit existed. :-) You don't use any FPC *nix headers ? E.g. X11 ?

This is where I spotted it (and then h2pas has an option to use it, iirc). Maybe it's worth a mention in "Using external code and variables" in the manual.

Henry

Reply by email

Graeme Geldenhuys
to Marco van de Voort: In our previous episode, Graeme Geldenhuys said: ???!? You don't use any FPC *nix headers…

Op 2010-11-02 12:19, Marco van de Voort het geskryf:

> Until recently (thanks to Marco), ???!?

I had a issue implementing XDND (drag-n-drop) protocol (worked on 32-bit, failed on 64-bit). You mentioned I used the wrong data types, and should have used the ctypes unit instead.

> I never even knew that unit existed. :-) You don't use any FPC *nix headers ? E.g. X11 ?

I never paid that much attention to the converted header units uses clause included with FPC. I was rather referring to my own converted units, or my units that need to work with C data structures. I used to use Object Pascal types in such cases, but now use the C alias types defined in ctypes.

Regards,
- Graeme -

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

Reply by email