简体   繁体   中英

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(const 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.

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.

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

I would declare size_t in Delphi as Cardinal :

type
  size_t = Cardinal;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM