Skip to content

Commit

Permalink
restore fixes for MS build
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik authored and wonder-sk committed Jul 19, 2018
1 parent 21613cd commit f54a23e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion external/mdal/frmts/mdal_hdf5.hpp
Expand Up @@ -27,7 +27,7 @@ struct HdfString
char data [HDF_MAX_NAME]; char data [HDF_MAX_NAME];
}; };


template <int TYPE> inline void hdfClose( hid_t id ) { assert( false ); } template <int TYPE> inline void hdfClose( hid_t id ) { MDAL_UNUSED( id ); assert( false ); }
template <> inline void hdfClose<H5I_FILE>( hid_t id ) { H5Fclose( id ); } template <> inline void hdfClose<H5I_FILE>( hid_t id ) { H5Fclose( id ); }
template <> inline void hdfClose<H5I_GROUP>( hid_t id ) { H5Gclose( id ); } template <> inline void hdfClose<H5I_GROUP>( hid_t id ) { H5Gclose( id ); }
template <> inline void hdfClose<H5I_DATASET>( hid_t id ) { H5Dclose( id ); } template <> inline void hdfClose<H5I_DATASET>( hid_t id ) { H5Dclose( id ); }
Expand Down
1 change: 1 addition & 0 deletions external/mdal/mdal_loader.cpp
Expand Up @@ -8,6 +8,7 @@
#include "frmts/mdal_2dm.hpp" #include "frmts/mdal_2dm.hpp"
#include "frmts/mdal_ascii_dat.hpp" #include "frmts/mdal_ascii_dat.hpp"
#include "frmts/mdal_binary_dat.hpp" #include "frmts/mdal_binary_dat.hpp"
#include "mdal_utils.hpp"


#ifdef HAVE_HDF5 #ifdef HAVE_HDF5
#include "frmts/mdal_xmdf.hpp" #include "frmts/mdal_xmdf.hpp"
Expand Down
10 changes: 9 additions & 1 deletion external/mdal/mdal_utils.cpp
Expand Up @@ -4,6 +4,7 @@
*/ */


#include "mdal_utils.hpp" #include "mdal_utils.hpp"
#include <string>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
Expand Down Expand Up @@ -101,7 +102,14 @@ bool MDAL::contains( const std::string &str, const std::string &substr, Contains
auto it = std::search( auto it = std::search(
str.begin(), str.end(), str.begin(), str.end(),
substr.begin(), substr.end(), substr.begin(), substr.end(),
[]( char ch1, char ch2 ) { return std::toupper( ch1 ) == std::toupper( ch2 ); } []( char ch1, char ch2 )
{
#ifdef _MSC_VER
return toupper( ch1 ) == toupper( ch2 );
#else
return std::toupper( ch1 ) == std::toupper( ch2 );
#endif
}
); );
return ( it != str.end() ); return ( it != str.end() );
} }
Expand Down
3 changes: 3 additions & 0 deletions external/mdal/mdal_utils.hpp
Expand Up @@ -13,6 +13,9 @@


#include "mdal_data_model.hpp" #include "mdal_data_model.hpp"


// avoid unused variable warnings
#define MDAL_UNUSED(x) (void)x;

namespace MDAL namespace MDAL
{ {
// numbers // numbers
Expand Down

0 comments on commit f54a23e

Please sign in to comment.