I'm working on improving Sun Studio support in one of the open-source
packages we ship in OpenSolaris & Solaris.

Right now it has #ifdef's such as:

#if defined(__GNUC__)
#  define INLINE __inline__
#elif defined(__MSC__)
#  define INLINE __inline
#elif defined(_MSC_VER)
#  define INLINE __inline
#elif defined(__ICL)
#  define INLINE __inline
#elif defined(__INTEL_COMPILER)
#  define INLINE inline
#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
#  define INLINE __inline
#else
#  define INLINE
#endif

#if defined(__VMS)
# define __FUNCTION__ "VMS$NL:"
#elif __STDC_VERSION__ < 199901L
# if ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \
      (!defined(_MSC_VER) || _MSC_VER < 1300)
#  define __FUNCTION__ "<unknown>"
# endif
#endif

What are the right checks for enabling inline & __func__ in Sun Studio?
I would have thought checking for __STDC_VERSION__ >= 199901L would be
enough, but it appears that the default value of __STDC_VERSION__ in
Studio 12 is only 199901L, despite the documentation saying that
-xc99=all,no_lib is default (and giving no information I could see
on what that means for __STDC_VERSION__).

Do I just need to add something like:

#elif defined(__SUNPRO_C) && (__SUNPRO_C > 0x0550)

and if so is there any list of what versions support what features
without having to manually compare the last 10 versions worth of compiler
docs on docs.sun.com?

-- 
        -Alan Coopersmith-           alan.coopersmith at sun.com
         Sun Microsystems, Inc. - X Window System Engineering


Reply via email to