Skip to content

Commit

Permalink
remove NOMINMAX
Browse files Browse the repository at this point in the history
  • Loading branch information
jiayuehua committed Jun 10, 2022
1 parent c905ac6 commit 17a80f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 7 additions & 12 deletions ports/glog/noerror-nominmax.patch
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in
index 3ecacfb..0bdbe6d 100644
index 3ecacfb..ebbc7d5 100644
--- a/src/glog/logging.h.in
+++ b/src/glog/logging.h.in
@@ -103,7 +103,19 @@
@@ -103,7 +103,14 @@
#ifdef HAVE_CXX11_ATOMIC
#include <atomic>
#elif defined(GLOG_OS_WINDOWS)
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN // We only need minimal includes
+# endif
+// To avoid macro definition of ERROR.
+// To avoid macro definition of min/max.
+# ifndef NOMINMAX
+# define NOMINMAX
+# endif
+
#include <Windows.h>
+// To avoid macro definition of ERROR.
+#ifdef ERROR
+# undef ERROR
+#endif
#endif

@ac_google_start_namespace@
@@ -1061,7 +1073,7 @@ namespace google {
@@ -1061,7 +1068,7 @@ namespace google {
#elif defined(GLOG_OS_WINDOWS)

#define SOME_KIND_OF_LOG_EVERY_N(severity, n, what_to_do) \
Expand All @@ -31,7 +26,7 @@ index 3ecacfb..0bdbe6d 100644
InterlockedIncrement(&LOG_OCCURRENCES); \
if (InterlockedIncrement(&LOG_OCCURRENCES_MOD_N) > n) \
InterlockedExchangeSubtract(&LOG_OCCURRENCES_MOD_N, n); \
@@ -1071,7 +1083,7 @@ namespace google {
@@ -1071,7 +1078,7 @@ namespace google {
&what_to_do).stream()

#define SOME_KIND_OF_LOG_IF_EVERY_N(severity, condition, n, what_to_do) \
Expand All @@ -40,7 +35,7 @@ index 3ecacfb..0bdbe6d 100644
InterlockedIncrement(&LOG_OCCURRENCES); \
if (condition && \
(InterlockedIncrement(&LOG_OCCURRENCES_MOD_N) || true) && \
@@ -1082,7 +1094,7 @@ namespace google {
@@ -1082,7 +1089,7 @@ namespace google {
&what_to_do).stream()

#define SOME_KIND_OF_PLOG_EVERY_N(severity, n, what_to_do) \
Expand All @@ -49,7 +44,7 @@ index 3ecacfb..0bdbe6d 100644
InterlockedIncrement(&LOG_OCCURRENCES); \
if (InterlockedIncrement(&LOG_OCCURRENCES_MOD_N) > n) \
InterlockedExchangeSubtract(&LOG_OCCURRENCES_MOD_N, n); \
@@ -1092,7 +1104,7 @@ namespace google {
@@ -1092,7 +1099,7 @@ namespace google {
&what_to_do).stream()

#define SOME_KIND_OF_LOG_FIRST_N(severity, n, what_to_do) \
Expand Down
2 changes: 1 addition & 1 deletion versions/g-/glog.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "bb84d3c0e6057e00ef151afde936fa6b4fba33c9",
"git-tree": "c469b2bfc6498c37b6daad8d512a1b1d1cb6a6f6",
"version": "0.5.0",
"port-version": 5
},
Expand Down

0 comments on commit 17a80f2

Please sign in to comment.