summaryrefslogtreecommitdiffstats
path: root/base/compiler_specific.h
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-21 18:48:52 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-21 18:48:52 +0000
commit0eb9f434fb019da43b97c81d7e314885d43af0f9 (patch)
tree8e7bb2901b0e285ee2ce2875d241852ff14a168d /base/compiler_specific.h
parentf1a0eae704dcc8848847201d48922aa1984e522a (diff)
downloadchromium_src-0eb9f434fb019da43b97c81d7e314885d43af0f9.zip
chromium_src-0eb9f434fb019da43b97c81d7e314885d43af0f9.tar.gz
chromium_src-0eb9f434fb019da43b97c81d7e314885d43af0f9.tar.bz2
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
Diffstat (limited to 'base/compiler_specific.h')
-rw-r--r--base/compiler_specific.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index 4ab4c91..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