Skip to content

Commit

Permalink
Some fixes for DatatypeMacros
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Nov 9, 2023
1 parent 01fa2c3 commit 54f14bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 6 additions & 4 deletions include/openPMD/DatatypeMacros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
* and the GNU Lesser General Public License along with openPMD-api.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once

// sic!
// no #pragma once
// Since the macros can be un-defined with UndefDatatypeMacros.hpp, this header
// may be included multiple times into one translation unit

#include <array>
#include <complex>
Expand Down Expand Up @@ -89,7 +93,6 @@ using openpmd_array_double_7 = std::array<double, 7>;
MACRO(std::complex<double>) \
MACRO(std::complex<long double>) \
MACRO(std::string) \
MACRO(array_double_7) \
MACRO(bool)

#define OPENPMD_FOREACH_DATASET_DATATYPE(MACRO) \
Expand All @@ -109,5 +112,4 @@ using openpmd_array_double_7 = std::array<double, 7>;
MACRO(long double) \
MACRO(std::complex<float>) \
MACRO(std::complex<double>) \
MACRO(std::complex<long double>) \
MACRO(std::array<double, 7>)
MACRO(std::complex<long double>)
5 changes: 4 additions & 1 deletion include/openPMD/backend/Attribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
#pragma once

#include "openPMD/Datatype.hpp"
#include "openPMD/DatatypeMacros.hpp"
#include "openPMD/auxiliary/TypeTraits.hpp"
#include "openPMD/auxiliary/Variant.hpp"

// comment to prevent clang-format from moving this #include up
// datatype macros may be included and un-included in other headers
#include "openPMD/DatatypeMacros.hpp"

#include <algorithm>
#include <array>
#include <complex>
Expand Down

0 comments on commit 54f14bc

Please sign in to comment.