mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 08:13:02 +00:00
c++: factor the handling of __cplusplus into YY_CPLUSPLUS
* data/c++.m4 (b4_cxx_portability): Define it. Use it. * data/lalr1.cc, data/variant.hh: Use it.
This commit is contained in:
10
data/c++.m4
10
data/c++.m4
@@ -53,8 +53,14 @@ m4_define([b4_inline],
|
||||
# b4_cxx_portability
|
||||
# ------------------
|
||||
m4_define([b4_cxx_portability],
|
||||
[// Support move semantics when possible.
|
||||
#if defined __cplusplus && 201103L <= __cplusplus
|
||||
[#if defined __cplusplus
|
||||
# define YY_CPLUSPLUS __cplusplus
|
||||
#else
|
||||
# define YY_CPLUSPLUS 199711L
|
||||
#endif
|
||||
|
||||
// Support move semantics when possible.
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
# define YY_MOVE std::move
|
||||
# define YY_MOVE_OR_COPY move
|
||||
# define YY_MOVE_REF(Type) Type&&
|
||||
|
||||
Reference in New Issue
Block a user