在Delphi 3中重现UInt64 [英] Reproduce UInt64 in Delphi 3

查看:72
本文介绍了在Delphi 3中重现UInt64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图为Delphi 3编译器重新定义 UInt64 类型。
这样做的原因是我不使用 system.pas sysinit.pas
所以我只有本地变量类型,例如 Integer Cardinal 等。
我怎么能重现 UInt64

I am trying to "redefine" the UInt64 type for the Delphi 3 compiler. The reason for that is that I do not use system.pas nor sysinit.pas. So I only have native var types like Integer, Cardinal etc. How could I reproduce the UInt64?

推荐答案

Delphi 7没有未签名的64位整数类型。您可以从其Windows.pas中看出,其中 ULARGE_INTEGER 被定义为包含两个无符号32位整数或一个有符号64位整数的变体记录,这几乎没有从某种意义上讲,直到您意识到这确实是最糟糕的选择,如果您确实需要与其他系统中的无符号64位整数类型二进制兼容的东西。

Delphi 7 doesn't have an unsigned 64-bit integer type. You can tell from its Windows.pas, where ULARGE_INTEGER is defined as a variant record holding either two unsigned 32-bit integers, or one signed 64-bit integer, which makes little sense, until you realise that that's simply the least bad alternative if you really need something that's binary compatible with unsigned 64-bit integer types from another system.

无符号64位位整数类型需要编译器支持,而编译器缺乏这种支持,因此您无法创建它。较新的Delphi版本确实支持编译器,因此您可以考虑进行升级。

An unsigned 64-bit integer type requires compiler support, which your compiler lacks, so you cannot create it, sorry. Newer Delphi versions do have compiler support for it, so you might consider upgrading.

Delphi 3更糟糕,它没有任何64位整数类型,甚至是签名的。在Delphi 4中添加了 Int64 ,这可能足以避免需要有效的64位无符号整数类型,但是如果您陷于Delphi 3中,则不会

Delphi 3 is even worse, it doesn't have any 64-bit integer type, not even a signed one. Int64 was added in Delphi 4, and that might be sufficient to avoid the need for a working 64-bit unsigned integer type, but if you're stuck on Delphi 3, not even that will work.

作为旁注,似乎与这个答案相反,Delphi 7确实具有 UInt64 类型。但是,这极具误导性。在此版本中,它是一个 signed 64位整数类型,就像 Int64

As a side note, seemingly contrary to this answer, Delphi 7 does have a UInt64 type. However, this is highly misleading. It's a signed 64-bit integer type in this version, just like Int64.

这篇关于在Delphi 3中重现UInt64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆