From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 3908F1F9FE for ; Mon, 1 Mar 2021 08:29:39 +0000 (UTC) Received: from localhost ([::1]:37466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGdvu-0007Ge-BT for normalperson@yhbt.net; Mon, 01 Mar 2021 03:29:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGdvq-0007GH-P8 for bug-gnulib@gnu.org; Mon, 01 Mar 2021 03:29:34 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGdvo-0001Rp-4K for bug-gnulib@gnu.org; Mon, 01 Mar 2021 03:29:34 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 74DDB160119 for ; Mon, 1 Mar 2021 00:29:30 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id RoeAl_FltEuf; Mon, 1 Mar 2021 00:29:29 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 451AC16012D; Mon, 1 Mar 2021 00:29:29 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id gJTBFv4G6vlU; Mon, 1 Mar 2021 00:29:29 -0800 (PST) Received: from penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1E367160103; Mon, 1 Mar 2021 00:29:29 -0800 (PST) From: Paul Eggert To: bug-gnulib@gnu.org Subject: [PATCH 2/2] unlocked-io: do not redefine getc_unlocked etc. Date: Mon, 1 Mar 2021 00:29:22 -0800 Message-Id: <20210301082922.1121342-2-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210301082922.1121342-1-eggert@cs.ucla.edu> References: <20210301082922.1121342-1-eggert@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Eggert Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" I ran into this problem on AIX 7.1 with GNU Tar, which enables visibility of getc_unlocked etc. after testing whether they=E2=80=99re declared, causing argp-namefrob.h and unlocked-io.h to redefine the macros. * lib/argp-namefrob.h, lib/unlocked-io.h: (clearerr_unlocked, feof_unlocked ferror_unlocked) (fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked) (fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked) (putc_unlocked, putchar_unlocked): Do not define if already defined. --- ChangeLog | 11 +++++++++++ lib/argp-namefrob.h | 41 +++++++++++++++++++++++++++-------------- lib/unlocked-io.h | 26 +++++++++++++------------- 3 files changed, 51 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4bf4fced..c13c6816d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2021-03-01 Paul Eggert =20 + unlocked-io: do not redefine getc_unlocked etc. + I ran into this problem on AIX 7.1 with GNU Tar, which + enables visibility of getc_unlocked etc. after testing + whether they=E2=80=99re declared, causing argp-namefrob.h and + unlocked-io.h to redefine the macros. + * lib/argp-namefrob.h, lib/unlocked-io.h: + (clearerr_unlocked, feof_unlocked ferror_unlocked) + (fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked) + (fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked) + (putc_unlocked, putchar_unlocked): Do not define if already defined. + parse-datetime2: new module This splits the old parse-datetime into two parts; the first is parse-datetime2 which supports all the new bells diff --git a/lib/argp-namefrob.h b/lib/argp-namefrob.h index f3216d7dd..de1a26e2a 100644 --- a/lib/argp-namefrob.h +++ b/lib/argp-namefrob.h @@ -95,43 +95,56 @@ #undef __vsnprintf #define __vsnprintf vsnprintf =20 -#if defined(HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED +#if (defined HAVE_DECL_CLEARERR_UNLOCKED && !HAVE_DECL_CLEARERR_UNLOCKE= D \ + && !defined clearerr_unlocked) # define clearerr_unlocked(x) clearerr (x) #endif -#if defined(HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED +#if (defined HAVE_DECL_FEOF_UNLOCKED && !HAVE_DECL_FEOF_UNLOCKED \ + && !defined feof_unlocked) # define feof_unlocked(x) feof (x) #endif -#if defined(HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED +#if (defined HAVE_DECL_FERROR_UNLOCKED && !HAVE_DECL_FERROR_UNLOCKED \ + && !defined ferror_unlocked) # define ferror_unlocked(x) ferror (x) #endif -#if defined(HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED +#if (defined HAVE_DECL_FFLUSH_UNLOCKED && !HAVE_DECL_FFLUSH_UNLOCKED \ + && !defined fflush_unlocked) # define fflush_unlocked(x) fflush (x) #endif -#if defined(HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED +#if (defined HAVE_DECL_FGETS_UNLOCKED && !HAVE_DECL_FGETS_UNLOCKED \ + && !defined fgets_unlocked) # define fgets_unlocked(x,y,z) fgets (x,y,z) #endif -#if defined(HAVE_DECL_FPUTC_UNLOCKED) && !HAVE_DECL_FPUTC_UNLOCKED +#if (defined HAVE_DECL_FPUTC_UNLOCKED && !HAVE_DECL_FPUTC_UNLOCKED \ + && !defined fputc_unlocked) # define fputc_unlocked(x,y) fputc (x,y) #endif -#if defined(HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED +#if (defined HAVE_DECL_FPUTS_UNLOCKED && !HAVE_DECL_FPUTS_UNLOCKED \ + && !defined fputs_unlocked) # define fputs_unlocked(x,y) fputs (x,y) #endif -#if defined(HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED +#if (defined HAVE_DECL_FREAD_UNLOCKED && !HAVE_DECL_FREAD_UNLOCKED \ + && !defined fread_unlocked) # define fread_unlocked(w,x,y,z) fread (w,x,y,z) #endif -#if defined(HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED +#if (defined HAVE_DECL_FWRITE_UNLOCKED && !HAVE_DECL_FWRITE_UNLOCKED \ + && !defined fwrite_unlocked) # define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z) #endif -#if defined(HAVE_DECL_GETC_UNLOCKED) && !HAVE_DECL_GETC_UNLOCKED +#if (defined HAVE_DECL_GETC_UNLOCKED && !HAVE_DECL_GETC_UNLOCKED \ + && !defined getc_unlocked) # define getc_unlocked(x) getc (x) #endif -#if defined(HAVE_DECL_GETCHAR_UNLOCKED) && !HAVE_DECL_GETCHAR_UNLOCKED -# define getchar_unlocked() getchar () +#if (defined HAVE_DECL_GETCHAR_UNLOCKED && !HAVE_DECL_GETCHAR_UNLOCKED \ + && !defined getchar_unlocked) +# define getchar_unlocked() getchar () #endif -#if defined(HAVE_DECL_PUTC_UNLOCKED) && !HAVE_DECL_PUTC_UNLOCKED +#if (defined HAVE_DECL_PUTC_UNLOCKED && !HAVE_DECL_PUTC_UNLOCKED \ + && !defined putc_unlocked) # define putc_unlocked(x,y) putc (x,y) #endif -#if defined(HAVE_DECL_PUTCHAR_UNLOCKED) && !HAVE_DECL_PUTCHAR_UNLOCKED +#if (defined HAVE_DECL_PUTCHAR_UNLOCKED && !HAVE_DECL_PUTCHAR_UNLOCKED \ + && !defined putchar_unlocked) # define putchar_unlocked(x) putchar (x) #endif =20 diff --git a/lib/unlocked-io.h b/lib/unlocked-io.h index 86b91c19d..ca184b31f 100644 --- a/lib/unlocked-io.h +++ b/lib/unlocked-io.h @@ -33,91 +33,91 @@ =20 # include =20 -# if HAVE_DECL_CLEARERR_UNLOCKED +# if HAVE_DECL_CLEARERR_UNLOCKED || defined clearerr_unlocked # undef clearerr # define clearerr(x) clearerr_unlocked (x) # else # define clearerr_unlocked(x) clearerr (x) # endif =20 -# if HAVE_DECL_FEOF_UNLOCKED +# if HAVE_DECL_FEOF_UNLOCKED || defined feof_unlocked # undef feof # define feof(x) feof_unlocked (x) # else # define feof_unlocked(x) feof (x) # endif =20 -# if HAVE_DECL_FERROR_UNLOCKED +# if HAVE_DECL_FERROR_UNLOCKED || defined ferror_unlocked # undef ferror # define ferror(x) ferror_unlocked (x) # else # define ferror_unlocked(x) ferror (x) # endif =20 -# if HAVE_DECL_FFLUSH_UNLOCKED +# if HAVE_DECL_FFLUSH_UNLOCKED || defined fflush_unlocked # undef fflush # define fflush(x) fflush_unlocked (x) # else # define fflush_unlocked(x) fflush (x) # endif =20 -# if HAVE_DECL_FGETS_UNLOCKED +# if HAVE_DECL_FGETS_UNLOCKED || defined fgets_unlocked # undef fgets # define fgets(x,y,z) fgets_unlocked (x,y,z) # else # define fgets_unlocked(x,y,z) fgets (x,y,z) # endif =20 -# if HAVE_DECL_FPUTC_UNLOCKED +# if HAVE_DECL_FPUTC_UNLOCKED || defined fputc_unlocked # undef fputc # define fputc(x,y) fputc_unlocked (x,y) # else # define fputc_unlocked(x,y) fputc (x,y) # endif =20 -# if HAVE_DECL_FPUTS_UNLOCKED +# if HAVE_DECL_FPUTS_UNLOCKED || defined fputs_unlocked # undef fputs # define fputs(x,y) fputs_unlocked (x,y) # else # define fputs_unlocked(x,y) fputs (x,y) # endif =20 -# if HAVE_DECL_FREAD_UNLOCKED +# if HAVE_DECL_FREAD_UNLOCKED || defined fread_unlocked # undef fread # define fread(w,x,y,z) fread_unlocked (w,x,y,z) # else # define fread_unlocked(w,x,y,z) fread (w,x,y,z) # endif =20 -# if HAVE_DECL_FWRITE_UNLOCKED +# if HAVE_DECL_FWRITE_UNLOCKED || defined fwrite_unlocked # undef fwrite # define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z) # else # define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z) # endif =20 -# if HAVE_DECL_GETC_UNLOCKED +# if HAVE_DECL_GETC_UNLOCKED || defined get_unlocked # undef getc # define getc(x) getc_unlocked (x) # else # define getc_unlocked(x) getc (x) # endif =20 -# if HAVE_DECL_GETCHAR_UNLOCKED +# if HAVE_DECL_GETCHAR_UNLOCKED || defined getchar_unlocked # undef getchar # define getchar() getchar_unlocked () # else # define getchar_unlocked() getchar () # endif =20 -# if HAVE_DECL_PUTC_UNLOCKED +# if HAVE_DECL_PUTC_UNLOCKED || defined putc_unlocked # undef putc # define putc(x,y) putc_unlocked (x,y) # else # define putc_unlocked(x,y) putc (x,y) # endif =20 -# if HAVE_DECL_PUTCHAR_UNLOCKED +# if HAVE_DECL_PUTCHAR_UNLOCKED || defined putchar_unlocked # undef putchar # define putchar(x) putchar_unlocked (x) # else --=20 2.29.2