[PATCH] define [U]LLONG_{MIN,MAX} for C++11

Richard Smith richard at metafoo.co.uk
Fri Oct 25 15:43:51 PDT 2013


Please add a test for this. Otherwise LGTM.
On 22 Oct 2013 16:02, "JF Bastien" <jfb at google.com> wrote:

> C99 has LLONG_MIN, LLONG_MAX, ULLONG_MAX and so does C++11. Teach clang's
> limits.h about it.
>
> diff --git a/lib/Headers/limits.h b/lib/Headers/limits.h
> index ecd09a4..91bd404 100644
> --- a/lib/Headers/limits.h
> +++ b/lib/Headers/limits.h
> @@ -87,8 +87,10 @@
>  #define CHAR_MAX __SCHAR_MAX__
>  #endif
>
> -/* C99 5.2.4.2.1: Added long long. */
> -#if __STDC_VERSION__ >= 199901
> +/* C99 5.2.4.2.1: Added long long.
> +   C++11 18.3.3.2: same contents as the Standard C Library header
> <limits.h>.
> + */
> +#if __STDC_VERSION__ >= 199901 || __cplusplus >= 201103L
>
>  #undef  LLONG_MIN
>  #undef  LLONG_MAX
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131025/411b7584/attachment.html>


More information about the cfe-commits mailing list