gpt4 book ai didi

delphi - 如何检测特定的 Delphi 版本?

转载 作者:行者123 更新时间:2023-12-03 18:09:11 24 4
gpt4 key购买 nike

这与 another Delphi-version question 有关但还是不一样;

我正在寻找一种方法来检测正在编译我的代码的 Delphi 编译器的服务包(或内部版本号)。 jedi.inc很好,但它没有告诉我确切的版本。 (我也不能在其中使用 SUPPORTS_* 定义,因为它们也与版本相关)

我需要这个,因为旧版本中存在一些错误(在本例中为 _ValLong bug in Delphi 2009 ),这些错误已在以后的服务包(本例中为 Delphi 2009 服务包 3)中修复。

目前我的代码中有各种检查,像这样:

{$IFDEF BUG_QC_68123}

但我不能只在我的主包含文件中这样说:

{$IFDEF DELPHI2009_UP}
{$DEFINE BUG_QC_68123}
{$ENDIF}

...因为这会忽略 D2009SP3 和更高版本不再有此错误的事实。

有什么想法吗?

PS:这可能也适用于旧(和新)版本的 Delphi,因此我想任何库和/或组件供应商也会对此感兴趣。

最佳答案

每个版本都有定义的符号:

VER80 - Delphi 1
VER90 - Delphi 2
VER100 - Delphi 3
VER120 - Delphi 4
VER130 - Delphi 5
VER140 - Delphi 6
VER150 - Delphi 7
VER160 - Delphi 8
VER170 - Delphi 2005
VER180 - Delphi 2006
VER180 - Delphi 2007
VER185 - Delphi 2007 (Note: symbol VER185, for example, is used to indicate Delphi 2007 compiler or an earlier version.)
VER190 - Delphi 2007 for .NET
VER200 - C++ Builder 2009
VER210 - Delphi 2010
VER220 - Delphi XE
VER230 - Delphi XE2
VER240 - Delphi XE3
VER250 - Delphi XE4
VER260 - Delphi XE5
VER270 - Delphi XE6
VER280 - Delphi XE7
WIN32 - Indicates that the operating environment is the Win32 API.
LINUX - Indicates that the operating environment is Linux
MSWINDOWS - Indicates that the operating environment is the MS Windows/li]
CONSOLE - Indicates that an application is being compiled as a console application

Source Another source您无法检查不同的内部版本号。

好奇的是,VER10-VER70 是 turbo pascal 版本,而 VER110 是 C++ 构建器版本。

关于delphi - 如何检测特定的 Delphi 版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1103706/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com