Detecting whether gcc supports complex types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I need to figure out whether a given gcc (or other compiler)
version supports C99 complex types ("_Complex float" and such).
The standard says that a compiler providing C99 defines
__STDC_VERSION__ and - if it has no complex type support - defines
__STDC_NO_COMPLEX__ too.  So I came up with the following test:

#if !defined __STDC_NO_COMPLEX__ && defined __STDC_VERSION__ && (__STDC_VERSION__ >= 199901L)
  /* complex types available
#endif

However, this does not work with a plain gcc call, i.e. gcc does
not define __STDC_VERSION__ (or __STDC__) if not told explicitly
which standard to use, e.g. with --std=c99.  What's the proper way
to detect complex type support (preferrably with not just gcc but
any standard conforming compiler)?

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux