From patchwork Thu Aug 21 10:57:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 381916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 614C41400AB for ; Thu, 21 Aug 2014 21:00:36 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=YSv1IMZwQ7euXgAGf+CMCWRNDz/TkhI vPNHzcG9+ZEbftoB9JEMM80Gt1plSYf4UBodfwm2pZYemCGrmoT2qnZZ+6Sh4RaF zpk1zWStkOvvsgW+xC0ygwKxJOlRcpzI2ZwryVNKnGEggmkh453Xxuvw853dlXuk jfupo2blXvMM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=6mOWHosyO7ztzcfMNcc2PlOpRWg=; b=H1Wrv aRhzsNKRbztbJybB0+34Sl+ds7/FzWp//Gp918V5Ans6IxRdAc1e8kL/Nsd17cID HC7nFv/OarxxVS0w8Uy2BFOsvt8XgvXDQg1EPaIEgN2PB8k5MmJAs2IvSmCbcsRb TJMp7E73tP7vr6CR8MqkcjrT3copGedkRyMOTQ= Received: (qmail 18072 invoked by alias); 21 Aug 2014 10:58:29 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 18025 invoked by uid 89); 21 Aug 2014 10:58:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_50, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Cc: Siddhesh Poyarekar Subject: [PATCH 17/19] Provide default definition for IS_IN when _LIBC is not defined Date: Thu, 21 Aug 2014 16:27:41 +0530 Message-Id: <1408618663-2281-18-git-send-email-siddhesh@redhat.com> In-Reply-To: <1408618663-2281-1-git-send-email-siddhesh@redhat.com> References: <1408618663-2281-1-git-send-email-siddhesh@redhat.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 __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 +#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 #include @@ -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) \