From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88 invoked by alias); 14 Apr 2011 09:04:12 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28997 Received: (qmail 7414 invoked from network); 14 Apr 2011 09:04:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Thu, 14 Apr 2011 10:03:52 +0100 From: Peter Stephenson To: CC: Valentin Ochs Subject: Re: [PATCH v2] define _GNU_SOURCE Message-ID: <20110414100352.27f9614e@pwslap01u.europe.root.pri> In-Reply-To: <20110414093523.4a38e4cf@pwslap01u.europe.root.pri> References: <20110412130929.GG5881@erwin> <20110414093523.4a38e4cf@pwslap01u.europe.root.pri> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.103.11.49] X-Scanned-By: MailControl A_10_80_00 (www.mailcontrol.com) on 10.71.1.138 On Thu, 14 Apr 2011 09:35:23 +0100 Peter Stephenson wrote: > On Tue, 12 Apr 2011 15:09:32 +0200 > Valentin Ochs wrote: > > -#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__) > > /* > > * Turn on numerous extensions. > > * This is in order to get the functions for > > manipulating /dev/ptmx. */ > > #define _GNU_SOURCE 1 > > -#endif > > +#define _POSIX_C_SOURCE 200809L > > Looks like we'll need to #ifdef these for the appropriate system, > since it's causing mayhem elsewhere. Can you provide a preprocessor > test for the system you're fixing? I couldn't see anything obvious in musl to test for. For, I'll make it so that it can be explicitly enabled with configure --enable-libc-musl. Index: configure.ac =================================================================== RCS file: /cvsroot/zsh/zsh/configure.ac,v retrieving revision 1.133 diff -p -u -r1.133 configure.ac --- configure.ac 12 Apr 2011 14:51:31 -0000 1.133 +++ configure.ac 14 Apr 2011 09:01:45 -0000 @@ -2466,6 +2466,17 @@ if test x$zsh_cv_c_unicode_support = xye fi dnl +dnl musl support +dnl +AH_TEMPLATE([LIBC_MUSL], +[Define to 1 if musl is being used as the C library]) +AC_ARG_ENABLE(libc-musl, +AC_HELP_STRING([--enable-libc-musl], [compile with musl as the C library]), +[if test x$enableval = xyes; then + AC_DEFINE(LIBC_MUSL) +fi]) + +dnl dnl static user lookup dnl AC_ARG_ENABLE(dynamic-nss, Index: Src/system.h =================================================================== RCS file: /cvsroot/zsh/zsh/Src/system.h,v retrieving revision 1.57 diff -p -u -r1.57 system.h --- Src/system.h 12 Apr 2011 14:51:33 -0000 1.57 +++ Src/system.h 14 Apr 2011 09:01:45 -0000 @@ -37,12 +37,16 @@ #endif #endif +#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__) || defined(LIBC_MUSL) /* * Turn on numerous extensions. * This is in order to get the functions for manipulating /dev/ptmx. */ #define _GNU_SOURCE 1 +#endif +#ifdef LIBC_MUSL #define _POSIX_C_SOURCE 200809L +#endif /* NeXT has half-implemented POSIX support * * which currently fools configure */ -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom