From patchwork Fri Mar 2 18:59:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 130570 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1600838lja; Fri, 2 Mar 2018 10:59:48 -0800 (PST) X-Google-Smtp-Source: AG47ELvEnp1hR7W9OCcfjIQPAw4rivG2Xxa5FwAKiEk3wEoCgqcxi9qmHlf+jshV+v0WiiGpDvyN X-Received: by 10.98.220.207 with SMTP id c76mr6534112pfl.159.1520017188122; Fri, 02 Mar 2018 10:59:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520017188; cv=none; d=google.com; s=arc-20160816; b=HpVQc6AQwZymoQVCk3MsZ8mlHyIOmr56bEZxVxSTj+gfaaPwl0h/n3/KRZmY6Hzvt9 Q52XiuHNGRNs+qjcXNxoeA/Wzl/Fx0kglKsvhtY97CzcY55K2q5XECBt7340Mk+scwmB L1CJHrkH5FAw4HhRqwuNBqX0/kBHLoCwfnre5yKVz27EROBaiCKBsMWT9w9LjkW3Qgpx 9uTFkG4raf/9MBgMeYH8PNdEg0XoiI1htA6wbySPUyPzQEUesEbXzigz335qhcPeOHoJ yBTb4ygiUy28rQ+Wy+teHl50Cko7IQqDq2CLQTI5PqL0hs+kvn+sJxtaWqt3VBX/T4n+ Gi/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=lYzYTl5pPXgcQ+gTlVNPBLn6V2RUTgrH54LXtniaASo=; b=T1SCCS5NOy3rRw7Aukqu2pzInprAeH/J4WAXOQ6X3fpvPzaDU7+UheRU9Bg/lOqlfI TFwf7GL5PbFfZfNVjxBDWkPvuMHqdcR/h6u73551G6Vg6AOAdYwYsS1Q/4jiI5syEJk5 O4T8NmDH+Hk8qyEoGin/pfeOb+BhP67yDZVEtD5pKbzxPu+aGO1Iu7M98cKcyA0zscJJ 8fQ6GtQa8+Pjnq32g/PQQ+HptWhLHKvc7DJYH+Tzumyet2Lw8YSByMOhC27q0k2EOsDe O5WkidbbhRQ85JmD8RnTwNvUhooklGIhsZngyu0PsSXhYOSraC5axmn/ICW5QowWrTU2 HPIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=LgIBMO9I; spf=pass (google.com: domain of libc-alpha-return-90736-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-90736-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id n4si4341708pgt.712.2018.03.02.10.59.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Mar 2018 10:59:48 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-90736-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=LgIBMO9I; spf=pass (google.com: domain of libc-alpha-return-90736-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-90736-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=vlqdo2Q97B+XLlIoLbdTjP68tLUEc7J 4zNDEhjiKmaK7pXKK71nuDaYc8/7UC+TBMTyuXXe0z1XjV8aZEFGd1i9FSkvXOJt dtLYQzZIBzfXx7KyYJNIJS65D7b3su6RMQgJAv8mWHGsI7jywdwz5YC1qrF0lD8k qnokm0QEwMBM= 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:subject:date:message-id:in-reply-to :references; s=default; bh=ILxqknr4FOf+CJpZu2mQFqvU4yc=; b=LgIBM O9IOGe8Y1Nlhz+CGFzjX2r8XpWM4wjBS/FRpgWxMgZmTU8SIlWqRmai8lVi8EqKs cfQ77rbs3w0k82OysXAiH1Bi74vpoN+vd34J8IFiRsYVgy9r1CbL3SN5BTclKpH1 f2yoydUc9liQMYvbs6xxuJ/dx4wEiQVar0I89s= Received: (qmail 96650 invoked by alias); 2 Mar 2018 18:59:38 -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 96639 invoked by uid 89); 2 Mar 2018 18:59:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt0-f196.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=lYzYTl5pPXgcQ+gTlVNPBLn6V2RUTgrH54LXtniaASo=; b=REqR46LalaSnDzKhVa/SCgxhSrWfpLdRT8z9xCk2xdJIPjFSP3AXXiflxeU6Dv2fef iDfVtCxdqpagk+ZgYfBK5KheRDup3O20Ruy457V9GNk/QXQxwXy8JvuOtcmMSC3QfaoH Xdh//+HmMazKvCtqzpwDtWBWLBG0HmcXA0RUzl9O98RK6YGVKbWtO1NfG8tRLzlCzDpc LKLO1g753uKUYHC36D7+xlKt3EnJWaWdN2khyi2b175Hyao1Fx3imO565bX2DYl0Ng14 YuG9Y60rRo+3Bwh+A9PpJ/YHbn1wR6tEYryBuwpt0ElvjqMKZNAwTTMk+taWFjS6BAAT HKdg== X-Gm-Message-State: AElRT7Gj4kpjaEx+L35g1Cd9SIXyQyxAI4LTH+oKxmTjBdPAyJehGQty R7BEv796CL+Loe/RoLNi2nNJ7WCEhaU= X-Received: by 10.237.57.106 with SMTP id l97mr10036428qte.198.1520017173281; Fri, 02 Mar 2018 10:59:33 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/7] Define _DIRENT_MATCHES_DIRENT64 regardless Date: Fri, 2 Mar 2018 15:59:20 -0300 Message-Id: <1520017165-15830-2-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1520017165-15830-1-git-send-email-adhemerval.zanella@linaro.org> References: <1520017165-15830-1-git-send-email-adhemerval.zanella@linaro.org> This patch defines _DIRENT_MATCHES_DIRENT64 to either 0 or 1 and adjust its usage from checking its definition to its value. Checked on a build for major Linux abis. * bits/dirent.h (__INO_T_MATCHES_INO64_T): Define regardless whether __INO_T_MATCHES_INO64_T is defined. * sysdeps/unix/sysv/linux/bits/dirent.h: Likewise. * dirent/alphasort.c: Check _DIRENT_MATCHES_DIRENT64 value instead of definition. * dirent/alphasort64.c: Likewise. * dirent/scandir.c: Likewise. * dirent/scandir64-tail.c: Likewise. * dirent/scandir64.c: Likewise. * dirent/scandirat.c: Likewise. * dirent/scandirat64.c: Likewise. * dirent/versionsort.c: Likewise. * dirent/versionsort64.c: Likewise. * include/dirent.h: Likewise. --- ChangeLog | 15 +++++++++++++++ bits/dirent.h | 2 ++ dirent/alphasort.c | 2 +- dirent/alphasort64.c | 2 +- dirent/scandir.c | 2 +- dirent/scandir64-tail.c | 2 +- dirent/scandir64.c | 2 +- dirent/scandirat.c | 2 +- dirent/scandirat64.c | 2 +- dirent/versionsort.c | 2 +- dirent/versionsort64.c | 2 +- include/dirent.h | 2 +- sysdeps/unix/sysv/linux/bits/dirent.h | 2 ++ 13 files changed, 29 insertions(+), 10 deletions(-) -- 2.7.4 diff --git a/bits/dirent.h b/bits/dirent.h index 8c38b8c..d775540 100644 --- a/bits/dirent.h +++ b/bits/dirent.h @@ -56,4 +56,6 @@ struct dirent64 #ifdef __INO_T_MATCHES_INO64_T /* Inform libc code that these two types are effectively identical. */ # define _DIRENT_MATCHES_DIRENT64 1 +#else +# define _DIRENT_MATCHES_DIRENT64 0 #endif diff --git a/dirent/alphasort.c b/dirent/alphasort.c index 8d3b939..a6cd151 100644 --- a/dirent/alphasort.c +++ b/dirent/alphasort.c @@ -32,6 +32,6 @@ alphasort (const struct dirent **a, const struct dirent **b) return strcoll ((*a)->d_name, (*b)->d_name); } -#ifdef _DIRENT_MATCHES_DIRENT64 +#if _DIRENT_MATCHES_DIRENT64 weak_alias (alphasort, alphasort64) #endif diff --git a/dirent/alphasort64.c b/dirent/alphasort64.c index deb1921..3a47a97 100644 --- a/dirent/alphasort64.c +++ b/dirent/alphasort64.c @@ -19,7 +19,7 @@ #include /* alphasort.c defines alphasort64 as an alias if _DIRENT_MATCHES_DIRENT64. */ -#ifndef _DIRENT_MATCHES_DIRENT64 +#if !_DIRENT_MATCHES_DIRENT64 int alphasort64 (const struct dirent64 **a, const struct dirent64 **b) diff --git a/dirent/scandir.c b/dirent/scandir.c index 977d645..b24e157 100644 --- a/dirent/scandir.c +++ b/dirent/scandir.c @@ -40,6 +40,6 @@ SCANDIR (const char *dir, return SCANDIR_TAIL (__opendir (dir), namelist, select, cmp); } -#ifdef _DIRENT_MATCHES_DIRENT64 +#if _DIRENT_MATCHES_DIRENT64 weak_alias (scandir, scandir64) #endif diff --git a/dirent/scandir64-tail.c b/dirent/scandir64-tail.c index 684088c..8d5cc07 100644 --- a/dirent/scandir64-tail.c +++ b/dirent/scandir64-tail.c @@ -18,7 +18,7 @@ #include -#ifndef _DIRENT_MATCHES_DIRENT64 +#if !_DIRENT_MATCHES_DIRENT64 # define SCANDIR_TAIL __scandir64_tail # define READDIR __readdir64 # define DIRENT_TYPE struct dirent64 diff --git a/dirent/scandir64.c b/dirent/scandir64.c index 7e666b0..0c63fa9 100644 --- a/dirent/scandir64.c +++ b/dirent/scandir64.c @@ -18,7 +18,7 @@ #include /* scandir.c defines scandir64 as an alias if _DIRENT_MATCHES_DIRENT64. */ -#ifndef _DIRENT_MATCHES_DIRENT64 +#if !_DIRENT_MATCHES_DIRENT64 # define SCANDIR scandir64 # define SCANDIR_TAIL __scandir64_tail diff --git a/dirent/scandirat.c b/dirent/scandirat.c index 3f63f4d..96a1b0e 100644 --- a/dirent/scandirat.c +++ b/dirent/scandirat.c @@ -44,6 +44,6 @@ libc_hidden_def (SCANDIRAT) weak_alias (__scandirat, scandirat) #endif -#ifdef _DIRENT_MATCHES_DIRENT64 +#if _DIRENT_MATCHES_DIRENT64 weak_alias (scandirat, scandirat64) #endif diff --git a/dirent/scandirat64.c b/dirent/scandirat64.c index 6d682ff..520ae7c 100644 --- a/dirent/scandirat64.c +++ b/dirent/scandirat64.c @@ -18,7 +18,7 @@ #include /* scandirat.c defines scandirat64 as an alias if _DIRENT_MATCHES_DIRENT64. */ -#ifndef _DIRENT_MATCHES_DIRENT64 +#if !_DIRENT_MATCHES_DIRENT64 # define SCANDIRAT scandirat64 # define SCANDIR_TAIL __scandir64_tail diff --git a/dirent/versionsort.c b/dirent/versionsort.c index 0130138..5ec15e8 100644 --- a/dirent/versionsort.c +++ b/dirent/versionsort.c @@ -32,6 +32,6 @@ versionsort (const struct dirent **a, const struct dirent **b) return __strverscmp ((*a)->d_name, (*b)->d_name); } -#ifdef _DIRENT_MATCHES_DIRENT64 +#if _DIRENT_MATCHES_DIRENT64 weak_alias (versionsort, versionsort64) #endif diff --git a/dirent/versionsort64.c b/dirent/versionsort64.c index bfb0cbb..7689c26 100644 --- a/dirent/versionsort64.c +++ b/dirent/versionsort64.c @@ -19,7 +19,7 @@ #include /* versionsort.c defines a versionsort64 alias if _DIRENT_MATCHES_DIRENT64. */ -#ifndef _DIRENT_MATCHES_DIRENT64 +#if !_DIRENT_MATCHES_DIRENT64 int versionsort64 (const struct dirent64 **a, const struct dirent64 **b) diff --git a/include/dirent.h b/include/dirent.h index caaeb0b..cc8f189 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -57,7 +57,7 @@ extern int __scandir_tail (DIR *dp, int (*cmp) (const struct dirent **, const struct dirent **)) attribute_hidden; -# ifdef _DIRENT_MATCHES_DIRENT64 +# if _DIRENT_MATCHES_DIRENT64 # define __scandir64_tail (dp, namelist, select, cmp) \ __scandir_tail (dp, (struct dirent ***) (namelist), \ (int (*) (const struct dirent *)) (select), \ diff --git a/sysdeps/unix/sysv/linux/bits/dirent.h b/sysdeps/unix/sysv/linux/bits/dirent.h index 2ed7919..f312720 100644 --- a/sysdeps/unix/sysv/linux/bits/dirent.h +++ b/sysdeps/unix/sysv/linux/bits/dirent.h @@ -54,4 +54,6 @@ struct dirent64 #if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T /* Inform libc code that these two types are effectively identical. */ # define _DIRENT_MATCHES_DIRENT64 1 +#else +# define _DIRENT_MATCHES_DIRENT64 0 #endif