From 2c498d302488e7fa7ea768e95a6d96a1ea8a6401 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 9 Jul 2018 09:17:26 -0500 Subject: [PATCH] Use std::complex (C++11 guarantees layout compatibility) --- src/hdf5_interface.cpp | 2 +- src/hdf5_interface.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 9226cb9ad..726e036e6 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -425,7 +425,7 @@ read_string(hid_t obj_id, const char* name, size_t slen, char* buffer, bool inde void -read_complex(hid_t obj_id, const char* name, double _Complex* buffer, bool indep) +read_complex(hid_t obj_id, const char* name, std::complex* buffer, bool indep) { // Create compound datatype for complex numbers struct complex_t { diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 152c52c1c..d7d30e0a0 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -5,11 +5,11 @@ #include "hdf5_hl.h" #include +#include #include #include #include #include -#include #include "position.h" @@ -21,7 +21,7 @@ namespace openmc { //============================================================================== void read_attr(hid_t obj_id, const char* name, hid_t mem_type_id, - const void* buffer); + void* buffer); void write_attr(hid_t obj_id, int ndim, const hsize_t* dims, const char* name, hid_t mem_type_id, const void* buffer); void read_dataset(hid_t obj_id, const char* name, hid_t mem_type_id, @@ -101,7 +101,7 @@ extern "C" { void read_attr_string(hid_t obj_id, const char* name, size_t slen, char* buffer); void read_complex(hid_t obj_id, const char* name, - double _Complex* buffer, bool indep); + std::complex* buffer, bool indep); void read_double(hid_t obj_id, const char* name, double* buffer, bool indep); void read_int(hid_t obj_id, const char* name, int* buffer,