summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-05-18 16:22:01 +0200
committerMartin Liska <marxin@gcc.gnu.org>2017-05-18 14:22:01 +0000
commit671d5bcb262855ea7193f8349f38a15c388fcb6f (patch)
tree975c6f4fd6b0c9e00f69dda2bee8e4e93d6ad71b /include
parentdbcb3c7446c4c9f8f491db6a71bbab318918c874 (diff)
Define CONSTEXPR macro and use it in vec.h.
2017-05-18 Martin Liska <mliska@suse.cz> * ansidecl.h: Define CONSTEXPR macro. 2017-05-18 Martin Liska <mliska@suse.cz> * vec.h (struct vnull): Use it. From-SVN: r248205
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog4
-rw-r--r--include/ansidecl.h6
2 files changed, 10 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 9571a46a1ef..9b7a139bc26 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-18 Martin Liska <mliska@suse.cz>
+
+ * ansidecl.h: Define CONSTEXPR macro.
+
2017-04-04 Jonathan Wakely <jwakely@redhat.com>
* ansidecl.h (ATTRIBUTE_PACKED): Fix typo in comment.
diff --git a/include/ansidecl.h b/include/ansidecl.h
index 25f33dad232..f6e1761af2d 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -313,6 +313,12 @@ So instead we use the macro below and test it against specific values. */
#define ENUM_BITFIELD(TYPE) unsigned int
#endif
+#if __cpp_constexpr >= 200704
+#define CONSTEXPR constexpr
+#else
+#define CONSTEXPR
+#endif
+
/* C++11 adds the ability to add "override" after an implementation of a
virtual function in a subclass, to:
(A) document that this is an override of a virtual function