diff --git a/mp/src/public/tier0/threadtools.h b/mp/src/public/tier0/threadtools.h index 7faeff724..9535abb43 100644 --- a/mp/src/public/tier0/threadtools.h +++ b/mp/src/public/tier0/threadtools.h @@ -833,8 +833,17 @@ template T strip_cv_quals_for_mutex(const T&); template T strip_cv_quals_for_mutex(volatile T&); template T strip_cv_quals_for_mutex(const volatile T&); +#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CXX11__) + +#define AUTO_LOCK( mutex ) \ + AUTO_LOCK_( decltype(::strip_cv_quals_for_mutex(mutex)), mutex ) + +#else + #define AUTO_LOCK( mutex ) \ AUTO_LOCK_( typeof(::strip_cv_quals_for_mutex(mutex)), mutex ) + +#endif #else // GNUC diff --git a/sp/src/public/tier0/threadtools.h b/sp/src/public/tier0/threadtools.h index 7faeff724..9535abb43 100644 --- a/sp/src/public/tier0/threadtools.h +++ b/sp/src/public/tier0/threadtools.h @@ -833,8 +833,17 @@ template T strip_cv_quals_for_mutex(const T&); template T strip_cv_quals_for_mutex(volatile T&); template T strip_cv_quals_for_mutex(const volatile T&); +#if (__cplusplus == 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CXX11__) + +#define AUTO_LOCK( mutex ) \ + AUTO_LOCK_( decltype(::strip_cv_quals_for_mutex(mutex)), mutex ) + +#else + #define AUTO_LOCK( mutex ) \ AUTO_LOCK_( typeof(::strip_cv_quals_for_mutex(mutex)), mutex ) + +#endif #else // GNUC