3
0
mirror of https://github.com/triqs/dft_tools synced 2024-10-31 19:23:45 +01:00

Fix h5 serialization: no test for old hdf5

- if version is  < 1.8.9, the test is ignored.
This commit is contained in:
Olivier Parcollet 2014-05-21 11:05:48 +02:00
parent e377522879
commit 945116a54b
2 changed files with 17 additions and 3 deletions

View File

@ -19,10 +19,13 @@
*
******************************************************************************/
#include <triqs/arrays.hpp>
#include <triqs/h5/serialization.hpp>
#include <iostream>
#if H5_VERSION_GE(1, 8, 9)
#if not H5_VERSION_GE(1,8,9)
int main() {}
#else
#include <triqs/h5/serialization.hpp>
using triqs::h5::serialize;
using triqs::h5::deserialize;
@ -52,6 +55,6 @@ int main() {
std::cout << "a = " << a << " == " << b << std::endl;
#endif
}
#endif

View File

@ -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