summaryrefslogtreecommitdiff
path: root/gcc/ginclude
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-06 23:06:04 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-06 23:06:04 +0000
commitf85ff1908abc4c5dc3bdc965d64104d0cbb1a4ba (patch)
tree244b72d26d12f547c33a38c2cb79580c6bb8ed17 /gcc/ginclude
parent24b73c8c4c2f336b0b4d400e8c653f88f7c205a2 (diff)
downloadgcc-f85ff1908abc4c5dc3bdc965d64104d0cbb1a4ba.tar.gz
2012-10-06 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52764 * ginclude/stdint-wrap.h: In C++11 if __STDC_HOSTED__ define __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS. * ginclude/stdint-gcc.h: In C++11 unconditionally define limit and constant macros. /testsuite 2012-10-06 Paolo Carlini <paolo.carlini@oracle.com> PR c++/52764 * g++.dg/cpp0x/stdint.C: New. /libstdc++-v3 2012-10-06 Paolo Carlini <paolo.carlini@oracle.com> PR c++/52764 * include/c_global/cstdint: Remove __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS related macros. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192174 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ginclude')
-rw-r--r--gcc/ginclude/stdint-gcc.h14
-rw-r--r--gcc/ginclude/stdint-wrap.h6
2 files changed, 15 insertions, 5 deletions
diff --git a/gcc/ginclude/stdint-gcc.h b/gcc/ginclude/stdint-gcc.h
index 22780a15efa..64b389930c9 100644
--- a/gcc/ginclude/stdint-gcc.h
+++ b/gcc/ginclude/stdint-gcc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -91,7 +91,8 @@ typedef __UINTPTR_TYPE__ uintptr_t;
typedef __INTMAX_TYPE__ intmax_t;
typedef __UINTMAX_TYPE__ uintmax_t;
-#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
+#if (!defined __cplusplus || __cplusplus >= 201103L \
+ || defined __STDC_LIMIT_MACROS)
/* 7.18.2 Limits of specified-width integer types */
@@ -229,9 +230,11 @@ typedef __UINTMAX_TYPE__ uintmax_t;
#undef WINT_MIN
#define WINT_MIN __WINT_MIN__
-#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
+#endif /* (!defined __cplusplus || __cplusplus >= 201103L
+ || defined __STDC_LIMIT_MACROS) */
-#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
+#if (!defined __cplusplus || __cplusplus >= 201103L \
+ || defined __STDC_CONSTANT_MACROS)
#undef INT8_C
#define INT8_C(c) __INT8_C(c)
@@ -254,6 +257,7 @@ typedef __UINTMAX_TYPE__ uintmax_t;
#undef UINTMAX_C
#define UINTMAX_C(c) __UINTMAX_C(c)
-#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
+#endif /* (!defined __cplusplus || __cplusplus >= 201103L
+ || defined __STDC_CONSTANT_MACROS) */
#endif /* _GCC_STDINT_H */
diff --git a/gcc/ginclude/stdint-wrap.h b/gcc/ginclude/stdint-wrap.h
index e45f8198b97..83b6f70c837 100644
--- a/gcc/ginclude/stdint-wrap.h
+++ b/gcc/ginclude/stdint-wrap.h
@@ -1,5 +1,11 @@
#ifndef _GCC_WRAP_STDINT_H
#if __STDC_HOSTED__
+# if defined __cplusplus && __cplusplus >= 201103L
+# undef __STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+# undef __STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS
+# endif
# include_next <stdint.h>
#else
# include "stdint-gcc.h"