Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could a D DLL work within SAS?

Tags:

dll

d

sas

I've been reading the D Cookbook and near the beginning there's the following sentence:

D is binary compatible with C, but not source compatible.

SAS allows users to define and call C functions from within SAS. But I'm wondering, would it'd also be possible to do this from D?

I found Adam Ruppe's answer to create a DLL here, and I tried using that to create the DLL example from the SAS documentation; however, whenever I go to call it, the dll gets loaded, and then SAS proceeds to crash (without any crash log that I can find).

like image 327
charles Avatar asked Sep 16 '14 12:09

charles


1 Answers

Yes, you can write DLLs in D which use or implement a C API.

You have to make sure that the function signatures and calling conventions match. In the page you linked, the calling convention is indicated as stdcall, so your D functions need to be annotated with extern(Windows) or extern(System).

like image 108
Vladimir Panteleev Avatar answered Nov 15 '22 09:11

Vladimir Panteleev