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: bz#15007: Fix mismatch of guards for qecvt


On Wednesday, April 03, 2013 14:55:19 Roland McGrath wrote:
> The use of #ifdef __USE_MISC nested inside another conditional is not
> right.  The whole purpose of the __USE_* macros is that you test them
> simply and individually.  So please first clean up stdlib.h to use the
> conditionals simply.  Then make stdlib-ldbl.h match the corrected
> state.

Is this what you had in mind for stdlib.h?

Andreas

2013-04-04  Andreas Jaeger  <aj@suse.de>

	* stdlib/stdlib.h: Do not use nested defines for qecvt et al.

diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 4b83944..3b2561a 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -823,9 +823,10 @@ extern char *fcvt (double __value, int __ndigit, 
int *__restrict __decpt,
    be written to BUF.  */
 extern char *gcvt (double __value, int __ndigit, char *__buf)
      __THROW __nonnull ((3)) __wur;
+#endif
 
-
-# ifdef __USE_MISC
+#if ((defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8)	\
+     || defined __USE_SVID) && defined __USE_MISC
 /* Long double versions of above functions.  */
 extern char *qecvt (long double __value, int __ndigit,
 		    int *__restrict __decpt, int *__restrict __sign)
@@ -854,8 +855,7 @@ extern int qfcvt_r (long double __value, int 
__ndigit,
 		    int *__restrict __decpt, int *__restrict __sign,
 		    char *__restrict __buf, size_t __len)
      __THROW __nonnull ((3, 4, 5));
-# endif	/* misc */
-#endif	/* use MISC || use X/Open Unix */
+#endif
 
 
 __BEGIN_NAMESPACE_STD

-- 
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


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