diff --git a/CMakeLists.txt b/CMakeLists.txt index a5e06076..24b9c26d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -432,7 +432,7 @@ qi_install_header(${SERIALIZE_HEADERS} SUBFOLDER serialize) qi_create_lib(port SHARED SRC ${PORT_SOURCES} ${PORT_HEADERS} - DEPENDS BOOST BOOST_CHRONO BOOST_FILESYSTEM BOOST_DATE_TIME BOOST_SYSTEM BOOST_THREAD) + DEPENDS BOOST BOOST_CHRONO BOOST_FILESYSTEM BOOST_DATE_TIME BOOST_SYSTEM BOOST_THREAD BOOST_REGEX) set_target_properties(port PROPERTIES diff --git a/include/libport/ctime b/include/libport/ctime index 2aaaf104..98a77e44 100644 --- a/include/libport/ctime +++ b/include/libport/ctime @@ -23,7 +23,7 @@ | timespec. | `-----------*/ -# if defined WIN32 +# if defined WIN32 && (_MSC_VER < 1900) struct timespec { time_t tv_sec; diff --git a/include/libport/option-parser.hxx b/include/libport/option-parser.hxx index bee36dec..6e8cecdc 100644 --- a/include/libport/option-parser.hxx +++ b/include/libport/option-parser.hxx @@ -22,7 +22,7 @@ namespace libport { if (!filled_) { - aver(def); + aver(bool(def)); return def.get(); } return boost::lexical_cast(value_); diff --git a/include/sched/exception.hh b/include/sched/exception.hh index 9d4e3ecb..664b43d4 100644 --- a/include/sched/exception.hh +++ b/include/sched/exception.hh @@ -38,7 +38,7 @@ namespace sched /// Define an optional field Name, and accessors. #define ADD_FIELD(Type, Name) \ public: \ - bool Name ## _is_set() const { return Name ## _; }; \ + bool Name ## _is_set() const { return bool(Name ## _); }; \ const Type& Name ## _get() const { return Name ## _ .get(); }; \ void Name ## _set(const Type& data) { Name ## _ = data; }; \ private: \ diff --git a/include/sched/libcoroutine/Common.h b/include/sched/libcoroutine/Common.h index c5bfa3f6..1d970c28 100644 --- a/include/sched/libcoroutine/Common.h +++ b/include/sched/libcoroutine/Common.h @@ -29,7 +29,7 @@ These defines are helpful for doing OS specific checks in the code. #if defined(WIN32) || defined(__WINS__) || defined(__MINGW32__) || defined(_MSC_VER) #define inline __inline -#if defined _MSC_VER +#if (_MSC_VER < 1900) # define snprintf _snprintf #endif #define usleep(x) Sleep(((x)+999)/1000) diff --git a/lib/libport/cstdlib.cc b/lib/libport/cstdlib.cc index 90bba7d7..0ad5396d 100644 --- a/lib/libport/cstdlib.cc +++ b/lib/libport/cstdlib.cc @@ -124,10 +124,10 @@ namespace libport # if defined __APPLE__ res = env_build(*_NSGetEnviron()); # elif defined _MSC_VER || defined __MINGW32__ - char* environ = GetEnvironmentStrings(); - for (char* cp = environ; *cp; cp += strlen(cp) + 1) + char* env = GetEnvironmentStrings(); + for (char* cp = env; *cp; cp += strlen(cp) + 1) env_add(res, cp); - FreeEnvironmentStrings(environ); + FreeEnvironmentStrings(env); # else res = env_build(environ); # endif diff --git a/lib/libport/option-parser.cc b/lib/libport/option-parser.cc index 0f98534d..2596cc5c 100644 --- a/lib/libport/option-parser.cc +++ b/lib/libport/option-parser.cc @@ -305,7 +305,7 @@ namespace libport { if (!filled_) { - aver(def); + aver(bool(def)); return def.get(); } return value_;