开发者

Latest subversion sources of Indy 10 won't build in Delphi XE

Just grabbed the latest sources from subversion, for Indy 10, and I get this error:

[DCC Error] IdWinsock2.pas(2421): E2003 Undeclared identifier: 'SIZE_T'

The code at IdWinsock2.pas line 2421 is:

  {$EXTERNALSYM WSACMSGHDR}
  WSACMSGHDR = record
    cmsg_len: SIZE_T;  // error.
    cmsg_level: Integer;
    cmsg_type: Integer;
    { followed by UCHAR cmsg_data[] }
  end;

This seems a pretty basic failure. I sort of expected the Indy sources to build in the latest Delphi, out of the box. It must be something wrong on my end, but I don't know what.

It looks like the stable tagged sources indy10\Indy10\tags\Indy 10.5.7 works fine. It's just Trunk that's fried.

Update: To try to fix it, I added this:

type
  SIZE_T = Cardinal;

Then it dies later on in the same IdWinsock2.pas, at 6238:

function WSA_CMSGHDR_ALIGN(cons开发者_运维问答t Alength: SIZE_T): SIZE_T;

And it's external-sym defined at line 3218 differently:

  function WSA_CMSGHDR_ALIGN(const Alength: PtrUInt): PtrUInt;

My best guess is someone is in mid-hack on an attempt to make this work in a 64 bit FPC and hasn't noticed that they broke ability to compile it in shipping Delphi.


SIZE_T support is currently in progress. New code got checked in before it was ready, but it should be fixed shortly.


Warren, see How to fix 'undeclared identifier' error in Indy?

This addresses that exact question, and has some notes about the versions of Delphi used to compile.


I would declare size_t in Delphi as Cardinal:

type
  size_t = Cardinal;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜