Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
stringize.hpp
Go to the documentation of this file.
1// Copyright 2024, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_COMPILER_SUPPORT_PREPROCESSOR_STRINGIZE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_COMPILER_SUPPORT_PREPROCESSOR_STRINGIZE_HPP_
7
8// IWYU pragma: private, include "arene/base/compiler_support/preprocessor.hpp"
9
10// AUTOSAR exceptions:
11// A16-0-1 The pre-processor shall only be used for unconditional and
12// conditional file inclusion and include guards, and using the following
13// directives: (1) #ifndef, (2) #ifdef, (3) #if, (4) #if defined, (5) #elif, (6)
14// #else, (7) #define, (8) #endif, (9) #include.
15//
16// Exception Rationale: The code below is used to safely convert a macro
17// argument to a string literal, for use in supporting other basic facilities
18// such as the contract checking.
19
20// NOLINTBEGIN(cppcoreguidelines-macro-usage)
21// parasoft-begin-suppress AUTOSAR-A16_0_1-d-2 "Function-like macro permitted by A16-0-1 Permit #1"
22
23/// Internal macro for actually converting a macro argument to a string literal.
24/// DO NOT CALL DIRECTLY.
25/// @param ... the macro argument to convert.
26// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
27#define ARENE_STRINGIZE_INTERNAL(...) #__VA_ARGS__
28/// Macro for actually converting a macro argument to a string literal.
29/// @param ... the macro argument to convert.
30// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
31#define ARENE_STRINGIZE(...) ARENE_STRINGIZE_INTERNAL(__VA_ARGS__)
32
33// NOLINTEND(cppcoreguidelines-macro-usage)
34// parasoft-end-suppress AUTOSAR-A16_0_1-d-2
35
36#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_COMPILER_SUPPORT_PREPROCESSOR_STRINGIZE_HPP_
#define ARENE_STRINGIZE_INTERNAL(...)
Definition stringize.hpp:27