mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-06-30 06:20:57 +02:00
Compare commits
11 Commits
boost-1.62
...
boost-1.64
Author | SHA1 | Date | |
---|---|---|---|
a6275942f3 | |||
d8389ffda6 | |||
075a3a02c8 | |||
dc41624aba | |||
4ae346bbc5 | |||
d922d757be | |||
eb143c10f8 | |||
e1e3a2e21e | |||
e70abe7b49 | |||
ee73989a21 | |||
7835ed019c |
39
.travis.yml
Normal file
39
.travis.yml
Normal file
@ -0,0 +1,39 @@
|
||||
# Copyright 2016 Edward Diener
|
||||
# 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)
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
python: "2.7"
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init --depth 1 tools/build
|
||||
- git submodule update --init --depth 1 libs/config
|
||||
- git submodule update --init --depth 1 tools/boostdep
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/preprocessor
|
||||
- python tools/boostdep/depinst/depinst.py preprocessor
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
|
||||
script:
|
||||
- TOOLSET=gcc,clang
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then TOOLSET=clang; fi
|
||||
- ./b2 libs/preprocessor/test toolset=$TOOLSET
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: always
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
55
include/boost/preprocessor/seq/detail/to_list_msvc.hpp
Normal file
55
include/boost/preprocessor/seq/detail/to_list_msvc.hpp
Normal file
@ -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
|
@ -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
|
||||
|
149
test/Jamfile.v2
149
test/Jamfile.v2
@ -17,27 +17,42 @@ project preprocessor_tests : requirements <warnings>on
|
||||
<toolset>msvc:<warnings>all
|
||||
;
|
||||
|
||||
test-suite preprocessor
|
||||
alias preprocessor : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>3.4
|
||||
;
|
||||
|
||||
alias preprocessor : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>4.1
|
||||
;
|
||||
|
||||
alias preprocessor : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>4.2
|
||||
;
|
||||
|
||||
alias preprocessor
|
||||
:
|
||||
[ compile arithmetic.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile array.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile comparison.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile control.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile debug.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile facilities.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile iteration.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile list.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile logical.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile punctuation.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile repetition.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile selection.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile seq.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile slot.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile tuple.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile variadic.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile arithmetic.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile array.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile comparison.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile control.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile debug.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile facilities.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile iteration.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile list.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile logical.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile punctuation.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile repetition.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile selection.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile seq.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile slot.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile tuple.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile variadic.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_nvm
|
||||
alias preprocessor_nvm
|
||||
:
|
||||
[ compile arithmetic.cpp : <define>BOOST_PP_VARIADICS=0 : arithmetic_nvm ]
|
||||
[ compile array.cpp : <define>BOOST_PP_VARIADICS=0 : array_nvm ]
|
||||
@ -55,163 +70,183 @@ test-suite preprocessor_nvm
|
||||
[ compile tuple.cpp : <define>BOOST_PP_VARIADICS=0 : tuple_nvm ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_c
|
||||
alias preprocessor_c
|
||||
:
|
||||
[ compile arithmetic.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: arithmetic_c
|
||||
]
|
||||
[ compile array.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: array_c
|
||||
]
|
||||
[ compile comparison.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: comparison_c
|
||||
]
|
||||
[ compile control.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: control_c
|
||||
]
|
||||
[ compile debug.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: debug_c
|
||||
]
|
||||
[ compile facilities.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: facilities_c
|
||||
]
|
||||
[ compile list.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: list_c
|
||||
]
|
||||
[ compile logical.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: logical_c
|
||||
]
|
||||
[ compile punctuation.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: punctuation_c
|
||||
]
|
||||
[ compile selection.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: selection_c
|
||||
]
|
||||
[ compile seq.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: seq_c
|
||||
]
|
||||
[ compile slot.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: slot_c
|
||||
]
|
||||
[ compile tuple.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: tuple_c
|
||||
]
|
||||
[ compile variadic.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: variadic_c
|
||||
]
|
||||
;
|
||||
|
||||
test-suite preprocessor_c_nvm
|
||||
alias preprocessor_c_nvm
|
||||
:
|
||||
[ compile arithmetic.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: arithmetic_c_nvm
|
||||
]
|
||||
[ compile array.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: array_c_nvm
|
||||
]
|
||||
[ compile comparison.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: comparison_c_nvm
|
||||
]
|
||||
[ compile control.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: control_c_nvm
|
||||
]
|
||||
[ compile debug.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: debug_c_nvm
|
||||
]
|
||||
[ compile facilities.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: facilities_c_nvm
|
||||
]
|
||||
[ compile list.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: list_c_nvm
|
||||
]
|
||||
[ compile logical.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: logical_c_nvm
|
||||
]
|
||||
[ compile selection.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: selection_c_nvm
|
||||
]
|
||||
[ compile seq.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: seq_c_nvm
|
||||
]
|
||||
[ compile slot.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: slot_c_nvm
|
||||
]
|
||||
[ compile tuple.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: tuple_c_nvm
|
||||
]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty
|
||||
alias preprocessor_isempty : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>3.4
|
||||
;
|
||||
|
||||
alias preprocessor_isempty : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>4.1
|
||||
;
|
||||
|
||||
alias preprocessor_isempty : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>4.2
|
||||
;
|
||||
|
||||
alias preprocessor_isempty
|
||||
:
|
||||
[ compile isempty.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile-fail isempty_variadic_standard_failure.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile-fail isempty_variadic_standard_failure2.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile isempty.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile-fail isempty_variadic_standard_failure.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile-fail isempty_variadic_standard_failure2.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty_nvm
|
||||
alias preprocessor_isempty_nvm
|
||||
:
|
||||
[ compile isempty.cpp : <define>BOOST_PP_VARIADICS=0 : isempty_nvm ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty_c
|
||||
alias preprocessor_isempty_c
|
||||
:
|
||||
[ compile isempty.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: isempty_c
|
||||
]
|
||||
[ compile-fail isempty_variadic_standard_failure.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: isempty_variadic_standard_failure_c
|
||||
]
|
||||
[ compile-fail isempty_variadic_standard_failure2.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: isempty_variadic_standard_failure2_c
|
||||
]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty_c_nvm
|
||||
alias preprocessor_isempty_c_nvm
|
||||
:
|
||||
[ compile isempty.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: isempty_c_nvm
|
||||
]
|
||||
;
|
||||
|
||||
alias preprocessor_config
|
||||
:
|
||||
[ run config_info.cpp ]
|
||||
;
|
||||
|
93
test/config_info.cpp
Normal file
93
test/config_info.cpp
Normal file
@ -0,0 +1,93 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <string.h>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
|
||||
static unsigned int indent = 4;
|
||||
static unsigned int width = 40;
|
||||
|
||||
using std::cout;
|
||||
using std::istream;
|
||||
|
||||
void print_separator()
|
||||
{
|
||||
std::cout <<
|
||||
"\n\n*********************************************************************\n\n";
|
||||
}
|
||||
|
||||
void print_macro(const char* name, const char* value)
|
||||
{
|
||||
// if name == value+1 then then macro is not defined,
|
||||
// in which case we don't print anything:
|
||||
if(0 != strcmp(name, value+1))
|
||||
{
|
||||
for(unsigned i = 0; i < indent; ++i) std::cout.put(' ');
|
||||
std::cout << std::setw(width);
|
||||
cout.setf(istream::left, istream::adjustfield);
|
||||
std::cout << name;
|
||||
if(value[1])
|
||||
{
|
||||
// macro has a value:
|
||||
std::cout << value << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
// macro is defined but has no value:
|
||||
std::cout << " [no value]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define PRINT_MACRO(X) print_macro(#X, BOOST_PP_STRINGIZE(=X))
|
||||
|
||||
void print_macros()
|
||||
{
|
||||
|
||||
print_separator();
|
||||
|
||||
PRINT_MACRO(__GCCXML__);
|
||||
PRINT_MACRO(__WAVE__);
|
||||
PRINT_MACRO(__MWERKS__);
|
||||
PRINT_MACRO(__EDG__);
|
||||
PRINT_MACRO(_MSC_VER);
|
||||
PRINT_MACRO(__clang__);
|
||||
PRINT_MACRO(__DMC__);
|
||||
PRINT_MACRO(__BORLANDC__);
|
||||
PRINT_MACRO(__IBMC__);
|
||||
PRINT_MACRO(__IBMCPP__);
|
||||
PRINT_MACRO(__SUNPRO_CC);
|
||||
PRINT_MACRO(__CUDACC__);
|
||||
PRINT_MACRO(__PATHSCALE__);
|
||||
PRINT_MACRO(__CODEGEARC__);
|
||||
PRINT_MACRO(__HP_aCC);
|
||||
PRINT_MACRO(__SC__);
|
||||
PRINT_MACRO(__MRC__);
|
||||
PRINT_MACRO(__PGI);
|
||||
PRINT_MACRO(__INTEL_COMPILER);
|
||||
PRINT_MACRO(__GNUC__);
|
||||
PRINT_MACRO(__GXX_EXPERIMENTAL_CXX0X__);
|
||||
|
||||
print_separator();
|
||||
|
||||
PRINT_MACRO(__cplusplus);
|
||||
PRINT_MACRO(__STDC_VERSION__);
|
||||
PRINT_MACRO(__EDG_VERSION__);
|
||||
PRINT_MACRO(__INTELLISENSE__);
|
||||
PRINT_MACRO(__WAVE_HAS_VARIADICS__);
|
||||
|
||||
print_separator();
|
||||
|
||||
PRINT_MACRO(BOOST_PP_CONFIG_ERRORS);
|
||||
PRINT_MACRO(BOOST_PP_CONFIG_EXTENDED_LINE_INFO);
|
||||
PRINT_MACRO(BOOST_PP_CONFIG_FLAGS());
|
||||
PRINT_MACRO(BOOST_PP_VARIADICS);
|
||||
PRINT_MACRO(BOOST_PP_VARIADICS_MSVC);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
print_macros();
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user