diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 36a8319189c6069eee94b7f9c6721b0c9074f41a..66e2bc90950506475fd5c9f05ac15b6d0885a277 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -116,6 +116,7 @@ set(llcommon_HEADER_FILES
     bitpack.h
     ctype_workaround.h
     doublelinkedlist.h
+    fix_macros.h
     imageids.h
     indra_constants.h
     linden_common.h
diff --git a/indra/llcommon/fix_macros.h b/indra/llcommon/fix_macros.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef959decffeb755146927b15a4b4c93c13599faa
--- /dev/null
+++ b/indra/llcommon/fix_macros.h
@@ -0,0 +1,25 @@
+/**
+ * @file   fix_macros.h
+ * @author Nat Goodspeed
+ * @date   2012-11-16
+ * @brief  The Mac system headers seem to #define macros with obnoxiously
+ *         generic names, preventing any library from using those names. We've
+ *         had to fix these in so many places that it's worth making a header
+ *         file to handle it.
+ * 
+ * $LicenseInfo:firstyear=2012&license=viewerlgpl$
+ * Copyright (c) 2012, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// DON'T use an #include guard: every time we encounter this header, #undef
+// these macros all over again.
+
+// who injects MACROS with such generic names?! Grr.
+#ifdef equivalent
+#undef equivalent
+#endif 
+
+#ifdef check
+#undef check
+#endif
diff --git a/indra/llcorehttp/_refcounted.h b/indra/llcorehttp/_refcounted.h
index a96c65fb6b90a6b7c6de2e746f056eff323a2432..21a916b13b1dd0a6bf75ca04d3642ee3757274f6 100644
--- a/indra/llcorehttp/_refcounted.h
+++ b/indra/llcorehttp/_refcounted.h
@@ -30,6 +30,7 @@
 
 #include "linden_common.h"
 
+#include "fix_macros.h"
 #include <boost/thread.hpp>
 
 #include "llapr.h"
diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp
index fa806bf23eb760248908c686e3909201736285a3..460d2a8b4fb70757cea4ce18e2b23ecb35b855d0 100644
--- a/indra/llvfs/lldiriterator.cpp
+++ b/indra/llvfs/lldiriterator.cpp
@@ -26,6 +26,7 @@
 
 #include "lldiriterator.h"
 
+#include "fix_macros.h"
 #include <boost/filesystem.hpp>
 #include <boost/regex.hpp>
 
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index 52ba8b3bf3eb7f43c7044f08317aacc920887482..af83b5009767cc5db48b6d5c8aaf4b121c52dc4d 100644
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -36,8 +36,8 @@
 #include <AGL/agl.h>
 
 // AssertMacros.h does bad things.
+#include "fix_macros.h"
 #undef verify
-#undef check
 #undef require
 
 
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index 4e2a269ea33b4587c903662e55106c05e22d8a8d..c5ce892a042c9d0ea423610d07b5875b6d23cea5 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -41,8 +41,8 @@
 #endif
 
 // AssertMacros.h does bad things.
+#include "fix_macros.h"
 #undef verify
-#undef check
 #undef require
 
 
diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h
index 2188b7edd0447caec684c73f1c5c387130af1e64..682f9d64769863332a6aede81b133483fbc236f2 100644
--- a/indra/newview/lldirpicker.h
+++ b/indra/newview/lldirpicker.h
@@ -37,8 +37,8 @@
 #include <Carbon/Carbon.h>
 
 // AssertMacros.h does bad things.
+#include "fix_macros.h"
 #undef verify
-#undef check
 #undef require
 
 #include <vector>
diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h
index 55c665b9c76a812efa9123d0826078d8a8291d24..4f602f63f13afb50aae9d8934d9af0f6a1b35dad 100644
--- a/indra/newview/llfilepicker.h
+++ b/indra/newview/llfilepicker.h
@@ -39,8 +39,8 @@
 #include <Carbon/Carbon.h>
 
 // AssertMacros.h does bad things.
+#include "fix_macros.h"
 #undef verify
-#undef check
 #undef require
 
 #include <vector>
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 459e52c4f4e6f7844b17e664d1e9aa20a738d888..97ba5b634a1f99c83541bc6f7ac9f1d5b1d396cf 100644
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -32,9 +32,7 @@
 #include "lllocalbitmaps.h"
 
 /* boost: will not compile unless equivalent is undef'd, beware. */
-#ifdef equivalent
-#undef equivalent
-#endif 
+#include "fix_macros.h"
 #include <boost/filesystem.hpp>
 
 /* image compression headers. */
diff --git a/indra/newview/macutil_Prefix.h b/indra/newview/macutil_Prefix.h
index fd8e927a0862056632cb7aad6afcb463eae8f2e3..b54a764a624fd76876790a6ac1b8ef96d28bdb80 100644
--- a/indra/newview/macutil_Prefix.h
+++ b/indra/newview/macutil_Prefix.h
@@ -33,7 +33,7 @@
  */
 
 #include <Carbon/Carbon.h>
+#include "fix_macros.h"
 
-#undef check
 #undef verify
 #undef require