summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-11-16 18:08:40 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-11-16 18:08:40 -0500
commitaaf96507a15196145d903764dc905d8d6e7df7b0 (patch)
tree2a628a73999aaaaa5fb2338516ffa5fc5b256d38 /indra/llcommon
parent4d1b62f46be4322333e57fd09a195a51de7c7bf5 (diff)
Some Mac header #defines macros like check and equivalent -- gack!!
Given that third-party libraries (such as Boost) can and do use those names, properly namespace-scoped, it's unpardonable to break any such innocent usage with a macro. Given the pervasiveness of the need, introduce a header file with the requisite #undef directives.
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/CMakeLists.txt1
-rw-r--r--indra/llcommon/fix_macros.h25
2 files changed, 26 insertions, 0 deletions
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 36a8319189..66e2bc9095 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 0000000000..ef959decff
--- /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