[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 = record
    dwProtocol : DWORD;
    dwVersion  : DWORD;
    dwFlags    : DWORD;
end;
_SSLPROTOCOL = SSLPROTOCOL;
LPSSLPROTOCOL = ^SSLPROTOCOL;

type SSLPROTOCOLS = record
     dwCount :DWORD;
     ProtocolList : array[0..0] of SSLPROTOCOL;   // array of 'count'
structures
end;
 _SSLPROTOCOLS = SSLPROTOCOLS;
 LPSSLPROTOCOLS = ^SSLPROTOCOLS;
 PSSLPROTOCOLS = ^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/pipermail/fpc-devel/attachments/20080223/757b9c4f/attachment.html>


More information about the fpc-devel mailing list