aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-11-28 05:16:07 -0500
committerJack Lloyd <[email protected]>2016-11-28 05:16:07 -0500
commit4e4ee277c5831363c32e1529405539ae1c7751af (patch)
treebf46dc7ff5804b1045afa7798f60a9a8daba268f
parentf11d1bf525d1c77514bac61b309bd604c92acbfd (diff)
parent2e7e0336a9fd90b6fcb21416c9d9e2a3fb17dfc4 (diff)
Merge GH #740 Use NOMINMAX on Windows
-rwxr-xr-xconfigure.py2
-rw-r--r--src/lib/entropy/cryptoapi_rng/es_capi.cpp3
-rw-r--r--src/lib/entropy/win32_stats/es_win32.cpp1
-rw-r--r--src/lib/rng/system_rng/system_rng.cpp3
-rw-r--r--src/lib/utils/dyn_load/dyn_load.cpp1
-rw-r--r--src/lib/utils/mem_ops.cpp1
-rw-r--r--src/lib/utils/os_utils.cpp1
7 files changed, 7 insertions, 5 deletions
diff --git a/configure.py b/configure.py
index c7ee08072..52f4326c9 100755
--- a/configure.py
+++ b/configure.py
@@ -129,7 +129,7 @@ class BuildConfigurationInformation(object):
self.internal_headers = sorted(flatten([m.internal_headers() for m in modules]))
self.external_headers = sorted(flatten([m.external_headers() for m in modules]))
- if options.via_amalgamation:
+ if options.amalgamation:
self.build_sources = ['botan_all.cpp']
else:
self.build_sources = self.sources
diff --git a/src/lib/entropy/cryptoapi_rng/es_capi.cpp b/src/lib/entropy/cryptoapi_rng/es_capi.cpp
index a1d809d0d..1624f8946 100644
--- a/src/lib/entropy/cryptoapi_rng/es_capi.cpp
+++ b/src/lib/entropy/cryptoapi_rng/es_capi.cpp
@@ -7,10 +7,9 @@
#include <botan/internal/es_capi.h>
#include <botan/parsing.h>
+#define NOMINMAX 1
#include <windows.h>
#include <wincrypt.h>
-#undef min
-#undef max
namespace Botan {
diff --git a/src/lib/entropy/win32_stats/es_win32.cpp b/src/lib/entropy/win32_stats/es_win32.cpp
index bbc64eaab..520848615 100644
--- a/src/lib/entropy/win32_stats/es_win32.cpp
+++ b/src/lib/entropy/win32_stats/es_win32.cpp
@@ -6,6 +6,7 @@
*/
#include <botan/internal/es_win32.h>
+#define NOMINMAX 1
#include <windows.h>
#include <tlhelp32.h>
diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp
index 1ea749327..eaba38241 100644
--- a/src/lib/rng/system_rng/system_rng.cpp
+++ b/src/lib/rng/system_rng/system_rng.cpp
@@ -10,9 +10,8 @@
#if defined(BOTAN_TARGET_OS_HAS_CRYPTGENRANDOM)
#include <windows.h>
+#define NOMINMAX 1
#include <wincrypt.h>
-#undef min
-#undef max
#else
diff --git a/src/lib/utils/dyn_load/dyn_load.cpp b/src/lib/utils/dyn_load/dyn_load.cpp
index df6777e58..1f33dc761 100644
--- a/src/lib/utils/dyn_load/dyn_load.cpp
+++ b/src/lib/utils/dyn_load/dyn_load.cpp
@@ -12,6 +12,7 @@
#if defined(BOTAN_TARGET_OS_HAS_DLOPEN)
#include <dlfcn.h>
#elif defined(BOTAN_TARGET_OS_HAS_LOADLIBRARY)
+ #define NOMINMAX 1
#include <windows.h>
#endif
diff --git a/src/lib/utils/mem_ops.cpp b/src/lib/utils/mem_ops.cpp
index 461b03d6b..a0cd3124f 100644
--- a/src/lib/utils/mem_ops.cpp
+++ b/src/lib/utils/mem_ops.cpp
@@ -8,6 +8,7 @@
#include <botan/mem_ops.h>
#if defined(BOTAN_TARGET_OS_HAS_RTLSECUREZEROMEMORY)
+ #define NOMINMAX 1
#include <windows.h>
#endif
diff --git a/src/lib/utils/os_utils.cpp b/src/lib/utils/os_utils.cpp
index 1e60596ba..d072b2c2b 100644
--- a/src/lib/utils/os_utils.cpp
+++ b/src/lib/utils/os_utils.cpp
@@ -20,6 +20,7 @@
#endif
#if defined(BOTAN_TARGET_OS_IS_WINDOWS) || defined(BOTAN_TARGET_OS_IS_MINGW)
+ #define NOMINMAX 1
#include <windows.h>
#endif