diff --git a/test/triqs/utility/h5_seria.cpp b/test/triqs/utility/h5_seria.cpp index f7436d76..c8b9b3e1 100644 --- a/test/triqs/utility/h5_seria.cpp +++ b/test/triqs/utility/h5_seria.cpp @@ -19,10 +19,13 @@ * ******************************************************************************/ #include -#include #include -#if H5_VERSION_GE(1, 8, 9) +#if not H5_VERSION_GE(1,8,9) +int main() {} +#else + +#include using triqs::h5::serialize; using triqs::h5::deserialize; @@ -52,6 +55,6 @@ int main() { std::cout << "a = " << a << " == " << b << std::endl; -#endif } +#endif diff --git a/triqs/h5.hpp b/triqs/h5.hpp index 8fa541a0..100b6a47 100644 --- a/triqs/h5.hpp +++ b/triqs/h5.hpp @@ -25,5 +25,16 @@ #include "./h5/vector.hpp" #include "./h5/string.hpp" //#include "./h5/make_h5_read_write.hpp" + +// in some old version, the macro is not defined. +#ifndef H5_VERSION_GE + +#define H5_VERSION_GE(Maj,Min,Rel) \ + (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE>=Rel)) || \ + ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR>Min)) || \ + (H5_VERS_MAJOR>Maj)) + +#endif + #endif