Wrap MSVC-specific pragmas. As -Wunknown-pragmas has been disabled for wtf,
some of these sneaked in.
BUG=2053
Review URL: http://codereview.chromium.org/11801
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5830 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index 4ab4c915..c9b7535 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -37,6 +37,9 @@
// Pop effects of innermost MSVC_PUSH_* macro.
#define MSVC_POP_WARNING() __pragma(warning(pop))
+#define MSVC_DISABLE_OPTIMIZE() __pragma(optimize("", off))
+#define MSVC_ENABLE_OPTIMIZE() __pragma(optimize("", on))
+
// Allows |this| to be passed as an argument in constructor initializer lists.
// This uses push/pop instead of the seemingly simpler suppress feature to avoid
// having the warning be disabled for more than just |code|.
@@ -56,6 +59,8 @@
#define MSVC_PUSH_DISABLE_WARNING(n)
#define MSVC_PUSH_WARNING_LEVEL(n)
#define MSVC_POP_WARNING()
+#define MSVC_DISABLE_OPTIMIZE()
+#define MSVC_ENABLE_OPTIMIZE()
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
#endif // COMPILER_MSVC