Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A version of #type that produces CDouble etc. #51

Open
UnkindPartition opened this issue Jun 15, 2020 · 0 comments
Open

A version of #type that produces CDouble etc. #51

UnkindPartition opened this issue Jun 15, 2020 · 0 comments

Comments

@UnkindPartition
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant