[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Re: stdint.h, C++ and __STDC_LIMIT_MACROS
From: |
Pedro Alves |
Subject: |
Re: [PATCH] Re: stdint.h, C++ and __STDC_LIMIT_MACROS |
Date: |
Tue, 03 Nov 2015 14:45:06 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 11/03/2015 02:32 AM, Paul Eggert wrote:
> Pedro Alves wrote:
>> Instead of trying to detect the right types, detect
>> good-enough-pre-C++11 stdint.h and in such case make the substitute
>> stdint.h just wrap the system's stdint.h with
>> __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
>
> Instead, how about just adding the necessary #defines for
> __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS to config.h if they are needed to
> fix
> the bug? Then we can leave stdint.h alone (perhaps not even build stdint.h
> at all).
The downside could be that config.h's #defines are unconditional, instead of
guarded
against multiple definition with #ifndef, as they are currently in the
replacement
stdint.h. I was worried (a bit) that that may break packages that have build
systems that pass something like -D__STDC_CONSTANT_MACROS on the command line.
But because -DFOO defines FOO as 1, this doesn't error out:
echo "#define FOO 1" | g++ -Werror -DFOO -E -
Given that config.h defines symbols to 1, I guess that concern is moot.
(But that speaks nothing of other compilers gnulib supports, naturally.)
I'll update the patch in that direction.
Thanks,
Pedro Alves
- stdint.h, C++ and __STDC_LIMIT_MACROS, Pedro Alves, 2015/11/01
- Re: stdint.h, C++ and __STDC_LIMIT_MACROS, Paul Eggert, 2015/11/01
- Re: stdint.h, C++ and __STDC_LIMIT_MACROS, Pedro Alves, 2015/11/02
- Re: stdint.h, C++ and __STDC_LIMIT_MACROS, Pedro Alves, 2015/11/02
- [PATCH] Re: stdint.h, C++ and __STDC_LIMIT_MACROS, Pedro Alves, 2015/11/02
- Re: [PATCH] Re: stdint.h, C++ and __STDC_LIMIT_MACROS, Paul Eggert, 2015/11/02
- Re: [PATCH] Re: stdint.h, C++ and __STDC_LIMIT_MACROS,
Pedro Alves <=
- Re: [PATCH] Re: stdint.h, C++ and __STDC_LIMIT_MACROS, Pedro Alves, 2015/11/03