1 # /* ************************************************************************** 2 # * * 3 # * (C) Copyright Edward Diener 2018. 4 # * Distributed under the Boost Software License, Version 1.0. (See 5 # * accompanying file LICENSE_1_0.txt or copy at 6 # * http://www.boost.org/LICENSE_1_0.txt) 7 # * * 8 # ************************************************************************** */ 9 # 10 # /* See http://www.boost.org for most recent version. */ 11 # 12 # include <boost/preprocessor/stringize.hpp> 13 # include <boost/preprocessor/wstringize.hpp> 14 # include <boost/preprocessor/arithmetic/inc.hpp> 15 # if !defined __cplusplus 16 #include <wchar.h> 17 #endif 18 # include <libs/preprocessor/test/test.h> 19 20 #define VDATA 1,2,3,4 21 #define NDATA 22 #define DATA data 23 #define FDATA(x) BOOST_PP_INC(x) 24 25 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() 26 BEGIN sizeof(BOOST_PP_STRINGIZE(NDATA)) / sizeof(char) == 1 END 27 BEGIN sizeof(BOOST_PP_WSTRINGIZE(NDATA)) / sizeof(wchar_t) == 1 END 28 #endif 29 BEGIN sizeof(BOOST_PP_STRINGIZE(DATA)) / sizeof(char) == 5 END 30 BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(1))) / sizeof(char) == 2 END 31 BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(9))) / sizeof(char) == 3 END 32 BEGIN sizeof(BOOST_PP_WSTRINGIZE(DATA)) / sizeof(wchar_t) == 5 END 33 BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(1))) / sizeof(wchar_t) == 2 END 34 BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(9))) / sizeof(wchar_t) == 3 END 35 BEGIN sizeof(BOOST_PP_STRINGIZE(VDATA)) / sizeof(char) == 8 END 36 BEGIN sizeof(BOOST_PP_WSTRINGIZE(VDATA)) / sizeof(wchar_t) == 8 END 37