WSL/SLF GitLab Repository

Commit f1c7d840 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Some fixes to make MeteoIO compile with Visual C++ 2013. The linker still...

Some fixes to make MeteoIO compile with Visual C++ 2013. The linker still complains about exported symbols (this also generate lots of warnings), but all the other issues have been fixed.
parent e54bbc2c
......@@ -24,13 +24,12 @@ BuildVersion()
IF(MSVC)
#SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "limited configs" FORCE)
SET(WARNINGS "/W4")
SET(WARNINGS "/W4 /D_CRT_SECURE_NO_WARNINGS /EHsc") #Za: strict ansi EHsc: handle c++ exceptions
#SET(EXTRA_WARNINGS "/Wp64") #/Wall
SET(OPTIM "/O2 /DNDEBUG /MD /DNOSAFECHECKS")
SET(ARCH_OPTIM "/arch:SSE2")
SET(ARCH_SAFE "")
SET(DEBUG "/Z7 /Od /D__DEBUG /MDd")
LIST(APPEND CFLAGS " /D_CRT_SECURE_NO_WARNINGS /EHsc") #Za: strict ansi EHsc: handle c++ exceptions
SET(_VERSION "/D_VERSION=\\\"${_versionString}\\\"")
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(/DMIO_DLL)
......
......@@ -21,11 +21,9 @@
#include <fstream>
#if defined _WIN32 || defined __MINGW32__
#define NOMINMAX
#include <windows.h>
#include "Shlwapi.h"
//removing two macros defined in windows.h
#undef max
#undef min
#else
#include <dirent.h>
#include <sys/stat.h>
......
......@@ -21,6 +21,8 @@
#include <meteoio/meteoLaws/Meteoconst.h>
#include <meteoio/meteoFilters/ProcHNWDistribute.h> //for the precipitation distribution
#include <algorithm>
using namespace std;
namespace mio {
......
......@@ -19,6 +19,7 @@
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
......
......@@ -17,6 +17,7 @@
*/
#include <cmath>
#include <cstring>
#include <ctype.h>
#include <algorithm>
#include <meteoio/IOUtils.h>
......@@ -345,7 +346,7 @@ template<> bool convertString<double>(double& t, const std::string& str, std::io
if (f == std::dec) {
//First check if string is empty
const char* start = str.c_str();
while(*start && std::isspace(*start)) start++;
while(*start && isspace(*start)) start++;
if (*start == '\0' || *start == '#' || *start == ';') { // line empty or comment
t = static_cast<double> (nodata);
return true;
......@@ -358,7 +359,7 @@ template<> bool convertString<double>(double& t, const std::string& str, std::io
if (*end == '\0') { //conversion successful
return true;
} else { // conversion might have worked, let's check what is left
while((*end != '\0') && std::isspace(*end)) end++;
while((*end != '\0') && isspace(*end)) end++;
if (*end == '\0' || *end == '#' || *end == ';') { // we allow the number to be followed by a comment
return true;
......
......@@ -21,6 +21,8 @@
#include <meteoio/IOUtils.h>
#include <meteoio/FileUtils.h>
#include <algorithm>
using namespace std;
namespace mio {
......
......@@ -17,6 +17,8 @@
*/
#include <meteoio/MeteoProcessor.h>
#include <algorithm>
using namespace std;
namespace mio {
......
......@@ -20,6 +20,7 @@
#include <meteoio/ResamplingAlgorithms2D.h>
#include <cmath>
#include <sstream>
#include <algorithm>
using namespace std;
......
......@@ -17,6 +17,7 @@
*/
#include <cmath>
#include <limits.h>
#include <algorithm>
#include <meteoio/dataClasses/DEMObject.h>
#include <meteoio/MathOptim.h>
......
......@@ -17,6 +17,7 @@
*/
#include <meteoio/meteoFilters/ProcExpSmoothing.h>
#include <cmath>
#include <algorithm>
using namespace std;
......
......@@ -111,6 +111,8 @@ double ProcUndercatch_Forland::solidPrecipitation(double TA, double VW)
beta1 = 0.13383;
beta2 = 0.009064;
beta3 = -0.005147;
} else {
throw InvalidArgumentException("Wrong rain gauge type for filter " + getName(), AT);
}
return exp( beta0 + beta1*VW + beta2*TA + beta3*VW*TA );
......
......@@ -17,6 +17,7 @@
*/
#include <meteoio/meteoFilters/ProcWMASmoothing.h>
#include <cmath>
#include <algorithm>
using namespace std;
......
......@@ -17,6 +17,8 @@
*/
#include <meteoio/meteoFilters/ProcessingStack.h>
#include <algorithm>
using namespace std;
namespace mio {
......
......@@ -17,6 +17,8 @@
*/
#include <meteoio/meteoFilters/WindowedFilter.h>
#include <algorithm>
using namespace std;
namespace mio {
......
......@@ -18,6 +18,7 @@
#include <cmath>
#include <string>
#include <iomanip>
#include <algorithm>
#include <meteoio/meteoLaws/Suntrajectory.h>
#include <meteoio/meteoLaws/Meteoconst.h> //for math constants
......
......@@ -195,7 +195,7 @@ void Interpol1D::equalBin(const unsigned int k, std::vector<double> &X, std::vec
const double width = (Xmax - Xmin) / k;
std::vector<double> bins(k, 0.);
std::vector<size_t> counts(k, 0.);
std::vector<size_t> counts(k, 0);
for (size_t ii=0; ii<Xsize; ii++) {
if (X[ii]==IOUtils::nodata || Y[ii]==IOUtils::nodata) continue;
......
......@@ -29,6 +29,10 @@
#include <vector>
#include <map>
#ifdef _MSC_VER
#pragma warning(disable:4512) //we don't need any = operator!
#endif
namespace mio {
class A3DIO : public IOInterface {
......
......@@ -24,6 +24,10 @@
#include <string>
#ifdef _MSC_VER
#pragma warning(disable:4512) //we don't need any = operator!
#endif
namespace mio {
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment