public inbox for gentoo-musl@lists.gentoo.org
 help / color / mirror / Atom feed
From: Lei Zhang <zhanglei.april@gmail.com>
To: Luca Barbato <lu_zero@gentoo.org>
Cc: gentoo-musl@lists.gentoo.org
Subject: Re: [gentoo-musl] [GSoC] _GNU_SOURCE in C++
Date: Wed, 22 Jun 2016 21:21:49 +0800	[thread overview]
Message-ID: <CAOYuCc1UFS+DetusxwgU0Sxz7J=5vgpkQ7N94t0ULW9a_XW26A@mail.gmail.com> (raw)
In-Reply-To: <CAOYuCc2=r33iGem2Ugqst27wT9CH68zUVTP50zgjpq3_1v5cDw@mail.gmail.com>

2016-06-21 12:54 GMT+08:00 Lei Zhang <zhanglei.april@gmail.com>:
> 2016-06-17 20:44 GMT+08:00 Lei Zhang <zhanglei.april@gmail.com>:
>> After putting about eight "#define _GNU_SOURCE"s in various *.cpp
>> files, it seems to work now :)
>
> I was wrong; it doesn't work... I still can't figure out a good solution :(
>
> Take glibc's strtoll_l for example: it's hidden by _GNU_SOURCE in
> stdlib.h and used exclusively by libc++'s header <locale>; but
> defining _GNU_SOURCE in <locale> could be too late, since stdlib.h
> might be included prior to <locale>.
>
> Though glibc's stdlib.h is only explicitly included in <cstdlib>,
> defining _GNU_SOURCE in <cstdlib> doesn't work either. It turns out
> strtoll_l (and others) is not directly protected by _GNU_SOURCE, but
> by __USE_GNU, which is in turn defined in features.h according to
> _GNU_SOURCE. That means "#define _GNU_SOURCE" must appear before the
> inclusion of features.h, and it's not very clear where "#undef
> _GNU_SOURCE" should be put.
>
> Any suggestions?

The only feasible solution I can think of is to wrap every inclusion of C header


  reply	other threads:[~2016-06-22 13:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14  7:44 [gentoo-musl] [GSoC] _GNU_SOURCE in C++ Lei Zhang
2016-06-14  8:10 ` Felix Janda
2016-06-14  8:28   ` Lei Zhang
     [not found]     ` <4228046b-02f1-1b65-f56d-6e79347e4390@gentoo.org>
2016-06-14  9:17       ` Lei Zhang
     [not found]         ` <20302d1d-92ff-1c4b-8939-08894c3589ca@gentoo.org>
2016-06-14  9:35           ` Lei Zhang
     [not found]             ` <8e7cafd9-97c7-6ca1-ad3f-95bdb0060ce0@gentoo.org>
2016-06-14 11:48               ` Lei Zhang
     [not found]                 ` <e1f362ee-7755-9a54-78e3-19e0733ebd3b@gentoo.org>
2016-06-15  1:45                   ` Lei Zhang
     [not found]                     ` <19f9f66f-5dd4-786a-3b29-0a57c407548e@gentoo.org>
2016-06-16  3:36                       ` Lei Zhang
     [not found]                         ` <1c93fa87-e2c3-2737-1222-ae93003e21ad@gentoo.org>
2016-06-16 12:47                           ` Lei Zhang
     [not found]                             ` <7d6fa9d6-1134-1d2a-1d06-33029b82429d@gentoo.org>
2016-06-16 13:42                               ` Lei Zhang
2016-06-17 11:12                                 ` Lei Zhang
2016-06-17 11:13                                   ` Lei Zhang
     [not found]                                   ` <37117cc0-2af1-306d-6ec5-d8d37d8c588c@gentoo.org>
2016-06-17 12:44                                     ` Lei Zhang
2016-06-21  4:54                                       ` Lei Zhang
2016-06-22 13:21                                         ` Lei Zhang [this message]
2016-06-22 13:54                                         ` Lei Zhang
2016-06-22 14:02                                           ` Lei Zhang
2016-06-14  9:55     ` Felix Janda
     [not found] ` <20160615033804.GA2473@gmail.com>
2016-06-15  3:55   ` Lei Zhang

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='CAOYuCc1UFS+DetusxwgU0Sxz7J=5vgpkQ7N94t0ULW9a_XW26A@mail.gmail.com' \
    --to=zhanglei.april@gmail.com \
    --cc=gentoo-musl@lists.gentoo.org \
    --cc=lu_zero@gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox