This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: libc-alpha at sourceware dot org
- Cc: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Date: Thu, 21 Aug 2014 16:27:41 +0530
- Subject: [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined
- Authentication-results: sourceware.org; auth=none
- References: <1408618663-2281-1-git-send-email-siddhesh at redhat dot com>
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