Check for a long, long, unsigned length

How can I check the preprocessor directive if the type unsigned long longis available in the current build environment?

I tried to check

#if __STDC_VERSION__ >= 199901L
    /* Available */
#else
    /* Not available */
#endif

but compiling with gcc and at least without the -std=-compiler argument results in "Not avaibalble" (but will work).

Is there a better macro to verify that it at least works with standard C99 compilers and with GCC without -std=C99?

+4
source share
2 answers

Although these are not the most elegant solutions, my first instinct would be to check for a character ULLONG_MAXin the title limits.h.

, unsigned long long int . , , , - , , .

+1

, ? ? , , unsigned long long, , .

, C99 - , , C99 unsigned long long.

+3

All Articles