aboutsummaryrefslogtreecommitdiff
path: root/internal/ceres/mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'internal/ceres/mutex.h')
-rw-r--r--internal/ceres/mutex.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/ceres/mutex.h b/internal/ceres/mutex.h
index 5090a71..0c48ed3 100644
--- a/internal/ceres/mutex.h
+++ b/internal/ceres/mutex.h
@@ -107,10 +107,12 @@
# define _WIN32_WINNT 0x0400
# endif
# endif
+// Unfortunately, windows.h defines a bunch of macros with common
+// names. Two in particular need avoiding: ERROR and min/max.
// To avoid macro definition of ERROR.
-# define CERES_NOGDI
+# define NOGDI
// To avoid macro definition of min/max.
-# define CERES_NOMINMAX
+# define NOMINMAX
# include <windows.h>
typedef CRITICAL_SECTION MutexType;
#elif defined(CERES_HAVE_PTHREAD) && defined(CERES_HAVE_RWLOCK)
@@ -273,7 +275,8 @@ void Mutex::ReaderUnlock() { Unlock(); }
// "MutexLock(x) COMPILE_ASSERT(false)". To work around this, "Ceres" is
// prefixed to the class names; this permits defining the classes.
-// CeresMutexLock(mu) acquires mu when constructed and releases it when destroyed.
+// CeresMutexLock(mu) acquires mu when constructed and releases it
+// when destroyed.
class CeresMutexLock {
public:
explicit CeresMutexLock(Mutex *mu) : mu_(mu) { mu_->Lock(); }