summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2019-12-03 11:45:14 -0500
committerNat Goodspeed <nat@lindenlab.com>2020-03-25 15:28:17 -0400
commitb080b06b422db6405982bee603118ee68e6c2500 (patch)
tree5a67a417b8ac8b27de697b66b5c8bd9fe5798c6a /indra
parent0c42f50d6ba2d9cb5ee164e186572ffc7a8dbedf (diff)
DRTVWR-494: Encapsulate redundant VS boilerplate around <mutex>.
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/llapr.h12
-rw-r--r--indra/llcommon/llinstancetracker.h11
-rw-r--r--indra/llcommon/llmutex.h11
-rw-r--r--indra/llcommon/llsingleton.h13
-rw-r--r--indra/llcommon/llthreadsafequeue.h12
-rw-r--r--indra/llcommon/mutex.h22
6 files changed, 27 insertions, 54 deletions
diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h
index da50dda103..3c07976f42 100644
--- a/indra/llcommon/llapr.h
+++ b/indra/llcommon/llapr.h
@@ -41,17 +41,7 @@
#include "llstring.h"
-#if LL_WINDOWS
-#pragma warning (push)
-#pragma warning (disable:4265)
-#endif
-// warning C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
-
-#include <mutex>
-
-#if LL_WINDOWS
-#pragma warning (pop)
-#endif
+#include "mutex.h"
struct apr_dso_handle_t;
/**
diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h
index 3c8a5e3fb6..272ad8086e 100644
--- a/indra/llcommon/llinstancetracker.h
+++ b/indra/llcommon/llinstancetracker.h
@@ -35,16 +35,7 @@
#include <memory>
#include <type_traits>
-#if LL_WINDOWS
-#pragma warning (push)
-#pragma warning (disable:4265)
-#endif
-// 'std::_Pad' : class has virtual functions, but destructor is not virtual
-#include <mutex>
-
-#if LL_WINDOWS
-#pragma warning (pop)
-#endif
+#include "mutex.h"
#include <boost/iterator/transform_iterator.hpp>
#include <boost/iterator/indirect_iterator.hpp>
diff --git a/indra/llcommon/llmutex.h b/indra/llcommon/llmutex.h
index f841d7f950..1a93c048b6 100644
--- a/indra/llcommon/llmutex.h
+++ b/indra/llcommon/llmutex.h
@@ -30,18 +30,9 @@
#include "stdtypes.h"
#include <boost/noncopyable.hpp>
-#if LL_WINDOWS
-#pragma warning (push)
-#pragma warning (disable:4265)
-#endif
-// 'std::_Pad' : class has virtual functions, but destructor is not virtual
-#include <mutex>
+#include "mutex.h"
#include <condition_variable>
-#if LL_WINDOWS
-#pragma warning (pop)
-#endif
-
//============================================================================
#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO)
diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h
index 8dec8bfb3b..4efffde43a 100644
--- a/indra/llcommon/llsingleton.h
+++ b/indra/llcommon/llsingleton.h
@@ -30,18 +30,7 @@
#include <list>
#include <vector>
#include <typeinfo>
-
-#if LL_WINDOWS
-#pragma warning (push)
-#pragma warning (disable:4265)
-#endif
-// warning C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
-
-#include <mutex>
-
-#if LL_WINDOWS
-#pragma warning (pop)
-#endif
+#include "mutex.h"
class LLSingletonBase: private boost::noncopyable
{
diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h
index b0bddac8e5..2cee7a3141 100644
--- a/indra/llcommon/llthreadsafequeue.h
+++ b/indra/llcommon/llthreadsafequeue.h
@@ -30,19 +30,9 @@
#include "llexception.h"
#include <deque>
#include <string>
-
-#if LL_WINDOWS
-#pragma warning (push)
-#pragma warning (disable:4265)
-#endif
-// 'std::_Pad' : class has virtual functions, but destructor is not virtual
-#include <mutex>
+#include "mutex.h"
#include <condition_variable>
-#if LL_WINDOWS
-#pragma warning (pop)
-#endif
-
//
// A general queue exception.
//
diff --git a/indra/llcommon/mutex.h b/indra/llcommon/mutex.h
new file mode 100644
index 0000000000..90d0942270
--- /dev/null
+++ b/indra/llcommon/mutex.h
@@ -0,0 +1,22 @@
+/**
+ * @file mutex.h
+ * @author Nat Goodspeed
+ * @date 2019-12-03
+ * @brief Wrap <mutex> in odious boilerplate
+ *
+ * $LicenseInfo:firstyear=2019&license=viewerlgpl$
+ * Copyright (c) 2019, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+#if LL_WINDOWS
+#pragma warning (push)
+#pragma warning (disable:4265)
+#endif
+// warning C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
+
+#include <mutex>
+
+#if LL_WINDOWS
+#pragma warning (pop)
+#endif