diff options
Diffstat (limited to 'boost/preprocessor')
-rw-r--r-- | boost/preprocessor/cat.hpp | 2 | ||||
-rw-r--r-- | boost/preprocessor/config/config.hpp | 10 | ||||
-rw-r--r-- | boost/preprocessor/seq/detail/binary_transform.hpp | 11 | ||||
-rw-r--r-- | boost/preprocessor/seq/detail/to_list_msvc.hpp | 55 | ||||
-rw-r--r-- | boost/preprocessor/seq/to_list.hpp | 12 |
5 files changed, 78 insertions, 12 deletions
diff --git a/boost/preprocessor/cat.hpp b/boost/preprocessor/cat.hpp index 5e52850d48..52a389270c 100644 --- a/boost/preprocessor/cat.hpp +++ b/boost/preprocessor/cat.hpp @@ -25,7 +25,7 @@ # define BOOST_PP_CAT_OO(par) BOOST_PP_CAT_I ## par # endif # -# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() +# if (~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) # define BOOST_PP_CAT_I(a, b) a ## b # else # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b) diff --git a/boost/preprocessor/config/config.hpp b/boost/preprocessor/config/config.hpp index 8be0e47545..4801903141 100644 --- a/boost/preprocessor/config/config.hpp +++ b/boost/preprocessor/config/config.hpp @@ -32,7 +32,7 @@ # elif defined(__MWERKS__) && __MWERKS__ >= 0x3200 # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT()) # elif defined(__EDG__) || defined(__EDG_VERSION__) -# if defined(_MSC_VER) && (defined(__INTELLISENSE__) || __EDG_VERSION__ >= 308) +# if defined(_MSC_VER) && (defined(__clang__) || defined(__INTELLISENSE__) || __EDG_VERSION__ >= 308) # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC()) # else # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_EDG() | BOOST_PP_CONFIG_STRICT()) @@ -45,7 +45,7 @@ # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT()) # elif defined(__BORLANDC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_BCC()) -# elif defined(_MSC_VER) && !defined(__clang__) +# elif defined(_MSC_VER) # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC()) # else # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT()) @@ -75,8 +75,8 @@ # /* variadic support explicitly disabled for all untested compilers */ # if defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || ( defined __SUNPRO_CC && __SUNPRO_CC < 0x5120 ) || defined __HP_aCC && !defined __EDG__ || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI # define BOOST_PP_VARIADICS 0 -# /* VC++ (C/C++) */ -# elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__)) && !defined __clang__ +# /* VC++ (C/C++) and Intel C++ Compiler >= 17.0 with MSVC */ +# elif defined _MSC_VER && _MSC_VER >= 1400 && (defined(__clang__) || !defined __EDG__ || defined(__INTELLISENSE__) || defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) # define BOOST_PP_VARIADICS 1 # undef BOOST_PP_VARIADICS_MSVC # define BOOST_PP_VARIADICS_MSVC 1 @@ -92,7 +92,7 @@ # elif !BOOST_PP_VARIADICS + 1 < 2 # undef BOOST_PP_VARIADICS # define BOOST_PP_VARIADICS 1 -# if defined _MSC_VER && _MSC_VER >= 1400 && (defined(__INTELLISENSE__) || !(defined __EDG__ || defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __clang__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || defined __SUNPRO_CC || defined __HP_aCC || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI)) +# if defined _MSC_VER && _MSC_VER >= 1400 && (defined(__clang__) || defined(__INTELLISENSE__) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) || !(defined __EDG__ || defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || defined __SUNPRO_CC || defined __HP_aCC || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI)) # undef BOOST_PP_VARIADICS_MSVC # define BOOST_PP_VARIADICS_MSVC 1 # endif diff --git a/boost/preprocessor/seq/detail/binary_transform.hpp b/boost/preprocessor/seq/detail/binary_transform.hpp index 70897b09cf..08b5f9de4d 100644 --- a/boost/preprocessor/seq/detail/binary_transform.hpp +++ b/boost/preprocessor/seq/detail/binary_transform.hpp @@ -30,14 +30,13 @@ # endif # if BOOST_PP_VARIADICS # if BOOST_PP_VARIADICS_MSVC -# define BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(...) \ - BOOST_PP_VARIADIC_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,__VA_ARGS__) \ - /**/ +# define BOOST_PP_SEQ_BINARY_TRANSFORM_REM(data) data +# define BOOST_PP_SEQ_BINARY_TRANSFORM_A(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_B +# define BOOST_PP_SEQ_BINARY_TRANSFORM_B(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_A # else -# define BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(...) BOOST_PP_REM +# define BOOST_PP_SEQ_BINARY_TRANSFORM_A(...) (BOOST_PP_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_B +# define BOOST_PP_SEQ_BINARY_TRANSFORM_B(...) (BOOST_PP_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_A # endif -# define BOOST_PP_SEQ_BINARY_TRANSFORM_A(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(__VA_ARGS__), __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_B -# define BOOST_PP_SEQ_BINARY_TRANSFORM_B(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(__VA_ARGS__), __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_A # else # define BOOST_PP_SEQ_BINARY_TRANSFORM_A(e) (BOOST_PP_REM, e)() BOOST_PP_SEQ_BINARY_TRANSFORM_B # define BOOST_PP_SEQ_BINARY_TRANSFORM_B(e) (BOOST_PP_REM, e)() BOOST_PP_SEQ_BINARY_TRANSFORM_A diff --git a/boost/preprocessor/seq/detail/to_list_msvc.hpp b/boost/preprocessor/seq/detail/to_list_msvc.hpp new file mode 100644 index 0000000000..2599c0014a --- /dev/null +++ b/boost/preprocessor/seq/detail/to_list_msvc.hpp @@ -0,0 +1,55 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Edward Diener 2016. * +# * Distributed under the Boost Software License, Version 1.0. (See * +# * accompanying file LICENSE_1_0.txt or copy at * +# * http://www.boost.org/LICENSE_1_0.txt) * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP +# define BOOST_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP +# +# include <boost/preprocessor/config/config.hpp> +# +# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() +# +# include <boost/preprocessor/cat.hpp> +# include <boost/preprocessor/arithmetic/dec.hpp> +# include <boost/preprocessor/control/while.hpp> +# include <boost/preprocessor/tuple/elem.hpp> +# +# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT(state) \ + BOOST_PP_TUPLE_ELEM(2, 0, state) \ +/**/ +# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state) \ + BOOST_PP_TUPLE_ELEM(2, 1, state) \ +/**/ +# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_PRED(d,state) \ + BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state) \ +/**/ +# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_OP(d,state) \ + ( \ + BOOST_PP_CAT(BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT(state),), \ + BOOST_PP_DEC(BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state)) \ + ) \ +/**/ +# +# /* BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC */ +# +# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC(result,seqsize) \ + BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT \ + ( \ + BOOST_PP_WHILE \ + ( \ + BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_PRED, \ + BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_OP, \ + (result,seqsize) \ + ) \ + ) \ +/**/ +# endif // BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() +# +# endif // BOOST_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP diff --git a/boost/preprocessor/seq/to_list.hpp b/boost/preprocessor/seq/to_list.hpp index fa0421bcc8..ed8948dbd4 100644 --- a/boost/preprocessor/seq/to_list.hpp +++ b/boost/preprocessor/seq/to_list.hpp @@ -19,7 +19,19 @@ # # /* BOOST_PP_SEQ_TO_LIST */ # +# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() +# include <boost/preprocessor/seq/size.hpp> +# include <boost/preprocessor/seq/detail/to_list_msvc.hpp> +# define BOOST_PP_SEQ_TO_LIST(seq) \ + BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC \ + ( \ + BOOST_PP_SEQ_TO_LIST_I(BOOST_PP_SEQ_BINARY_TRANSFORM(seq)), \ + BOOST_PP_SEQ_SIZE(seq) \ + ) \ +/**/ +# else # define BOOST_PP_SEQ_TO_LIST(seq) BOOST_PP_SEQ_TO_LIST_I(BOOST_PP_SEQ_BINARY_TRANSFORM(seq)) +# endif # define BOOST_PP_SEQ_TO_LIST_I(bseq) BOOST_PP_SEQ_TO_LIST_A bseq BOOST_PP_NIL BOOST_PP_SEQ_TO_LIST_B bseq # define BOOST_PP_SEQ_TO_LIST_A(m, e) m(BOOST_PP_LPAREN() e BOOST_PP_COMMA() BOOST_PP_SEQ_TO_LIST_A_ID) # define BOOST_PP_SEQ_TO_LIST_A_ID() BOOST_PP_SEQ_TO_LIST_A |