Re: Small structs: interfacing with C++ potentially broken

2021-12-20 Thread Jan via Digitalmars-d-learn
On Monday, 20 December 2021 at 11:58:03 UTC, Tim wrote: On Monday, 20 December 2021 at 10:24:00 UTC, Jan wrote: Is this a known issue, or is there a way to instruct DMD to use a specific calling convention for a given type? This looks like a bug. It seems to work without constructor in C++, b

Re: Small structs: interfacing with C++ potentially broken

2021-12-20 Thread Tejas via Digitalmars-d-learn
On Monday, 20 December 2021 at 11:58:03 UTC, Tim wrote: On Monday, 20 December 2021 at 10:24:00 UTC, Jan wrote: Is this a known issue, or is there a way to instruct DMD to use a specific calling convention for a given type? This looks like a bug. It seems to work without constructor in C++, b

Re: Small structs: interfacing with C++ potentially broken

2021-12-20 Thread Tim via Digitalmars-d-learn
On Monday, 20 December 2021 at 10:24:00 UTC, Jan wrote: Is this a known issue, or is there a way to instruct DMD to use a specific calling convention for a given type? This looks like a bug. It seems to work without constructor in C++, but still crashes with a constructor in D. It also seems t

Small structs: interfacing with C++ potentially broken

2021-12-20 Thread Jan via Digitalmars-d-learn
I have a small struct that I'm trying to interface to. C++ ```cpp struct __declspec(dllexport) SmallStruct { float value = 0; //float value2 = 0; //float value3 = 0; SmallStruct(float val) : value(val) { } static SmallStruct GetValue(float input) { return SmallStruct(inp