This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix include files to support non-GNU compilers


On Sat, 7 Mar 2015, Mike Frysinger wrote:

> > --- glibc.orig/math/math.h
> > +++ glibc/math/math.h
> >
> >  #   undef __MATHDECL_1
> > -#   define __MATHDECL_2(type, function,suffix, args, alias) \
> > +#   ifdef __REDIRECT_NTH
> > +#    define __MATHDECL_2(type, function,suffix, args, alias) \
> >    extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \
> >  			     args, alias)
> > +#   else
> > +#    define __MATHDECL_2(type, function,suffix, args, alias) \
> > +		struct __empty__declaration__
> > +#   endif
> >  #   define __MATHDECL_1(type, function,suffix, args) \
> >    __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix))
> 
> i don't think this is correct.  i think you need to bracket the whole thing by 
> an ifdef __REDIRECT_NTH check.  Joseph would know best here though.

Indeed - the normal approach for such conditionals is to use #define when 
redirection isn't supported, but that's not possible in this case where 
the function declarations themselves come from macros.  So anyone with 
such a compiler that doesn't support redirection, and also has long double 
= double in a configuration where wider long double is the current default 
but -mlong-double-64 is also a supported configuration, will have to use 
libnldbl.a to get the versions of the long double functions, under their 
long double names, that are built for the -mlong-double-64 ABI and just 
wrap the double functions.  (I'm not sure libnldbl.a is documented 
anywhere, but that's my understanding of its intended use.)

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]