Gentoo Archives: gentoo-musl

From: Lei Zhang <zhanglei.april@×××××.com>
To: Luca Barbato <lu_zero@g.o>
Cc: gentoo-musl@l.g.o
Subject: Re: [gentoo-musl] [GSoC] _GNU_SOURCE in C++
Date: Tue, 21 Jun 2016 04:54:26
Message-Id: CAOYuCc2=r33iGem2Ugqst27wT9CH68zUVTP50zgjpq3_1v5cDw@mail.gmail.com
In Reply to: Re: [gentoo-musl] [GSoC] _GNU_SOURCE in C++ by Lei Zhang
1 2016-06-17 20:44 GMT+08:00 Lei Zhang <zhanglei.april@×××××.com>:
2 > After putting about eight "#define _GNU_SOURCE"s in various *.cpp
3 > files, it seems to work now :)
4
5 I was wrong; it doesn't work... I still can't figure out a good solution :(
6
7 Take glibc's strtoll_l for example: it's hidden by _GNU_SOURCE in
8 stdlib.h and used exclusively by libc++'s header <locale>; but
9 defining _GNU_SOURCE in <locale> could be too late, since stdlib.h
10 might be included prior to <locale>.
11
12 Though glibc's stdlib.h is only explicitly included in <cstdlib>,
13 defining _GNU_SOURCE in <cstdlib> doesn't work either. It turns out
14 strtoll_l (and others) is not directly protected by _GNU_SOURCE, but
15 by __USE_GNU, which is in turn defined in features.h according to
16 _GNU_SOURCE. That means "#define _GNU_SOURCE" must appear before the
17 inclusion of features.h, and it's not very clear where "#undef
18 _GNU_SOURCE" should be put.
19
20 Any suggestions?
21
22
23 Lei

Replies

Subject Author
Re: [gentoo-musl] [GSoC] _GNU_SOURCE in C++ Lei Zhang <zhanglei.april@×××××.com>
Re: [gentoo-musl] [GSoC] _GNU_SOURCE in C++ Lei Zhang <zhanglei.april@×××××.com>