On 12/14/11 09:59, Danek Duvall wrote:
Rich Burridge wrote:

   http://jurassic.us.oracle.com/~richb/6881496-v1/

I'd love to know who put that #if in there in the first place; I don't know
how it ever would have worked.  First, __sun__ isn't autodefined, but __sun
is, and __svr4__ isn't, but __SVR4 is, and only on SPARC.

Actually, cc has always defined __SVR4 on x86 too, the man page had a bug incorrectly claiming it didn't (6945181, fixed in 12.2):

alanc@also:/tmp [10:43am - 129] touch test.c
alanc@also:/tmp [10:43am - 130] cc -### -c test.c
### cc: Note: NLSPATH = /usr/share/locale/%L/LC_MESSAGES/%N.cat:/ws/onnv-tools/SUNWspro/sunstudio12.1-20110423/prod/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/ws/onnv-tools/SUNWspro/sunstudio12.1-20110423/prod/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
###     command line files and options (expanded):
### -# -c test.c
/ws/onnv-tools/SUNWspro/sunstudio12.1-20110423/prod/bin/acomp -Qy -Xa -xc99=%all,no%lib -i test.c -D__SunOS_5_11 -D__SUNPRO_C=0x5100 -D__unix -D__SVR4 -D__sun -D__SunOS -D__i386 -D__BUILTIN_VA_ARG_INCR -D__C99FEATURES__ -D__PRAGMA_REDEFINE_EXTNAME -Dunix -Dsun -Di386 -D__RESTRICT -D__FLT_EVAL_METHOD__=-1 -D__SUN_PREFETCH -I/ws/onnv-tools/SUNWspro/sunstudio12.1-20110423/prod/include/cc -fsimple=0 -m32 -fparam_ir -xF=%none -xdbggen=no%stabs+dwarf2+usedonly -xldscope=global "-g/ws/onnv-tools/SUNWspro/sunstudio12.1-20110423/prod/bin/cc -c " -destination_ir=yabe -y-fbe -y/ws/onnv-tools/SUNWspro/sunstudio12.1-20110423/prod/bin/fbe -y-verbose -y-comdat -y-xarch=generic -y-xthreadvar=no%dynamic -y-o -ytest.o


The versions with trailing underscores are defined by gcc, since that's the
standard form they use on all platforms, but gcc on Solaris also defines the
ones without trailing underscores that are needed for the system headers to
work properly:

% gcc -dM -E test.c | egrep -i 'sun|svr4' | grep -v attr
#define _SUNOS_VTOC_16
#define __SVR4 1
#define __sun 1
#define sun 1
#define __sun__ 1
#define __svr4__ 1


I'd also ping Roger and Lee to see if they have any opinions on this
particular fix, as well as a long-term solution built-in to the Solaris
header files.

6618678 GNU glibc inttypes.h compatibility header file

--
        -Alan Coopersmith-        [email protected]
         Oracle Solaris Platform Engineering: X Window System

_______________________________________________
userland-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/userland-discuss

Reply via email to