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.8 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,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 2D10A1F4B4 for ; Sun, 11 Oct 2020 18:55:14 +0000 (UTC) Received: from localhost ([::1]:54944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRgUz-0000Ad-Af for normalperson@yhbt.net; Sun, 11 Oct 2020 14:55:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRgUx-0000AW-0t for bug-gnulib@gnu.org; Sun, 11 Oct 2020 14:55:11 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.51]:29611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRgUu-0002Vs-J0 for bug-gnulib@gnu.org; Sun, 11 Oct 2020 14:55:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1602442506; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=tpVOz6h3gj7ZXtpwW4Fyyr74WkB2vcJVH3QHQleH/j4=; b=Nwdqy3UvVGZIL0z8H+//s2toZy9q0yuWxhjJOwDG9xiqLpuKvzwoaTW1TiZWV1EvY+ qkTwUfNs5yvZuvVfMgx10MV9/2fA36U6sPI4fHpH5RIGErKwuVLTKdPDyTgotg/z1Xls QK25e2Q5zQuvGznxQKX3eakoZcHQrVGl4MZxUvfSy6v8KdfBijN2Bk+DU8ARd1xgkUmf 41IfVoO6onrKI2jH4vQdNPGN7leFPGVmZEHbSmGz/Wja5vqfkrK33rXrMv/6HLaoxWW8 +H/bA503qQQfeYOt9wm2HWMZqg3fwWRPDSGfO9MXO9uQUL2qJohy/6zYzEVLZNIFBx8q lBvA== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGaf0yJVW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 47.2.1 DYNA|AUTH) with ESMTPSA id R01daaw9BIt5tQk (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sun, 11 Oct 2020 20:55:05 +0200 (CEST) From: Bruno Haible To: Tim Rice Subject: Re: nap() name space clash Date: Sun, 11 Oct 2020 20:55:03 +0200 Message-ID: <2300322.3V7lkqkOS9@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-189-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=85.215.255.51; envelope-from=bruno@clisp.org; helo=mo4-p01-ob.smtp.rzone.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/11 14:55:06 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=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: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Tim, > I've prepared 2 patch options for your consideration. > > The attached nap2gnulib_nap.patch renames nap to gnulib_nap and leaves > the tests/nap.h name alone. > > The attached nap2gnulib_nap_with_nap_h_rename.patch assumes a > "git mv tests/nap.h tests/gnulib_nap.h" It smells too much of a workaround. I would prefer (a) either a rename like in your second patch, with a symbol name that looks clean (e.g. 'short_sleep' instead of 'gnulib_nap'), (b) or a workaround that is limited in scope: few lines of code, and no effect on other platforms. > > } > > In which .h file is this function declared on UnixWare? > > } > > > } > unistd.h Since the function defined by tests/nap.h is of storage class 'static', there is no conflict at the linker level, and the conflict at the source code level can be resolved by a simple '#define'. So I'm picking the approach (b). 2020-10-11 Bruno Haible tests: Avoid a name clash on UnixWare. Reported by Tim Rice in . * tests/nap.h (nap): Define as gl_nap on OpenServer and UnixWare. diff --git a/tests/nap.h b/tests/nap.h index 5dd264f..c27e538 100644 --- a/tests/nap.h +++ b/tests/nap.h @@ -24,6 +24,13 @@ # include +/* Avoid a conflict with a function called nap() on UnixWare. */ +# if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__) /* OpenServer, UnixWare */ +# include +# undef nap +# define nap gl_nap +# endif + /* Name of the witness file. */ #define TEMPFILE BASE "nap.tmp"