diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-08-26 20:52:28 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-08-26 20:52:28 (GMT) |
commit | 5f806090d78dfe3c778549a6d283698b211377d1 (patch) | |
tree | b49f4721899adf309fbbe567ce5fb5b5f0e8499b /src | |
parent | f8e486a761a2f1e830af2cb1d0c26a927aa12a8b (diff) | |
parent | 5a0804b5c9eac426e2b0d690ae479caf8f89848e (diff) | |
download | hdf5-5f806090d78dfe3c778549a6d283698b211377d1.zip hdf5-5f806090d78dfe3c778549a6d283698b211377d1.tar.gz hdf5-5f806090d78dfe3c778549a6d283698b211377d1.tar.bz2 |
Merge pull request #2852 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:hdfs_symbol_fix_1_10 to hdf5_1_10
* commit '5a0804b5c9eac426e2b0d690ae479caf8f89848e':
Adds helpful error messages to the HDFS VFD stubs.
Adds binary compatibility HDFS VFD stubs.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDhdfs.c | 52 | ||||
-rw-r--r-- | src/H5FDhdfs.h | 2 |
2 files changed, 51 insertions, 3 deletions
diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index b4f70c9..c604c9c 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -20,8 +20,14 @@ * File System (HDFS). */ -/* This source code file is part of the H5FD driver module */ +#ifdef H5_HAVE_LIBHDFS +/* This source code file is part of the H5FD driver module + * NOTE: If we're just building the binary compatibility stubs, + * we're never going to really initialize the package, so we + * don't include this. + */ #include "H5FDdrvr_module.h" +#endif /* H5_HAVE_LIBHDFS */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ @@ -1735,5 +1741,49 @@ H5FD__hdfs_unlock(H5FD_t H5_ATTR_UNUSED *_file) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD__hdfs_unlock() */ + +#else /* H5_HAVE_LIBHDFS */ + +/* No-op stubs to avoid binary compatibility problems with previous + * HDF5 1.10 versions. Non-functional versions of these API calls were + * erroneously included in the library even when the HDFS VFD was not + * configured. + */ +hid_t +H5FD_hdfs_init(void) +{ + /* This should never be called since the header doesn't invoke it */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_LEAVE_NOAPI(H5I_INVALID_HID) +} + +herr_t +H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out) +{ + herr_t ret_value = FAIL; + + FUNC_ENTER_API_NOINIT + H5TRACE2("e", "i*x", fapl_id, fa_out); + + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "HDFS VFD not included in the HDF5 library") + +done: + FUNC_LEAVE_API_NOINIT(ret_value) +} + +herr_t +H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa) +{ + herr_t ret_value = FAIL; + + FUNC_ENTER_API_NOINIT + H5TRACE2("e", "i*x", fapl_id, fa); + + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "HDFS VFD not included in the HDF5 library") + +done: + FUNC_LEAVE_API_NOINIT(ret_value) +} + #endif /* H5_HAVE_LIBHDFS */ diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h index e195550..58d7e6e 100644 --- a/src/H5FDhdfs.h +++ b/src/H5FDhdfs.h @@ -28,7 +28,6 @@ #define H5FD_HDFS (-1) #endif /* H5_HAVE_LIBHDFS */ -#ifdef H5_HAVE_LIBHDFS /**************************************************************************** * * Structure: H5FD_hdfs_fapl_t @@ -119,7 +118,6 @@ H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa); #ifdef __cplusplus } #endif -#endif /* H5_HAVE_LIBHDFS */ #endif /* ifndef H5FDhdfs_H */ |