diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index da50dda103084fbd7d881459a12774a3ff36d264..3c07976f426ac898052ce1cd5ee5ae64ee64176d 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 3c8a5e3fb6abd410c9b95cc3585391ea503996e0..272ad8086ed2393e8bad4b6d0e4494087b6e2d53 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 f841d7f9503bd3e02c3e14b634e91557706a8123..1a93c048b64d6b84535aeeeb278666fae1b5b07e 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 8dec8bfb3bc339ed1fe470645c0831e1101d9503..4efffde43a3ccd134f026fc697658875449aa9b1 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 b0bddac8e5128d9e67b689084b22a5c9f643a712..2cee7a3141f4603a435795b4ce9a42028bdc1e48 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 0000000000000000000000000000000000000000..90d0942270ab3af4c4f3b04f5aa4d193fd589c72 --- /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