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 @@ -684,20 +684,18 @@ impl Config {
684684 }
685685
686686 fn check_against_features_required ( & self ) {
687- if feature_enabled ( "DEPRECATED" ) {
688- assert ! ( !self . header. have_no_deprecated, "Required deprecated symbols are not present" )
689- }
690- if feature_enabled ( "THREADSAFE" ) {
691- assert ! (
692- self . header. have_threadsafe,
693- "Required threadsafe but library was not build using the threadsafe option"
694- ) ;
695- }
696- if feature_enabled ( "ZLIB" ) {
697- assert ! (
698- self . header. have_zlib,
699- "Required zlib filter but library does not have builtin support for this options"
700- ) ;
687+ let h = & self . header ;
688+ for ( flag, feature, native) in [
689+ ( h. have_no_deprecated , "deprecated" , "HDF5_ENABLE_DEPRECATED_SYMBOLS" ) ,
690+ ( h. have_threadsafe , "threadsafe" , "HDF5_ENABLE_THREADSAFE" ) ,
691+ ( h. have_zlib , "zlib" , "HDF5_ENABLE_Z_LIB_SUPPORT" ) ,
692+ ] {
693+ if feature_enabled ( & feature. to_ascii_uppercase ( ) ) {
694+ assert ! (
695+ flag,
696+ "Enabled feature {feature:?} but the HDF5 library was not built with {native}"
697+ ) ;
698+ }
701699 }
702700 }
703701}
You can’t perform that action at this time.
0 commit comments