File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -654,20 +654,18 @@ impl Config {
654654 }
655655
656656 fn check_against_features_required ( & self ) {
657- if feature_enabled ( "DEPRECATED" ) {
658- assert ! ( !self . header. have_no_deprecated, "Required deprecated symbols are not present" )
659- }
660- if feature_enabled ( "THREADSAFE" ) {
661- assert ! (
662- self . header. have_threadsafe,
663- "Required threadsafe but library was not build using the threadsafe option"
664- ) ;
665- }
666- if feature_enabled ( "ZLIB" ) {
667- assert ! (
668- self . header. have_zlib,
669- "Required zlib filter but library does not have builtin support for this options"
670- ) ;
657+ let h = & self . header ;
658+ for ( flag, feature, native) in [
659+ ( h. have_no_deprecated , "deprecated" , "HDF5_ENABLE_DEPRECATED_SYMBOLS" ) ,
660+ ( h. have_threadsafe , "threadsafe" , "HDF5_ENABLE_THREADSAFE" ) ,
661+ ( h. have_zlib , "zlib" , "HDF5_ENABLE_Z_LIB_SUPPORT" ) ,
662+ ] {
663+ if feature_enabled ( & feature. to_ascii_uppercase ( ) ) {
664+ assert ! (
665+ flag,
666+ "Enabled feature {feature:?} but the HDF5 library was not built with {native}"
667+ ) ;
668+ }
671669 }
672670 }
673671}
You can’t perform that action at this time.
0 commit comments