stringize.cxx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #define VDATA 1,2,3,4
  20. #define NDATA
  21. #define DATA data
  22. #define FDATA(x) BOOST_PP_INC(x)
  23. # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
  24. BEGIN sizeof(BOOST_PP_STRINGIZE(NDATA)) / sizeof(char) == 1 END
  25. BEGIN sizeof(BOOST_PP_WSTRINGIZE(NDATA)) / sizeof(wchar_t) == 1 END
  26. #endif
  27. BEGIN sizeof(BOOST_PP_STRINGIZE(DATA)) / sizeof(char) == 5 END
  28. BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(1))) / sizeof(char) == 2 END
  29. BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(9))) / sizeof(char) == 3 END
  30. BEGIN sizeof(BOOST_PP_WSTRINGIZE(DATA)) / sizeof(wchar_t) == 5 END
  31. BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(1))) / sizeof(wchar_t) == 2 END
  32. BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(9))) / sizeof(wchar_t) == 3 END
  33. #if BOOST_PP_VARIADICS
  34. BEGIN sizeof(BOOST_PP_STRINGIZE(VDATA)) / sizeof(char) == 8 END
  35. BEGIN sizeof(BOOST_PP_WSTRINGIZE(VDATA)) / sizeof(wchar_t) == 8 END
  36. #endif