Can D interface with Free Pascal?

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 28 17:47:11 PST 2016


On Thursday, 28 January 2016 at 19:49:22 UTC, Taylor Hillegeist 
wrote:
> On Thursday, 28 January 2016 at 19:33:22 UTC, bearophile wrote:
>> FreeSlave:
>>
>> On Thursday, 28 January 2016 at 08:15:38 UTC, FreeSlave wrote:
>>> Not directly. You can declare cdecl function on Free Pascal 
>>> side and call it as extern(C).
>>
>> What about extern(Pascal)?
>> https://dlang.org/spec/attribute.html#linkage
>>
>> Bye,
>> bearophile
>
> Cool!, I did find this little gem. but still havent gotten a 
> hello world to work. I need to figure out which libraries i 
> need to include for fpc dependencies.

AFAIK, FreePascal does not use the pascal calling convention by 
default. If this page [1] is correct, the default convention is 
'register' and can be changed to something else (like pascal or 
cdecl) with a command-line switch [2].

[1] http://www.freepascal.org/docs-html/prog/progse22.html
[2] http://www.freepascal.org/docs-html/prog/progsu87.html


More information about the Digitalmars-d-learn mailing list