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]

[PATCH 17/19 v2] Use IS_IN only when _LIBC is defined


Hi,

Here's an updated patch that fixes conformtest failures due to IS_IN.
The conformtest tests ideally ought to include the headers to be
installed, but cannot do so currently and hence does its tests using
headers in include/.  Due to this it fails because it doesn't include
any of the libc headers and consequently does not have a definition
for IS_IN.  This patch guards instances in such headers with #ifdef
_LIBC.

There are a couple of installed headers that have this problem too -
stdio-lock.h and libc-lock.h.  Both headers however never get used in
normal applications since they're only included when _IO_MTSAFE_IO is
defined, which it isn't in the normal case.  I haven't tried to fix
these headers because it won't make a difference and ideally they
ought to be removed.  I intend to do that as a separate patch after
2.20 is released.

I have also verified that this does not result in any change in
generated code on x86_64.

Siddhesh

From 00592dd98e35bc9771d17114f9c1da62368f8488 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Mon, 25 Aug 2014 15:58:46 +0530
Subject: [PATCH] Use IS_IN when _LIBC is defined

This change is only useful for the conformance tests since the headers
changed are not installed.  The conformance tests fail due to IS_IN
not being defined, so wrap it with a check to make sure that _LIBC is
defined.

	* include/bits/stdlib-float.h: Use IS_IN only if _LIBC is
	defined.
	* include/mqueue.h: Likewise.
	* include/stdlib.h: Likewise.
---
 include/bits/stdlib-float.h |  6 ++++--
 include/mqueue.h            |  4 +++-
 include/stdlib.h            | 10 ++++++----
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/include/bits/stdlib-float.h b/include/bits/stdlib-float.h
index 3466314..debb364 100644
--- a/include/bits/stdlib-float.h
+++ b/include/bits/stdlib-float.h
@@ -1,4 +1,6 @@
 /* No floating-point inline functions in rtld.  */
-#if !IS_IN (rtld)
-# include <stdlib/bits/stdlib-float.h>
+#ifdef _LIBC
+# if !IS_IN (rtld)
+#  include <stdlib/bits/stdlib-float.h>
+# endif
 #endif
diff --git a/include/mqueue.h b/include/mqueue.h
index aba788e..e40f3cb 100644
--- a/include/mqueue.h
+++ b/include/mqueue.h
@@ -1,7 +1,9 @@
 #include <rt/mqueue.h>
 
-#if IS_IN (librt)
+#ifdef _LIBC
+# if IS_IN (librt)
 hidden_proto (mq_timedsend)
 hidden_proto (mq_timedreceive)
 hidden_proto (mq_setattr)
+# endif
 #endif
diff --git a/include/stdlib.h b/include/stdlib.h
index 734f251..a884b51 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -226,11 +226,13 @@ extern int __qfcvt_r (long double __value, int __ndigit,
 		      int *__restrict __decpt, int *__restrict __sign,
 		      char *__restrict __buf, size_t __len);
 
-# if IS_IN (libc)
-#  undef MB_CUR_MAX
-#  define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
+# if defined _LIBC
+#  if IS_IN (libc)
+#   undef MB_CUR_MAX
+#   define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
 
-# define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d)
+#   define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d)
+#  endif
 # endif
 
 extern void *__default_morecore (ptrdiff_t) __THROW;
-- 
1.9.3

Attachment: pgp8YYtWTyigi.pgp
Description: PGP signature


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