Discussion:
3.0.4 and Windows 64
Add Reply
Ozz Nixon
2018-09-30 15:17:48 UTC
Reply
Permalink
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
Sven Barth via fpc-devel
2018-09-30 17:08:45 UTC
Reply
Permalink
Post by 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.
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
Int64 := trunc(variant);
Int64 := trunc(Extended(variant));
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
Ozz Nixon
2018-09-30 17:17:02 UTC
Reply
Permalink
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 <
Post by Sven Barth via fpc-devel
Post by 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.
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
Int64 := trunc(variant);
Int64 := trunc(Extended(variant));
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
Post by Ozz Nixon
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Ozz Nixon
2018-10-03 00:28:40 UTC
Reply
Permalink
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?
Post by Ozz Nixon
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
Florian Klämpfl
2018-10-03 07:28:51 UTC
Reply
Permalink
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 - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-deve
Ozz Nixon
2018-10-03 12:23:27 UTC
Reply
Permalink
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. :-(
Post by Ozz Nixon
Post by Ozz Nixon
Also, this part of the project is for dBase.com and Visual FoxPro
compatibility. So, I cannot go off reservation. Why
Post by Ozz Nixon
exactly is FPC WIN64 making all these changes to primitive types?
Because the old x87 style fpu is deprecated for good reasons.
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Sven Barth via fpc-devel
2018-10-07 12:55:38 UTC
Reply
Permalink
Post by 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
<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
Ozz Nixon
2018-10-07 13:39:04 UTC
Reply
Permalink
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 <
Post by 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
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Loading...