[fpc-devel] Convert C++ Array[1] to FPC

Sooky Boo sookyboo at gmail.com
Sat Feb 23 04:59:41 CET 2008


Please help I am unsure how to port from C++ to fpc this code.
The function this must be passed to says that the structure pointer or size
is invalid.

----C++----
typedef struct _SSLPROTOCOL {
    DWORD dwProtocol;
    DWORD dwVersion;
    DWORD dwFlags;
} SSLPROTOCOL, FAR *LPSSLPROTOCOL;

typedef struct _SSLPROTOCOLS {
    DWORD dwCount;
    SSLPROTOCOL ProtocolList[1];   // array of 'count' structures
} SSLPROTOCOLS, FAR *LPSSLPROTOCOLS;

----My Attempt FPC Delphi Mode----

type  SSLPROTOCOL =3D record
    dwProtocol : DWORD;
    dwVersion  : DWORD;
    dwFlags    : DWORD;
end;
_SSLPROTOCOL =3D SSLPROTOCOL;
LPSSLPROTOCOL =3D ^SSLPROTOCOL;

type SSLPROTOCOLS =3D record
     dwCount :DWORD;
     ProtocolList : array[0..0] of SSLPROTOCOL;   // array of 'count'
structures
end;
 _SSLPROTOCOLS =3D SSLPROTOCOLS;
 LPSSLPROTOCOLS =3D ^SSLPROTOCOLS;
 PSSLPROTOCOLS =3D ^SSLPROTOCOLS;
---- ----
Thanks in advance.
If my port seems correct are there any ideas what could be the problem?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freepascal.org/lists/fpc-devel/attachments/20080223/757b9=
c4f/attachment.htm


More information about the fpc-devel mailing list