From d363189d97b825f1500689279016a63580377c44 2017-06-14 18:40:45 From: Vitaly Takmazov Date: 2017-06-14 18:40:45 Subject: [PATCH] MSVC compatibility fixes --- diff --git a/cmake_modules/SwiftenConfig.cmake b/cmake_modules/SwiftenConfig.cmake index 105ee807fe1fd5b86d123117adfe02293ffaf0bb..5875f11590cbf81c576846d947e45ebb95b517e3 100644 --- a/cmake_modules/SwiftenConfig.cmake +++ b/cmake_modules/SwiftenConfig.cmake @@ -1,4 +1,4 @@ -FIND_LIBRARY(SWIFTEN_LIBRARY NAMES Swiften Swiften3 HINTS ../lib) +FIND_LIBRARY(SWIFTEN_LIBRARY NAMES Swiften Swiften3 Swiften4 HINTS ../lib) FIND_PATH(SWIFTEN_INCLUDE_DIR NAMES "Swiften/Swiften.h" PATH_SUFFIXES libSwiften Swiften HINTS ../include) if( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR ) @@ -40,7 +40,7 @@ if( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR ) string(REGEX REPLACE " +$" "" SWIFTEN_VERSION "${SWIFTEN_VERSION}") string(REGEX REPLACE "swiften-config " "" SWIFTEN_VERSION "${SWIFTEN_VERSION}") - if("${SWIFTEN_VERSION}" STRGREATER "4") + if("${SWIFTEN_VERSION}" STRGREATER "4" AND NOT MSVC) message( STATUS "Found Swiften > 4 requesting C++11") add_definitions(-std=c++11) endif() diff --git a/include/Swiften/TLS/Schannel/SchannelServerContext.h b/include/Swiften/TLS/Schannel/SchannelServerContext.h index 4478339f8ecb90c4616e9a78c891f59aab8f3aa5..4745447bba596f29d85eb5ef300dc3da8a0b7609 100644 --- a/include/Swiften/TLS/Schannel/SchannelServerContext.h +++ b/include/Swiften/TLS/Schannel/SchannelServerContext.h @@ -10,6 +10,7 @@ #include "Swiften/TLS/Schannel/SchannelUtil.h" #include #include "Swiften/Base/ByteArray.h" +#include "Swiften/SwiftenCompat.h" #define SECURITY_WIN32 #include diff --git a/tests/libtransport/HTTPRequest.cpp b/tests/libtransport/HTTPRequest.cpp index fd29998a8c5cc50751aebcc3d2e97c6bf38e651c..0954d92b2873e84d32a2dae85204c3bfd786582e 100644 --- a/tests/libtransport/HTTPRequest.cpp +++ b/tests/libtransport/HTTPRequest.cpp @@ -20,6 +20,10 @@ using namespace Transport; #define get_value_or(X) substr() #endif +#ifdef _MSC_VER +#define sleep Sleep +#endif + class HTTPRequestTest : public CPPUNIT_NS :: TestFixture, public BasicTest { CPPUNIT_TEST_SUITE(HTTPRequestTest); CPPUNIT_TEST(GETThreadPool); diff --git a/tests/libtransport/main.cpp b/tests/libtransport/main.cpp index 8c02ec2c98e569b7bd531b9735cefc2f44ae0df7..7f71c63f282c43b385f0a12389907279af52d92b 100644 --- a/tests/libtransport/main.cpp +++ b/tests/libtransport/main.cpp @@ -10,12 +10,12 @@ #include "log4cxx/fileappender.h" #include "log4cxx/patternlayout.h" #include "log4cxx/propertyconfigurator.h" +using namespace log4cxx; +#endif #include "transport/protocol.pb.h" #include "transport/HTTPRequest.h" -using namespace log4cxx; -#endif int main (int argc, char* argv[])