From 49a72ac4f2a97eda3794ee11d3f23d3917237385 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Thu, 23 Aug 2018 19:20:04 -0400 Subject: [PATCH 01/13] Corrected sentence by removing extra "the". --- doc/ref/expand.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ref/expand.html b/doc/ref/expand.html index 4a1d78b..aa4ba77 100644 --- a/doc/ref/expand.html +++ b/doc/ref/expand.html @@ -22,7 +22,7 @@
This macro is useful when a delay is necessary to produce the correct semantics of a macro invocation.  For example, when a macro expands to an argument list to another macro.  - This macro will expand the the argument list on the first pass, and then rescan to expand any more macros. + This macro will expand the argument list on the first pass, and then rescan to expand any more macros.

Requirements

From 347f48afaeef9e8d0bf57395186fdeae3d1913b6 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Mon, 10 Sep 2018 17:42:32 -0400 Subject: [PATCH 02/13] Back out previous CUDA change to turn on variadic macro support for all situations when compiling a CUDA file. --- include/boost/preprocessor/config/config.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/boost/preprocessor/config/config.hpp b/include/boost/preprocessor/config/config.hpp index cdb044c..9b7054c 100644 --- a/include/boost/preprocessor/config/config.hpp +++ b/include/boost/preprocessor/config/config.hpp @@ -71,10 +71,8 @@ # define BOOST_PP_VARIADICS_MSVC 0 # if !defined BOOST_PP_VARIADICS # /* variadic support explicitly disabled for all untested compilers */ -# if defined __GCCXML__ || 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 __PGI +# 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 __PGI # define BOOST_PP_VARIADICS 0 -# elif defined(__CUDACC__) -# define BOOST_PP_VARIADICS 1 # elif defined(_MSC_VER) && defined(__clang__) # define BOOST_PP_VARIADICS 1 # /* VC++ (C/C++) and Intel C++ Compiler >= 17.0 with MSVC */ From b5c081bf7a2c043911a9048935c11a3e8d6c881a Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Sun, 23 Sep 2018 09:12:59 -0400 Subject: [PATCH 03/13] Variadic macro support for the PGI compiler when EDG is being used with it. --- include/boost/preprocessor/config/config.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/preprocessor/config/config.hpp b/include/boost/preprocessor/config/config.hpp index 9b7054c..cb60403 100644 --- a/include/boost/preprocessor/config/config.hpp +++ b/include/boost/preprocessor/config/config.hpp @@ -71,7 +71,8 @@ # define BOOST_PP_VARIADICS_MSVC 0 # if !defined BOOST_PP_VARIADICS # /* 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 __PGI + +# 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(__PGI) && !defined(__EDG__)) # define BOOST_PP_VARIADICS 0 # elif defined(_MSC_VER) && defined(__clang__) # define BOOST_PP_VARIADICS 1 From dd44e1eea58576d94581f159ece10ed640e3a248 Mon Sep 17 00:00:00 2001 From: Mike Dev Date: Mon, 17 Sep 2018 11:20:51 +0200 Subject: [PATCH 04/13] [CMake] Add minimal cmake file Generate cmake target that can be used by other libraries to express their dependency on this library and retrieve any configuration information such as the include directory. --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..7375f9d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright 2018 Mike Dev +# 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 + +cmake_minimum_required(VERSION 3.5) +project(BoostPreprocessor LANGUAGES CXX) + +add_library(boost_preprocessor INTERFACE) +add_library(Boost::preprocessor ALIAS boost_preprocessor) + +target_include_directories(boost_preprocessor INTERFACE include) From ee5ed2510d501dc9115b90d434ed621f7bf0989c Mon Sep 17 00:00:00 2001 From: Mike Dev Date: Tue, 16 Oct 2018 18:44:57 +0200 Subject: [PATCH 05/13] [CMake] Add self-test for cmake file to travis --- .travis.yml | 9 +++++++++ CMakeLists.txt | 1 + test/CMakeLists.txt | 18 ++++++++++++++++++ test/cmake_self_test.cpp | 3 +++ 4 files changed, 31 insertions(+) create mode 100644 test/CMakeLists.txt create mode 100644 test/cmake_self_test.cpp diff --git a/.travis.yml b/.travis.yml index 92c2ee7..dd85603 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,15 @@ branches: - master - develop +matrix: + include: + - install: true + script: + - mkdir __build__ && cd __build__ + - cmake ../test + - cmake --build . + + install: - cd .. - git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root diff --git a/CMakeLists.txt b/CMakeLists.txt index 7375f9d..c0f41f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,3 +9,4 @@ add_library(boost_preprocessor INTERFACE) add_library(Boost::preprocessor ALIAS boost_preprocessor) target_include_directories(boost_preprocessor INTERFACE include) + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..4008930 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright 2018 Mike Dev +# 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 +# +# NOTE: This does not run the UNIT-TESTS for Boost.PReprocessor. +# It only tests, if the CMakeLists.txt file works as expected + +cmake_minimum_required( VERSION 3.5 ) + +project( TestBoostPreprocessorCMakeSelfTest ) + +add_subdirectory( .. ${CMAKE_CURRENT_BINARY_DIR}/boost_preprocessor ) + +# arithmetic.cpp is a randomly chosen source file +# that is compilable on it's own. +add_executable( boost_preprocessor_self_test cmake_self_test.cpp ) +target_link_libraries( boost_preprocessor_self_test Boost::preprocessor ) + diff --git a/test/cmake_self_test.cpp b/test/cmake_self_test.cpp new file mode 100644 index 0000000..2d7b167 --- /dev/null +++ b/test/cmake_self_test.cpp @@ -0,0 +1,3 @@ +#include + +int main() {} From 0e335df79e23eca2aafbbf7b24adb2e00a7573b4 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Tue, 16 Oct 2018 16:37:10 -0400 Subject: [PATCH 06/13] Test for stringize macro and use of variadic in stringize macro. --- include/boost/preprocessor/stringize.hpp | 4 +++ include/boost/preprocessor/wstringize.hpp | 4 +++ test/Jamfile.v2 | 11 +++++++ test/stringize.c | 12 ++++++++ test/stringize.cpp | 12 ++++++++ test/stringize.cxx | 36 +++++++++++++++++++++++ 6 files changed, 79 insertions(+) create mode 100644 test/stringize.c create mode 100644 test/stringize.cpp create mode 100644 test/stringize.cxx diff --git a/include/boost/preprocessor/stringize.hpp b/include/boost/preprocessor/stringize.hpp index 64dd5fd..e072dbd 100644 --- a/include/boost/preprocessor/stringize.hpp +++ b/include/boost/preprocessor/stringize.hpp @@ -28,6 +28,10 @@ # define BOOST_PP_STRINGIZE(text) BOOST_PP_STRINGIZE_I(text) # endif # +#if BOOST_PP_VARIADICS +# define BOOST_PP_STRINGIZE_I(...) #__VA_ARGS__ +#else # define BOOST_PP_STRINGIZE_I(text) #text +#endif # # endif diff --git a/include/boost/preprocessor/wstringize.hpp b/include/boost/preprocessor/wstringize.hpp index 5d1a83a..9f89673 100644 --- a/include/boost/preprocessor/wstringize.hpp +++ b/include/boost/preprocessor/wstringize.hpp @@ -23,7 +23,11 @@ # define BOOST_PP_WSTRINGIZE_OO(par) BOOST_PP_WSTRINGIZE_I ## par # endif # +#if BOOST_PP_VARIADICS +# define BOOST_PP_WSTRINGIZE_I(...) BOOST_PP_WSTRINGIZE_II(#__VA_ARGS__) +#else # define BOOST_PP_WSTRINGIZE_I(text) BOOST_PP_WSTRINGIZE_II(#text) +#endif # define BOOST_PP_WSTRINGIZE_II(str) L ## str # # endif diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 562ee9e..d0ad865 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -48,6 +48,7 @@ alias preprocessor [ compile selection.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] [ compile seq.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] [ compile slot.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] + [ compile stringize.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] [ compile tuple.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] [ compile variadic.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] ; @@ -67,6 +68,7 @@ alias preprocessor_nvm [ compile selection.cpp : BOOST_PP_VARIADICS=0 : selection_nvm ] [ compile seq.cpp : BOOST_PP_VARIADICS=0 : seq_nvm ] [ compile slot.cpp : BOOST_PP_VARIADICS=0 : slot_nvm ] + [ compile stringize.cpp : BOOST_PP_VARIADICS=0 : stringize_nvm ] [ compile tuple.cpp : BOOST_PP_VARIADICS=0 : tuple_nvm ] ; @@ -120,6 +122,10 @@ alias preprocessor_c : gcc:-std=c99 clang-linux:-std=c99 : slot_c ] + [ compile stringize.c + : gcc:-std=c99 clang-linux:-std=c99 + : stringize_c + ] [ compile tuple.c : gcc:-std=c99 clang-linux:-std=c99 : tuple_c @@ -187,6 +193,11 @@ alias preprocessor_c_nvm gcc:-std=c99 clang-linux:-std=c99 : slot_c_nvm ] + [ compile stringize.c + : BOOST_PP_VARIADICS=0 + gcc:-std=c99 clang-linux:-std=c99 + : stringize_c_nvm + ] [ compile tuple.c : BOOST_PP_VARIADICS=0 gcc:-std=c99 clang-linux:-std=c99 diff --git a/test/stringize.c b/test/stringize.c new file mode 100644 index 0000000..0ac19ec --- /dev/null +++ b/test/stringize.c @@ -0,0 +1,12 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Edward Diener 2018. +# * 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. */ +# +# include diff --git a/test/stringize.cpp b/test/stringize.cpp new file mode 100644 index 0000000..0ac19ec --- /dev/null +++ b/test/stringize.cpp @@ -0,0 +1,12 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Edward Diener 2018. +# * 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. */ +# +# include diff --git a/test/stringize.cxx b/test/stringize.cxx new file mode 100644 index 0000000..fb22128 --- /dev/null +++ b/test/stringize.cxx @@ -0,0 +1,36 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Edward Diener 2018. +# * 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. */ +# +# include +# include +# include +# include + +#define VDATA 1,2,3,4 +#define NDATA +#define DATA data +#define FDATA(x) BOOST_PP_INC(x) + +# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() +BEGIN sizeof(BOOST_PP_STRINGIZE(NDATA)) / sizeof(char) == 1 END +BEGIN sizeof(BOOST_PP_WSTRINGIZE(NDATA)) / sizeof(wchar_t) == 1 END +#endif +BEGIN sizeof(BOOST_PP_STRINGIZE(DATA)) / sizeof(char) == 5 END +BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(1))) / sizeof(char) == 2 END +BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(9))) / sizeof(char) == 3 END +BEGIN sizeof(BOOST_PP_WSTRINGIZE(DATA)) / sizeof(wchar_t) == 5 END +BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(1))) / sizeof(wchar_t) == 2 END +BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(9))) / sizeof(wchar_t) == 3 END + +#if BOOST_PP_VARIADICS +BEGIN sizeof(BOOST_PP_STRINGIZE(VDATA)) / sizeof(char) == 8 END +BEGIN sizeof(BOOST_PP_WSTRINGIZE(VDATA)) / sizeof(wchar_t) == 8 END +#endif From a4e304ca8738c5c67b9c402a520ce5bfdb6720f3 Mon Sep 17 00:00:00 2001 From: Mike Dev Date: Wed, 17 Oct 2018 10:56:06 +0200 Subject: [PATCH 07/13] [CMake/CI] Add cmake self test to appveyor --- appveyor.yml | 57 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 1fefc07..f3853c0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,6 +6,10 @@ version: 1.0.{build}-{branch} shallow_clone: true +configuration: + - boost_test + - cmake_self_test + branches: only: - master @@ -18,19 +22,44 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 TOOLSET: msvc-14.1 -install: - - cd .. - - git clone -b %APPVEYOR_REPO_BRANCH% https://github.com/boostorg/boost.git boost-root - - cd boost-root - - git submodule update --init tools/build - - git submodule update --init libs/config - - git submodule update --init tools/boostdep - - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\preprocessor - - python tools/boostdep/depinst/depinst.py preprocessor - - bootstrap - - b2 headers - build: off -test_script: - - b2 libs/preprocessor/test toolset=%TOOLSET% +for: +- + matrix: + only: + - configuration: cmake_self_test + + build: off + test_script: + - mkdir __build__ + - cd __build__ + - cmake ../test + - cmake --build . + +- + matrix: + only: + - configuration: boost_test + install: + - cd .. + - git clone -b %APPVEYOR_REPO_BRANCH% https://github.com/boostorg/boost.git boost-root + - cd boost-root + - git submodule update --init tools/build + - git submodule update --init libs/config + - git submodule update --init tools/boostdep + - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\preprocessor + - python tools/boostdep/depinst/depinst.py preprocessor + - bootstrap + - b2 headers + + build: off + + test_script: + - b2 libs/preprocessor/test toolset=%TOOLSET% + - cd ../preprocessor/test + + + + + From 31653b34c9a30c046c4d03688c66c40297dcf668 Mon Sep 17 00:00:00 2001 From: Mike Dev Date: Wed, 17 Oct 2018 11:41:42 +0200 Subject: [PATCH 08/13] [CMake/CI] Some cleanup --- appveyor.yml | 9 ++------- test/CMakeLists.txt | 10 ++++------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f3853c0..3d07613 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,5 @@ # Copyright 2017 Edward Diener +# Copyright 2018 Mike Dev # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) @@ -30,7 +31,6 @@ for: only: - configuration: cmake_self_test - build: off test_script: - mkdir __build__ - cd __build__ @@ -41,6 +41,7 @@ for: matrix: only: - configuration: boost_test + install: - cd .. - git clone -b %APPVEYOR_REPO_BRANCH% https://github.com/boostorg/boost.git boost-root @@ -53,13 +54,7 @@ for: - bootstrap - b2 headers - build: off - test_script: - b2 libs/preprocessor/test toolset=%TOOLSET% - cd ../preprocessor/test - - - - diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4008930..2ec107e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,17 +2,15 @@ # 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 # -# NOTE: This does not run the UNIT-TESTS for Boost.PReprocessor. +# NOTE: This does NOT run the unit tests for Boost.Preprocessor (yet). # It only tests, if the CMakeLists.txt file works as expected cmake_minimum_required( VERSION 3.5 ) -project( TestBoostPreprocessorCMakeSelfTest ) +project( BoostPreprocessorCMakeSelfTest ) add_subdirectory( .. ${CMAKE_CURRENT_BINARY_DIR}/boost_preprocessor ) -# arithmetic.cpp is a randomly chosen source file -# that is compilable on it's own. -add_executable( boost_preprocessor_self_test cmake_self_test.cpp ) -target_link_libraries( boost_preprocessor_self_test Boost::preprocessor ) +add_executable( boost_preprocessor_cmake_self_test cmake_self_test.cpp ) +target_link_libraries( boost_preprocessor_cmake_self_test Boost::preprocessor ) From 344ce6abf9584a5e082e3851bf073b911ac08acf Mon Sep 17 00:00:00 2001 From: Mike Dev Date: Wed, 17 Oct 2018 12:13:45 +0200 Subject: [PATCH 09/13] [CMake/CI] Use config_info.cpp for cmake self test --- test/CMakeLists.txt | 2 +- test/cmake_self_test.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 test/cmake_self_test.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2ec107e..b56c870 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -11,6 +11,6 @@ project( BoostPreprocessorCMakeSelfTest ) add_subdirectory( .. ${CMAKE_CURRENT_BINARY_DIR}/boost_preprocessor ) -add_executable( boost_preprocessor_cmake_self_test cmake_self_test.cpp ) +add_executable( boost_preprocessor_cmake_self_test config_info.cpp ) target_link_libraries( boost_preprocessor_cmake_self_test Boost::preprocessor ) diff --git a/test/cmake_self_test.cpp b/test/cmake_self_test.cpp deleted file mode 100644 index 2d7b167..0000000 --- a/test/cmake_self_test.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include - -int main() {} From 45588469f379ff451da62317e5bcd4a4ec95777c Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Fri, 19 Oct 2018 16:41:43 -0400 Subject: [PATCH 10/13] Only test wide character stringize in c++. --- test/stringize.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/stringize.cxx b/test/stringize.cxx index fb22128..ebe559f 100644 --- a/test/stringize.cxx +++ b/test/stringize.cxx @@ -21,16 +21,21 @@ # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() BEGIN sizeof(BOOST_PP_STRINGIZE(NDATA)) / sizeof(char) == 1 END +# if defined __cplusplus BEGIN sizeof(BOOST_PP_WSTRINGIZE(NDATA)) / sizeof(wchar_t) == 1 END #endif +#endif BEGIN sizeof(BOOST_PP_STRINGIZE(DATA)) / sizeof(char) == 5 END BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(1))) / sizeof(char) == 2 END BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(9))) / sizeof(char) == 3 END +# if defined __cplusplus BEGIN sizeof(BOOST_PP_WSTRINGIZE(DATA)) / sizeof(wchar_t) == 5 END BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(1))) / sizeof(wchar_t) == 2 END BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(9))) / sizeof(wchar_t) == 3 END - +#endif #if BOOST_PP_VARIADICS BEGIN sizeof(BOOST_PP_STRINGIZE(VDATA)) / sizeof(char) == 8 END +# if defined __cplusplus BEGIN sizeof(BOOST_PP_WSTRINGIZE(VDATA)) / sizeof(wchar_t) == 8 END #endif +#endif From fe70754559fb1b36ffacc9824fa2d5c7ececee50 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Fri, 19 Oct 2018 16:57:17 -0400 Subject: [PATCH 11/13] Include wchar.h in order to test wide character stringize under C. --- test/stringize.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/stringize.cxx b/test/stringize.cxx index ebe559f..527279b 100644 --- a/test/stringize.cxx +++ b/test/stringize.cxx @@ -12,6 +12,9 @@ # include # include # include +# if !defined __cplusplus +#include +#endif # include #define VDATA 1,2,3,4 @@ -21,21 +24,15 @@ # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() BEGIN sizeof(BOOST_PP_STRINGIZE(NDATA)) / sizeof(char) == 1 END -# if defined __cplusplus BEGIN sizeof(BOOST_PP_WSTRINGIZE(NDATA)) / sizeof(wchar_t) == 1 END #endif -#endif BEGIN sizeof(BOOST_PP_STRINGIZE(DATA)) / sizeof(char) == 5 END BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(1))) / sizeof(char) == 2 END BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(9))) / sizeof(char) == 3 END -# if defined __cplusplus BEGIN sizeof(BOOST_PP_WSTRINGIZE(DATA)) / sizeof(wchar_t) == 5 END BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(1))) / sizeof(wchar_t) == 2 END BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(9))) / sizeof(wchar_t) == 3 END -#endif #if BOOST_PP_VARIADICS BEGIN sizeof(BOOST_PP_STRINGIZE(VDATA)) / sizeof(char) == 8 END -# if defined __cplusplus BEGIN sizeof(BOOST_PP_WSTRINGIZE(VDATA)) / sizeof(wchar_t) == 8 END #endif -#endif From adf2746626bf3b9140dc9373cc84a038f2e5f124 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Sat, 20 Oct 2018 14:02:20 -0400 Subject: [PATCH 12/13] Add support for vc++ /experimental:preprocessor mode. --- include/boost/preprocessor/config/config.hpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/include/boost/preprocessor/config/config.hpp b/include/boost/preprocessor/config/config.hpp index cb60403..2c1e72f 100644 --- a/include/boost/preprocessor/config/config.hpp +++ b/include/boost/preprocessor/config/config.hpp @@ -29,7 +29,11 @@ # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT()) # elif defined(__EDG__) || defined(__EDG_VERSION__) # if defined(_MSC_VER) && !defined(__clang__) && (defined(__INTELLISENSE__) || __EDG_VERSION__ >= 308) -# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC()) +# if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL +# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC()) +# else +# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT()) +# endif # else # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_EDG() | BOOST_PP_CONFIG_STRICT()) # endif @@ -44,7 +48,11 @@ # elif defined(__BORLANDC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_BCC()) # elif defined(_MSC_VER) -# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC()) +# if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL +# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC()) +# else +# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT()) +# endif # else # define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT()) # endif @@ -79,8 +87,10 @@ # /* VC++ (C/C++) and Intel C++ Compiler >= 17.0 with MSVC */ # elif defined _MSC_VER && _MSC_VER >= 1400 && (!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 +# if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL +# undef BOOST_PP_VARIADICS_MSVC +# define BOOST_PP_VARIADICS_MSVC 1 +# endif # /* Wave (C/C++), GCC (C++) */ # elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && defined __GXX_EXPERIMENTAL_CXX0X__ && __GXX_EXPERIMENTAL_CXX0X__ # define BOOST_PP_VARIADICS 1 @@ -93,7 +103,7 @@ # elif !BOOST_PP_VARIADICS + 1 < 2 # undef BOOST_PP_VARIADICS # define BOOST_PP_VARIADICS 1 -# 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)) +# 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)) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL) # undef BOOST_PP_VARIADICS_MSVC # define BOOST_PP_VARIADICS_MSVC 1 # endif From f78f0a1d25bdca8bbcc337a183b2ba5654980d5f Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Thu, 25 Oct 2018 16:57:55 -0400 Subject: [PATCH 13/13] Removing any forcing of C++ levels. --- test/Jamfile.v2 | 96 +++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 55 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index d0ad865..e12d73a 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -34,23 +34,23 @@ alias preprocessor : : alias preprocessor : - [ compile arithmetic.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile array.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile comparison.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile control.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile debug.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile facilities.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile iteration.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile list.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile logical.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile punctuation.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile repetition.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile selection.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile seq.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile slot.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile stringize.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile tuple.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile variadic.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] + [ compile arithmetic.cpp ] + [ compile array.cpp ] + [ compile comparison.cpp ] + [ compile control.cpp ] + [ compile debug.cpp ] + [ compile facilities.cpp ] + [ compile iteration.cpp ] + [ compile list.cpp ] + [ compile logical.cpp ] + [ compile punctuation.cpp ] + [ compile repetition.cpp ] + [ compile selection.cpp ] + [ compile seq.cpp ] + [ compile slot.cpp ] + [ compile stringize.cpp ] + [ compile tuple.cpp ] + [ compile variadic.cpp ] ; alias preprocessor_nvm @@ -75,63 +75,63 @@ alias preprocessor_nvm alias preprocessor_c : [ compile arithmetic.c - : gcc:-std=c99 clang-linux:-std=c99 + : : arithmetic_c ] [ compile array.c - : gcc:-std=c99 clang-linux:-std=c99 + : : array_c ] [ compile comparison.c - : gcc:-std=c99 clang-linux:-std=c99 + : : comparison_c ] [ compile control.c - : gcc:-std=c99 clang-linux:-std=c99 + : : control_c ] [ compile debug.c - : gcc:-std=c99 clang-linux:-std=c99 + : : debug_c ] [ compile facilities.c - : gcc:-std=c99 clang-linux:-std=c99 + : : facilities_c ] [ compile list.c - : gcc:-std=c99 clang-linux:-std=c99 + : : list_c ] [ compile logical.c - : gcc:-std=c99 clang-linux:-std=c99 + : : logical_c ] [ compile punctuation.c - : gcc:-std=c99 clang-linux:-std=c99 + : : punctuation_c ] [ compile selection.c - : gcc:-std=c99 clang-linux:-std=c99 + : : selection_c ] [ compile seq.c - : gcc:-std=c99 clang-linux:-std=c99 + : : seq_c ] [ compile slot.c - : gcc:-std=c99 clang-linux:-std=c99 + : : slot_c ] [ compile stringize.c - : gcc:-std=c99 clang-linux:-std=c99 + : : stringize_c ] [ compile tuple.c - : gcc:-std=c99 clang-linux:-std=c99 + : : tuple_c ] [ compile variadic.c - : gcc:-std=c99 clang-linux:-std=c99 + : : variadic_c ] ; @@ -139,68 +139,55 @@ alias preprocessor_c alias preprocessor_c_nvm : [ compile arithmetic.c - : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 + : BOOST_PP_VARIADICS=0 : arithmetic_c_nvm ] [ compile array.c - : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 + : BOOST_PP_VARIADICS=0 : array_c_nvm ] [ compile comparison.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : comparison_c_nvm ] [ compile control.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : control_c_nvm ] [ compile debug.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : debug_c_nvm ] [ compile facilities.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : facilities_c_nvm ] [ compile list.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : list_c_nvm ] [ compile logical.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : logical_c_nvm ] [ compile selection.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : selection_c_nvm ] [ compile seq.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : seq_c_nvm ] [ compile slot.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : slot_c_nvm ] [ compile stringize.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : stringize_c_nvm ] [ compile tuple.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : tuple_c_nvm ] ; @@ -222,28 +209,28 @@ alias preprocessor_isempty : : alias preprocessor_isempty : - [ compile isempty.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile-fail isempty_variadic_standard_failure.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] - [ compile-fail isempty_variadic_standard_failure2.cpp : gcc:-std=c++0x clang-linux:-std=c++0x ] + [ compile isempty.cpp ] + [ compile-fail isempty_variadic_standard_failure.cpp : BOOST_PP_VARIADICS=1 ] + [ compile-fail isempty_variadic_standard_failure2.cpp : BOOST_PP_VARIADICS=1 ] ; alias preprocessor_isempty_nvm : - [ compile isempty.cpp : BOOST_PP_VARIADICS=0 : isempty_nvm ] + [ compile isempty.cpp : BOOST_PP_VARIADICS=0 : isempty_nvm ] ; alias preprocessor_isempty_c : [ compile isempty.c - : gcc:-std=c99 clang-linux:-std=c99 + : : isempty_c ] [ compile-fail isempty_variadic_standard_failure.c - : gcc:-std=c99 clang-linux:-std=c99 + : BOOST_PP_VARIADICS=1 : isempty_variadic_standard_failure_c ] [ compile-fail isempty_variadic_standard_failure2.c - : gcc:-std=c99 clang-linux:-std=c99 + : BOOST_PP_VARIADICS=1 : isempty_variadic_standard_failure2_c ] ; @@ -252,7 +239,6 @@ alias preprocessor_isempty_c_nvm : [ compile isempty.c : BOOST_PP_VARIADICS=0 - gcc:-std=c99 clang-linux:-std=c99 : isempty_c_nvm ] ;