diff --git a/CMakeLists.txt b/CMakeLists.txt index ce5c54b12..2a0685b24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -456,7 +456,7 @@ include_directories(include) include_directories(vendor/cppbackport-master/lib) include_directories(${sodium_INCLUDE_DIR}) -if (WIN32) +if (MSVC) include_directories(contrib/msc/include) endif() @@ -477,13 +477,13 @@ add_subdirectory(${GTEST_DIR}) include_directories(${GTEST_DIR}/include ${GTEST_DIR}) add_executable(${TEST_EXE} ${TEST_SRC}) -if (WIN32) +if (MSVC) target_link_libraries(${TEST_EXE} ${STATIC_LINK_LIBS} gtest_main ${STATIC_LIB} ws2_32 iphlpapi) elseif (MINGW) target_link_libraries(${TEST_EXE} ${STATIC_LINK_LIBS} gtest_main ${STATIC_LIB} stdc++fs iphlpapi ws2_32) else() target_link_libraries(${TEST_EXE} ${STATIC_LINK_LIBS} gtest_main ${STATIC_LIB}) -endif(WIN32) +endif(MSVC) if(WITH_STATIC) add_library(${STATIC_LIB} STATIC ${LIB_SRC}) diff --git a/libutp/libutp_inet_ntop.cpp b/libutp/libutp_inet_ntop.cpp index 297b44f88..c6ee74e3b 100644 --- a/libutp/libutp_inet_ntop.cpp +++ b/libutp/libutp_inet_ntop.cpp @@ -19,8 +19,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #include #include diff --git a/llarp/fs.hpp b/llarp/fs.hpp index 22b1dad56..d1d9abd49 100644 --- a/llarp/fs.hpp +++ b/llarp/fs.hpp @@ -33,7 +33,11 @@ namespace llarp typedef std::function< void(const fs::path &, PathVisitor) > PathIter; static PathIter IterDir = [](const fs::path &path, PathVisitor visit) { - DIR *d = opendir(path.string().c_str()); +#ifndef WIN32 + DIR *d = opendir(path.c_str()); +#else + DIR *d = opendir(path.u8string().c_str()); +#endif if(d == nullptr) return; struct dirent *ent = nullptr; diff --git a/llarp/ip.cpp b/llarp/ip.cpp index 54e74a7ce..d6464617d 100644 --- a/llarp/ip.cpp +++ b/llarp/ip.cpp @@ -3,6 +3,9 @@ #include #include "llarp/buffer.hpp" #include "mem.hpp" +#ifndef _WIN32 +#include +#endif #include #include