Fix dsets.c to use H5Z_find() instead of the now-hidden H5Z_SZIP global

The previous commit (498ebe3948) hid H5Z_SZIP's dynamic-symbol
visibility, which broke linking dsets against libhdf5 on platforms
whose linker enforces hidden-symbol import restrictions across shared
library boundaries (FreeBSD/OpenBSD's lld; apparently tolerated by the
GNU linker used in local/Linux CI). H5Z_find() is the existing
package-private lookup function for exactly this kind of internal
access and, being a properly HDF5-namespaced function rather than a
bare global data symbol, carries none of the third-party symbol
collision risk that motivated hiding the raw struct globals.
This commit is contained in:
Scot Breitenfeld
2026-07-16 12:22:47 -05:00
parent 41f26b6ad5
commit 8c96824d70
+16 -9
View File
@@ -2738,18 +2738,25 @@ test_get_filter_info(void)
#endif
#ifdef H5_HAVE_FILTER_SZIP
if (H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0)
TEST_ERROR;
{
H5Z_class2_t *szip_cls;
if (H5Z_SZIP->encoder_present) {
if (((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) ||
((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0))
if (H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0)
TEST_ERROR;
}
else {
if (((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) != 0) ||
((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0))
if (H5Z_find(false, H5Z_FILTER_SZIP, &szip_cls) < 0)
TEST_ERROR;
if (szip_cls->encoder_present) {
if (((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) ||
((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0))
TEST_ERROR;
}
else {
if (((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) != 0) ||
((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0))
TEST_ERROR;
}
}
#endif /* H5_HAVE_FILTER_SZIP */