From 44581c5285d13c0ec715b35ddc79177e5ebeef39 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Wed, 14 Mar 2018 13:12:28 +0100 Subject: Fix building with OpenSSL on Windows Define NOMINMAX when building OpenSSL backend on Windows and otherwise you cannot use std::numeric_limits::max. Test-Information: Swiften builds on Windows 10 with VS2015 with the OpenSSL TLS backend. Change-Id: I9621c14426a0af2280cef7ee973abcff2fd0a48d diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp index 6cbd303..89917ee 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp +++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp @@ -3,6 +3,7 @@ * All rights reserved. * See the COPYING file for more information. */ + #include #ifdef SWIFTEN_PLATFORM_WINDOWS diff --git a/Swiften/TLS/SConscript b/Swiften/TLS/SConscript index ec9edd5..a79e6a1 100644 --- a/Swiften/TLS/SConscript +++ b/Swiften/TLS/SConscript @@ -20,6 +20,8 @@ if myenv.get("HAVE_OPENSSL", 0) : "OpenSSL/OpenSSLCertificateFactory.cpp", ]) myenv.Append(CPPDEFINES = "HAVE_OPENSSL") + if myenv["PLATFORM"] == "win32" : + myenv.Append(CPPDEFINES = "NOMINMAX") elif myenv.get("HAVE_SCHANNEL", 0) : swiften_env.Append(LIBS = ["Winscard"]) objects += myenv.SwiftenObject([ -- cgit v0.10.2-6-g49f6