delphi-2010 - E2251 对“StrLen”SysUtils.pas(7863) 的模糊重载调用:
问题描述
我的代码如下。使用 Windows 10,Delphi 2010。SysUtils.pas
文件中的错误:
[DCC Error] OTFEFreeOTFE_U.pas(3199): E2251 Ambiguous overloaded call to 'StrLen'
SysUtils.pas(7863): Related method: function StrLen(const PAnsiChar): Cardinal;
SysUtils.pas(7892): Related method: function StrLen(const PWideChar): Cardinal;
代码片段如下:
function StrLen(const Str: PAnsiChar): Cardinal;
asm
{Check the first byte}
cmp byte ptr [eax], 0
je @ZeroLength
{Get the negative of the string start in edx}
mov edx, eax
neg edx
{Word align}
add eax, 1
and eax, -2
@ScanLoop:
mov cx, [eax]
add eax, 2
test cl, ch
jnz @ScanLoop
test cl, cl
jz @ReturnLess2
test ch, ch
jnz @ScanLoop
lea eax, [eax + edx - 1]
ret
@ReturnLess2:
lea eax, [eax + edx - 2]
ret
@ZeroLength:
xor eax, eax
end;
解决方案
推荐阅读
- c# - .NET Core WCF 捕获肥皂异常
- python - 将列表按位置重新分组为分位数
- .net - 无法读取配置部分“system.web.extensions”,因为它缺少部分声明(发生在特定的代码分支上)
- javascript - 使用 Ajax 更改单击按钮的状态
- sql - 我需要列表中以“b”开头的序列,下一个值是 SQL Server 查询中的“e”,并消除所有其他
- angular6 - 如何使用回调函数和常规函数返回值
- flynn - 如果发现令牌未知,如何将新主机添加到 flynn?
- python - 如何从不带参数 discord.py 的命令中获取服务器对象
- javascript - 可以将繁琐的连接和请求事件侦听器放在 Node.js 的单独模块中吗?
- python-3.x - pytesseract 无法识别图像中的字符