ImportC and #include files
jmh530
john.michael.hall at gmail.com
Mon May 8 15:34:32 UTC 2023
On Monday, 8 May 2023 at 14:36:10 UTC, bachmeier wrote:
> On Monday, 8 May 2023 at 13:22:44 UTC, jmh530 wrote:
>
>> I was able to get nlopt's tutorial example working with
>> importC. I can write a bit more up later.
>>
>> The only thing that I wasn't able to get working was using the
>> HUGE_VAL macro in math.h. Would anyone else be able to confirm
>> if they are able to get that working?
>
> In the .c file or the .d file? If in the .d file, you'll need
> to use core.stdc.math.HUGE_VAL. If in the .c file, it's a bug.
I was just trying out using it directly in the .d file without
importing core.stdc.math. I am able to use HUGE_VAL in the .c
file (so not a bug that way). The c math header should be setting
HUGE_VAL based on a preprocessor macro (on WSL I assume it should
run automatically). I was assuming that importC would re-write
that to an enum that I could use directly in the D file, but the
spec says that it doesn't support all uses of metaprogramming
with these. You think that's what I'm running into?
More information about the Digitalmars-d
mailing list