helper_macros.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED
  2. #define BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED
  3. // Copyright 2001 John Maddock.
  4. // Copyright 2017 Peter Dimov.
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. //
  8. // See accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt
  10. //
  11. // BOOST_STRINGIZE(X)
  12. // BOOST_JOIN(X, Y)
  13. //
  14. // Note that this header is C compatible.
  15. //
  16. // Helper macro BOOST_STRINGIZE:
  17. // Converts the parameter X to a string after macro replacement
  18. // on X has been performed.
  19. //
  20. #define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
  21. #define BOOST_DO_STRINGIZE(X) #X
  22. //
  23. // Helper macro BOOST_JOIN:
  24. // The following piece of macro magic joins the two
  25. // arguments together, even when one of the arguments is
  26. // itself a macro (see 16.3.1 in C++ standard). The key
  27. // is that macro expansion of macro arguments does not
  28. // occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
  29. //
  30. #define BOOST_JOIN(X, Y) BOOST_DO_JOIN(X, Y)
  31. #define BOOST_DO_JOIN(X, Y) BOOST_DO_JOIN2(X,Y)
  32. #define BOOST_DO_JOIN2(X, Y) X##Y
  33. #endif // BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED