[fpc-devel] Problem with open arrays

Peter Popov ppopov at tamu.edu
Tue Aug 15 10:50:58 CEST 2006


Are you saying that a delphi open array is binary compatible to a FPC open  
array?

Peter

Voodoo or not, code should be binary compatible.


On Tue, 15 Aug 2006 09:47:18 +0200, ik <idokan at gmail.com> wrote:

> Hi,
>
> You should use
> PDouble = ^Double;
> procedure SomeProc2(const coords: PDouble; const high: Integer); cdecl;
>
> The reason is simple, it's equal to C's code...
>
> Open arrays are voodoo magic, specially for C\++ compilers..
>
> Ido
>
> On 8/15/06, Peter Popov <ppopov at tamu.edu> wrote:
>> Hi
>> I have the following question: how are open array parameters currently
>> implemented in FPC? The reason I am asking is that I am using DLL
>> functions in C which rely on borland's syntax, that is,
>>
>> void __cdecl SomeProc(const double *coords, const int high) (in
>> C++ Builder)
>>
>> is equivallet to either of the following Delphi constructs:
>>
>> procedure SomeProc1(const coords: array of Double); cdecl;
>>
>> or
>>
>> PDouble = ^Double;
>> procedure SomeProc2(const coords: PDouble; const high: Integer); cdecl;
>>
>> This allows seamless integration of Delphi functions with open arrays  
>> into
>> C++ code and vice versa.
>>
>> I know that fpc does not like open array functions declared with cdecl.  
>> So
>> I am wondering wath is the internal representation and are such  
>> functions
>> binary equivalent to the above C++ example?
>>
>> For more information, see bug:
>> http://www.freepascal.org/mantis/view.php?id=6940
>>
>>
>> Peter Popov
>>
>> --
>> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>> _______________________________________________
>> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



More information about the fpc-devel mailing list