diff options
| author | Martin Hořeňovský | 2023-05-07 12:09:22 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-05-07 20:58:54 +0200 |
| commit | 0dc82e08dfec25faf6c6c145f3592984db7276cc (patch) | |
| tree | ad687a3fdb6968b5e5f654302bf1386692bb7fe6 /src/catch2/internal | |
| parent | 8ca504cbc956d566ea77a8d59928146ad4cc3844 (diff) | |
| download | catch3-0dc82e08dfec25faf6c6c145f3592984db7276cc.tar.gz | |
Move CATCH_INTERNAL_STRINGIFY macro into its own header
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_preprocessor_internal_stringify.hpp | 19 | ||||
| -rw-r--r-- | src/catch2/internal/catch_test_macro_impl.hpp | 7 |
2 files changed, 20 insertions, 6 deletions
diff --git a/src/catch2/internal/catch_preprocessor_internal_stringify.hpp b/src/catch2/internal/catch_preprocessor_internal_stringify.hpp new file mode 100644 index 00000000..2fd64e1c --- /dev/null +++ b/src/catch2/internal/catch_preprocessor_internal_stringify.hpp @@ -0,0 +1,19 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED +#define CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED + +#include <catch2/catch_user_config.hpp> + +#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION) + #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__##_catch_sr +#else + #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"_catch_sr +#endif + +#endif // CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED diff --git a/src/catch2/internal/catch_test_macro_impl.hpp b/src/catch2/internal/catch_test_macro_impl.hpp index e569680b..8ed672ca 100644 --- a/src/catch2/internal/catch_test_macro_impl.hpp +++ b/src/catch2/internal/catch_test_macro_impl.hpp @@ -10,6 +10,7 @@ #include <catch2/catch_user_config.hpp> #include <catch2/internal/catch_assertion_handler.hpp> +#include <catch2/internal/catch_preprocessor_internal_stringify.hpp> #include <catch2/interfaces/catch_interfaces_capture.hpp> #include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_source_line_info.hpp> @@ -22,12 +23,6 @@ #if !defined(CATCH_CONFIG_DISABLE) -#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION) - #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__##_catch_sr -#else - #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"_catch_sr -#endif - #if defined(CATCH_CONFIG_FAST_COMPILE) || defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) /////////////////////////////////////////////////////////////////////////////// |