File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,16 @@ BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
239239 _Pragma (" diagnostic push" ) \
240240 _Pragma(" diag_suppress deprecated_entity_with_custom_message" )
241241#define BENCHMARK_RESTORE_DEPRECATED_WARNING _Pragma (" diagnostic pop" )
242+ #elif defined(_MSC_VER)
243+ #define BENCHMARK_BUILTIN_EXPECT (x, y ) x
244+ #define BENCHMARK_DEPRECATED_MSG (msg ) __declspec(deprecated(msg))
245+ #define BENCHMARK_WARNING_MSG (msg ) \
246+ __pragma (message(__FILE__ " (" BENCHMARK_INTERNAL_TOSTRING( \
247+ __LINE__) ") : warning note: " msg))
248+ #define BENCHMARK_DISABLE_DEPRECATED_WARNING \
249+ __pragma (warning(push)) \
250+ __pragma(warning(disable : 4996 ))
251+ #define BENCHMARK_RESTORE_DEPRECATED_WARNING __pragma (warning(pop))
242252#else
243253#define BENCHMARK_BUILTIN_EXPECT (x, y ) x
244254#define BENCHMARK_DEPRECATED_MSG (msg )
@@ -611,6 +621,17 @@ inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
611621 _ReadWriteBarrier ();
612622}
613623
624+ template <class Tp >
625+ inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize (Tp& value) {
626+ internal::UseCharPointer (&reinterpret_cast <char const volatile &>(value));
627+ _ReadWriteBarrier ();
628+ }
629+
630+ template <class Tp >
631+ inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize (Tp&& value) {
632+ internal::UseCharPointer (&reinterpret_cast <char const volatile &>(value));
633+ _ReadWriteBarrier ();
634+ }
614635#else
615636template <class Tp >
616637inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize (Tp&& value) {
You can’t perform that action at this time.
0 commit comments