MSVC compatibility fixes

This commit is contained in:
Vitaly Takmazov 2017-06-14 19:40:45 +03:00
parent ad6fd47feb
commit d363189d97
4 changed files with 9 additions and 4 deletions

View File

@ -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()

View File

@ -10,6 +10,7 @@
#include "Swiften/TLS/Schannel/SchannelUtil.h"
#include <Swiften/TLS/CertificateWithKey.h>
#include "Swiften/Base/ByteArray.h"
#include "Swiften/SwiftenCompat.h"
#define SECURITY_WIN32
#include <Windows.h>

View File

@ -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);

View File

@ -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[])