macros.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016 OpenFOAM Foundation
9 Copyright (C) 2018 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Description
28 General C-preprocessor macros
29
30\*---------------------------------------------------------------------------*/
31
32#ifndef macros_H
33#define macros_H
34
35// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36
37//- Concatenate two preprocessor tokens
38#define CAT_(a, b) a ## b
39#define CAT(a, b) CAT_(a, b)
40
41//- Concatenate three preprocessor tokens
42#define CAT3_(a, b, c) a ## b ## c
43#define CAT3(a, b, c) CAT3_(a, b, c)
44
45//- Concatenate four preprocessor tokens
46#define CAT4_(a, b, c, d) a ## b ## c ## d
47#define CAT4(a, b, c, d) CAT4_(a, b, c, d)
48
49//- Concatenate five preprocessor tokens
50#define CAT5_(a, b, c, d, e) a ## b ## c ## d ## e
51#define CAT5(a, b, c, d, e) CAT5_(a, b, c, d, e)
52
53//- Generate an identifier unique within the file in which it is generated
54#define FILE_UNIQUE(x) CAT(x, __LINE__)
55
56//- Map 'name' to 'Name' via the predefined macro CAPITALIZE_name
57#define CAPITALIZE(name) CAPITALIZE_##name
58
59//- Helper macro for STRING_QUOTE
60#define STRINGIFY(content) #content
61
62//- Macro to stringify macro contents
63#define STRING_QUOTE(input) STRINGIFY(input)
64
65
66// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67
68#endif
69
70// ************************************************************************* //