fix issue #20425#22218
Conversation
|
Thanks for your pull request and interest in making D better, @Emmankoko! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
|
It's preferable not to depend on headers coming from the system in tests. |
Right. |
Illegal instruction on only LDC on windows x64. |
Where does this struct come from? Complex is a fundamental type, anything else is incompatible with gdc/ldc backends. |
in importC, complex never falls under Tcomplex. that was why it never worked. and it is actually compatible with ldc and gdc on ubuntu and Mac, except only windows. |
this is the error message emitted when trying to use it in importC. I did a naive writeln on the type of the complex variables and it was always printing Tstruct. |
I don't see any other mapping except to the fundamental type. Line 2657 in f7f68c9 |
oh alright! so I was using the |
I think I have found something worth looking at. printing the type out gives me |
|
Then Complex is broken on C then. And that should be fixed instead. There is no reason for it to be swapped with a struct. That's not the C ABI type, and passing it across C<->D boundaries won't work. |
Yep! it would require a heavy change which I am hoping to look into. even all the tests that are written are written to obey the struct interface. |
in the type merging for tenary operators, no handler exists yet for real to complex type conversion.
complex in C does nor follow Tcomplex family but a
_Complexstruct with floating types.This PR handles it!
now we are able to use complex in tenary operators.
Windows disabled in testing since windows does not implement the C99 complex system.
@dkorpel @thewilsonator