forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
68 additions
and
20 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in | ||
index 3ecacfb..0bdbe6d 100644 | ||
--- a/src/glog/logging.h.in | ||
+++ b/src/glog/logging.h.in | ||
@@ -103,7 +103,19 @@ | ||
#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> | ||
+#ifdef ERROR | ||
+# undef ERROR | ||
+#endif | ||
#endif | ||
|
||
@ac_google_start_namespace@ | ||
@@ -1061,7 +1073,7 @@ namespace google { | ||
#elif defined(GLOG_OS_WINDOWS) | ||
|
||
#define SOME_KIND_OF_LOG_EVERY_N(severity, n, what_to_do) \ | ||
- static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ | ||
+ static volatile unsigned LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ | ||
InterlockedIncrement(&LOG_OCCURRENCES); \ | ||
if (InterlockedIncrement(&LOG_OCCURRENCES_MOD_N) > n) \ | ||
InterlockedExchangeSubtract(&LOG_OCCURRENCES_MOD_N, n); \ | ||
@@ -1071,7 +1083,7 @@ namespace google { | ||
&what_to_do).stream() | ||
|
||
#define SOME_KIND_OF_LOG_IF_EVERY_N(severity, condition, n, what_to_do) \ | ||
- static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ | ||
+ static volatile unsigned LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ | ||
InterlockedIncrement(&LOG_OCCURRENCES); \ | ||
if (condition && \ | ||
(InterlockedIncrement(&LOG_OCCURRENCES_MOD_N) || true) && \ | ||
@@ -1082,7 +1094,7 @@ namespace google { | ||
&what_to_do).stream() | ||
|
||
#define SOME_KIND_OF_PLOG_EVERY_N(severity, n, what_to_do) \ | ||
- static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ | ||
+ static volatile unsigned LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ | ||
InterlockedIncrement(&LOG_OCCURRENCES); \ | ||
if (InterlockedIncrement(&LOG_OCCURRENCES_MOD_N) > n) \ | ||
InterlockedExchangeSubtract(&LOG_OCCURRENCES_MOD_N, n); \ | ||
@@ -1092,7 +1104,7 @@ namespace google { | ||
&what_to_do).stream() | ||
|
||
#define SOME_KIND_OF_LOG_FIRST_N(severity, n, what_to_do) \ | ||
- static int LOG_OCCURRENCES = 0; \ | ||
+ static volatile unsigned LOG_OCCURRENCES = 0; \ | ||
if (LOG_OCCURRENCES <= n) \ | ||
InterlockedIncrement(&LOG_OCCURRENCES); \ | ||
if (LOG_OCCURRENCES <= n) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters