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:
parent
e377522879
commit
945116a54b
@ -19,10 +19,13 @@
|
|||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
#include <triqs/arrays.hpp>
|
#include <triqs/arrays.hpp>
|
||||||
#include <triqs/h5/serialization.hpp>
|
|
||||||
#include <iostream>
|
#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::serialize;
|
||||||
using triqs::h5::deserialize;
|
using triqs::h5::deserialize;
|
||||||
@ -52,6 +55,6 @@ int main() {
|
|||||||
|
|
||||||
std::cout << "a = " << a << " == " << b << std::endl;
|
std::cout << "a = " << a << " == " << b << std::endl;
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
11
triqs/h5.hpp
11
triqs/h5.hpp
@ -25,5 +25,16 @@
|
|||||||
#include "./h5/vector.hpp"
|
#include "./h5/vector.hpp"
|
||||||
#include "./h5/string.hpp"
|
#include "./h5/string.hpp"
|
||||||
//#include "./h5/make_h5_read_write.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
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user