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] Provide default definition for IS_IN when _LIBC is not defined


This is useful for installed headers and also for headers that are
used in tests without setting IN_MODULE.

        * bits/stdio-lock.h [!_LIBC]: Define IS_IN.
        * include/mqueue.h [!_LIBC]: Likewise.
        * include/stdlib.h [!_LIBC]: Likewise.
        * sysdeps/nptl/bits/stdio-lock.h [!_LIBC]: Likewise.
---
 bits/stdio-lock.h              | 6 +++++-
 include/mqueue.h               | 3 +++
 include/stdlib.h               | 4 ++++
 sysdeps/nptl/bits/stdio-lock.h | 6 +++++-
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/bits/stdio-lock.h b/bits/stdio-lock.h
index f68b13e..937cc89 100644
--- a/bits/stdio-lock.h
+++ b/bits/stdio-lock.h
@@ -19,6 +19,10 @@
 #ifndef _BITS_STDIO_LOCK_H
 #define _BITS_STDIO_LOCK_H 1
 
+#ifndef _LIBC
+# define IS_IN(lib) (0)
+#endif
+
 #include <bits/libc-lock.h>
 
 __libc_lock_define_recursive (typedef, _IO_lock_t)
@@ -44,7 +48,7 @@ __libc_lock_define_recursive (typedef, _IO_lock_t)
 #define _IO_cleanup_region_end(_doit) \
   __libc_cleanup_region_end (_doit)
 
-#if defined _LIBC && IS_IN (libc)
+#if IS_IN (libc)
 # define _IO_acquire_lock(_fp) \
   _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp));      \
   _IO_flockfile (_fp)
diff --git a/include/mqueue.h b/include/mqueue.h
index aba788e..182b7de 100644
--- a/include/mqueue.h
+++ b/include/mqueue.h
@@ -1,4 +1,7 @@
 #include <rt/mqueue.h>
+#ifndef _LIBC
+# define IS_IN(lib) (0)
+#endif
 
 #if IS_IN (librt)
 hidden_proto (mq_timedsend)
diff --git a/include/stdlib.h b/include/stdlib.h
index 734f251..fd80b6d 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,5 +1,9 @@
 #ifndef _STDLIB_H
 
+#ifndef _LIBC
+# define IS_IN(lib) (0)
+#endif
+
 #ifdef __need_malloc_and_calloc
 #define __Need_M_And_C
 #endif
diff --git a/sysdeps/nptl/bits/stdio-lock.h b/sysdeps/nptl/bits/stdio-lock.h
index da392ed..6675a6d 100644
--- a/sysdeps/nptl/bits/stdio-lock.h
+++ b/sysdeps/nptl/bits/stdio-lock.h
@@ -19,6 +19,10 @@
 #ifndef _BITS_STDIO_LOCK_H
 #define _BITS_STDIO_LOCK_H 1
 
+#ifndef _LIBC
+# define IS_IN(lib) (0)
+#endif
+
 #include <bits/libc-lock.h>
 #include <lowlevellock.h>
 
@@ -84,7 +88,7 @@ typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
 #define _IO_cleanup_region_end(_doit) \
   __libc_cleanup_region_end (_doit)
 
-#if defined _LIBC && IS_IN (libc)
+#if IS_IN (libc)
 
 # ifdef __EXCEPTIONS
 #  define _IO_acquire_lock(_fp) \
-- 
1.9.3


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