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 |