Sign in Join

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

Mailing lists / fpc-devel / 2018-09

3.0.4 and Windows 64

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Ozz Nixon

A few years ago I acquired IP rights to Halcyon (xBase for Delphi/FPC). For years, I have not had an issue, today, I am recompiling the suite (zero code changes) - 3.0.4 Linux - no problems, 3.0.4 Mac - no problems. However, 3.0.4 Windows - I am getting:

Halcyon6SQL.pas(1407,41) Error: Can't determine which overloaded function to call
Halcyon6SQL.pas(1752,34) Error: Can't determine which overloaded function to call
Halcyon6SQL.pas(2413) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted

Code is basically doing:

   Int64 := trunc(variant);

had to change to type cast:

   Int64 := trunc(Extended(variant));

the there error I am getting, code is basically doing:

   comp := double*10000;
Halcyon6DBF.pas(2123,33) Error: Incompatible types: got "Double" expected
"Int64"

This last one, I am not sure what the compiler is expecting, and why only on the Windows platform?

Ozz

Reply by email

Sven Barth
to Ozz Nixon

Ozz Nixon schrieb am So., 30. Sep. 2018, 17:18:

Show quoted text 30 lines
A few years ago I acquired IP rights to Halcyon (xBase for Delphi/FPC). For years, I have not had an issue, today, I am recompiling the suite (zero code changes) - 3.0.4 Linux - no problems, 3.0.4 Mac - no problems. However, 3.0.4 Windows - I am getting: Halcyon6SQL.pas(1407,41) Error: Can't determine which overloaded function to call Halcyon6SQL.pas(1752,34) Error: Can't determine which overloaded function to call Halcyon6SQL.pas(2413) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted Code is basically doing: Int64 := trunc(variant); had to change to type cast: Int64 := trunc(Extended(variant)); the there error I am getting, code is basically doing: comp := double*10000; Halcyon6DBF.pas(2123,33) Error: Incompatible types: got "Double" expected "Int64" This last one, I am not sure what the compiler is expecting, and why only on the Windows platform?

That's because on Win64 the Extended type is not available. There Extended is an alias to Double (explaining the first error) and Comp is an alias to Int64.

Regards,
Sven

Reply by email

Ozz Nixon
to Sven Barth

So, should I re-code everything to Double where possible? And Comp at Int64 no problem, that is how my Turbo Pascal build works (except I am using Int64 = Record (DWord, DWord)).

Thanks for the help!

On Sun, Sep 30, 2018 at 1:09 PM Sven Barth via fpc-devel <

Show quoted text 47 lines
wrote: Ozz Nixon schrieb am So., 30. Sep. 2018, 17:18: > A few years ago I acquired IP rights to Halcyon (xBase for Delphi/FPC). > For years, I have not had an issue, today, I am recompiling the suite (zero > code changes) - 3.0.4 Linux - no problems, 3.0.4 Mac - no problems. > However, 3.0.4 Windows - I am getting: > > Halcyon6SQL.pas(1407,41) Error: Can't determine which overloaded function > to call > Halcyon6SQL.pas(1752,34) Error: Can't determine which overloaded function > to call > Halcyon6SQL.pas(2413) Fatal: There were 2 errors compiling module, > stopping > Fatal: Compilation aborted > > Code is basically doing: > > Int64 := trunc(variant); > > had to change to type cast: > > Int64 := trunc(Extended(variant)); > > the there error I am getting, code is basically doing: > > comp := double*10000; > > Halcyon6DBF.pas(2123,33) Error: Incompatible types: got "Double" expected > "Int64" > > This last one, I am not sure what the compiler is expecting, and why only > on the Windows platform? > That's because on Win64 the Extended type is not available. There Extended is an alias to Double (explaining the first error) and Comp is an alias to Int64. Regards, Sven > _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Ozz Nixon

Following the code further along, I am storing the COMP to disk... if I change to INT64, it is not storing the same value as the COMP field was. Any suggestions?

Also, this part of the project is for dBase.com and Visual FoxPro compatibility. So, I cannot go off reservation. Why exactly is FPC WIN64 making all these changes to primitive types?

AM Sven Barth wrote 15 lines
Ozz Nixon schrieb am So., 30. Sep. 2018, 19:17: > So, should I re-code everything to Double where possible? And Comp at > Int64 no problem, that is how my Turbo Pascal build works (except I am > using Int64 = Record (DWord, DWord)). > If you don't rely on the increased precision it would indeed be best to use Double as Extended only exists on x86 anyway (both 32 and 64 bit with the exception of Win64). Regards, Sven >

Reply by email

Florian Klämpfl
to Ozz Nixon
Ozz Nixon wrote
Also, this part of the project is for dBase.com and Visual FoxPro compatibility. So, I cannot go off reservation. Why exactly is FPC WIN64 making all these changes to primitive types?

Because the old x87 style fpu is deprecated for good reasons.

Reply by email

Ozz Nixon
to Florian Klämpfl

Thank you for explaining. Since I am needing compatibility at the disk level (binary form)... does anyone know of a unit or some routines to read/write: Comp, Double, Extended byte for byte the same? (even if it translates to something different at run time or in the dataset). If it was for the fact I maintain Halcyon (xBase) code I would slap this all in a DB server. Which also means my port of Accuracer (aidaim.com) is also going to have similar problems. :-(

AM Florian Klämpfl wrote 10 lines
Am 03.10.2018 um 02:28 schrieb Ozz Nixon: > Also, this part of the project is for dBase.com and Visual FoxPro compatibility. So, I cannot go off reservation. Why > exactly is FPC WIN64 making all these changes to primitive types? Because the old x87 style fpu is deprecated for good reasons. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Sven Barth
to Ozz Nixon
Ozz Nixon wrote 7 lines
Thank you for explaining. Since I am needing compatibility at the disk level (binary form)... does anyone know of a unit or some routines to read/write: Comp, Double, Extended byte for byte the same? (even if it translates to something different at run time or in the dataset). If it was for the fact I maintain Halcyon (xBase) code I would slap this all in a DB server. Which also means my port of Accuracer (aidaim.com <http://aidaim.com>) is also going to have similar problems. :-(

You can use FPC's softfpu unit though it is not compiled for all targets currently. But you can copy it from $fpcdir/rtl/inc/softfpu.pp and compiler yourself. Then you can use the type tfloat80 which is essentially Extended on which you can also use the operations defined in the softfpu unit (for convenience you could add a unit with operator overloads).

Please note that Double is always the same on the main platforms and thus doesn't need special handling.

Regards,
Sven

Reply by email

Ozz Nixon
to Sven Barth

Thank you very much sven! This is old code, and uses Extended and Comp, so the xBase files are byte for byte compatible with Visual FoxPro. Most of xBase is ASCII, However, uSoft in their wisdom started storing binary formats when they bought out FoxBase and said, 20 byte ASCII or 4 byte binary - xBase was not designed to be small, but, to be platform, CPU, and programmer friendly. And decades later, we see something Microsoft screwed up, and has dropped support for anyway (dropping FoxPro).

Thanks again!
Ozz

On Sun, Oct 7, 2018 at 8:56 AM Sven Barth via fpc-devel <

Show quoted text 28 lines
wrote: Am 03.10.2018 um 14:23 schrieb Ozz Nixon: Thank you for explaining. Since I am needing compatibility at the disk level (binary form)... does anyone know of a unit or some routines to read/write: Comp, Double, Extended byte for byte the same? (even if it translates to something different at run time or in the dataset). If it was for the fact I maintain Halcyon (xBase) code I would slap this all in a DB server. Which also means my port of Accuracer (aidaim.com) is also going to have similar problems. :-( You can use FPC's softfpu unit though it is not compiled for all targets currently. But you can copy it from $fpcdir/rtl/inc/softfpu.pp and compiler yourself. Then you can use the type tfloat80 which is essentially Extended on which you can also use the operations defined in the softfpu unit (for convenience you could add a unit with operator overloads). Please note that Double is always the same on the main platforms and thus doesn't need special handling. Regards, Sven _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email