Skip to content

Commit f54a23e

Browse files
PeterPetrikwonder-sk
authored andcommittedJul 19, 2018
restore fixes for MS build
1 parent 21613cd commit f54a23e

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed
 

‎external/mdal/frmts/mdal_hdf5.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct HdfString
2727
char data [HDF_MAX_NAME];
2828
};
2929

30-
template <int TYPE> inline void hdfClose( hid_t id ) { assert( false ); }
30+
template <int TYPE> inline void hdfClose( hid_t id ) { MDAL_UNUSED( id ); assert( false ); }
3131
template <> inline void hdfClose<H5I_FILE>( hid_t id ) { H5Fclose( id ); }
3232
template <> inline void hdfClose<H5I_GROUP>( hid_t id ) { H5Gclose( id ); }
3333
template <> inline void hdfClose<H5I_DATASET>( hid_t id ) { H5Dclose( id ); }

‎external/mdal/mdal_loader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "frmts/mdal_2dm.hpp"
99
#include "frmts/mdal_ascii_dat.hpp"
1010
#include "frmts/mdal_binary_dat.hpp"
11+
#include "mdal_utils.hpp"
1112

1213
#ifdef HAVE_HDF5
1314
#include "frmts/mdal_xmdf.hpp"

‎external/mdal/mdal_utils.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include "mdal_utils.hpp"
7+
#include <string>
78
#include <fstream>
89
#include <iostream>
910
#include <algorithm>
@@ -101,7 +102,14 @@ bool MDAL::contains( const std::string &str, const std::string &substr, Contains
101102
auto it = std::search(
102103
str.begin(), str.end(),
103104
substr.begin(), substr.end(),
104-
[]( char ch1, char ch2 ) { return std::toupper( ch1 ) == std::toupper( ch2 ); }
105+
[]( char ch1, char ch2 )
106+
{
107+
#ifdef _MSC_VER
108+
return toupper( ch1 ) == toupper( ch2 );
109+
#else
110+
return std::toupper( ch1 ) == std::toupper( ch2 );
111+
#endif
112+
}
105113
);
106114
return ( it != str.end() );
107115
}

‎external/mdal/mdal_utils.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
#include "mdal_data_model.hpp"
1515

16+
// avoid unused variable warnings
17+
#define MDAL_UNUSED(x) (void)x;
18+
1619
namespace MDAL
1720
{
1821
// numbers

0 commit comments

Comments
 (0)
Please sign in to comment.