openPMD-api
Unused.hpp
1 
2 /* Copyright 2021-2021 Franz Poeschel
3  *
4  * This file is part of openPMD-api.
5  *
6  * openPMD-api is free software: you can redistribute it and/or modify
7  * it under the terms of of either the GNU General Public License or
8  * the GNU Lesser General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * openPMD-api is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License and the GNU Lesser General Public License
16  * for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * and the GNU Lesser General Public License along with openPMD-api.
20  * If not, see <http://www.gnu.org/licenses/>.
21  */
22 #pragma once
23 
24 
25 #if __cplusplus >= 201703L
26 # define OPENPMDAPI_UNUSED [[maybe_unused]]
27 #else
28 # ifdef __clang__
29 # define OPENPMDAPI_UNUSED __attribute__((unused))
30 # elif defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__)
31 # define OPENPMDAPI_UNUSED [[gnu::unused]]
32 # else
33 # define OPENPMDAPI_UNUSED
34 # endif
35 #endif