haskell / haskell/hsc2hs

A version of #type that produces CDouble etc.

Open
#51 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
46
Forks
30
PR merge metrics
No merged PRs in 30d

Description

I use the following modification of `#type` in my project:

```
#define hsc_ctype(t...) \
if ((t)(int)(t)1.4 == (t)1.4) \
hsc_printf ("%s%lu", \
(t)(-1) < (t)0 ? "Int" : "Word", \
(unsigned long)sizeof (t) * 8); \
else \
hsc_printf ("%s", \
sizeof (t) > sizeof (double) ? "LDouble" : \
sizeof (t) == sizeof (double) ? "CDouble" : \
"CFloat");
```

It's similar to `#type`, except it produces `CFloat` and `CDouble` instead of `Float` and `Double`.

Would you be open to adding it to the standard `template-hsc.h`?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.