[fpc-devel] Problem with open arrays

Peter Popov ppopov at tamu.edu
Tue Aug 15 13:09:22 CEST 2006


Well, what I mean is that C++ Builder specifically specifies how Delphi  
(Object Pascal) open array parameters should be viewed from C++. If this  
is the current FPC standard this is good. On the other hand FPC does not  
allow cdecl functions with open arrays (see  
http://www.freepascal.org/mantis/view.php?id=6940), which is exactly what  
you would need to interface with a C++ library.

Peter

On Tue, 15 Aug 2006 11:12:08 +0200, Jonas Maebe  
<jonas.maebe at elis.ugent.be> wrote:

>
> On 15 Aug 2006, at 09:13, Peter Popov wrote:
>
>> 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;
>
> It's the same in FPC. However as you say, that's "currently". You should  
> not rely on internal implementations, it's a recipe for disaster.
>
>
> Jonas
>
> _______________________________________________
> 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