Exporting methods from Island

(kwonus) #1

Are all global methods in Island (on Windows) automatically exported? And if not, how are exports defined? (DllExport doesn’t make sense as it’s a static library) When exchanging strings between between Island and C, what does an inbound char_w array look like in Island/Oxygene? And an inbound char array? Similarly what does an outbound string look like in the receiving C program?

Finally what is the default calling convention (on Windows) for calling an Island/Oxygene method?

(Carlo Kok) #2

Global methods in a static library are exported but mangled. You can use symbolname attributes to override the name for c interop. For talking to c the best option is to use ^ ansichar. If you do pass a string it will look like how we encode a string exactly, as a pointer to a struct with 3 fields. A vmt pointer a length intptr and a char field that refers to the first char.

The default calling convention is cdecl unless you override it with a callingconvention attribute