From 8c96824d70d05207db678a79092efdc9ce7c19df Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 16 Jul 2026 12:22:14 -0500 Subject: [PATCH] Fix dsets.c to use H5Z_find() instead of the now-hidden H5Z_SZIP global The previous commit (498ebe39482) 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. --- test/dsets.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 050be09a394..9e1d348cf49 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -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 */