zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <Peter.Stephenson@csr.com>
To: <zsh-workers@zsh.org>
Cc: Valentin Ochs <a@0au.de>
Subject: Re: [PATCH v2] define _GNU_SOURCE
Date: Thu, 14 Apr 2011 10:03:52 +0100	[thread overview]
Message-ID: <20110414100352.27f9614e@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20110414093523.4a38e4cf@pwslap01u.europe.root.pri>

On Thu, 14 Apr 2011 09:35:23 +0100
Peter Stephenson <Peter.Stephenson@csr.com> wrote:

> On Tue, 12 Apr 2011 15:09:32 +0200
> Valentin Ochs <a@0au.de> 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 <pws@csr.com>            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


      reply	other threads:[~2011-04-14  9:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 13:09 Valentin Ochs
2011-04-13 16:10 ` build on os x 10.6.7, xcode 3.2.6 S. Cowles
2011-04-13 16:26   ` Peter Stephenson
2011-04-13 19:32     ` S. Cowles
2011-04-13 19:56     ` Bart Schaefer
2011-04-14  8:35 ` [PATCH v2] define _GNU_SOURCE Peter Stephenson
2011-04-14  9:03   ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110414100352.27f9614e@pwslap01u.europe.root.pri \
    --to=peter.stephenson@csr.com \
    --cc=a@0au.de \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).