diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-21 18:48:52 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-21 18:48:52 +0000 |
commit | 0eb9f434fb019da43b97c81d7e314885d43af0f9 (patch) | |
tree | 8e7bb2901b0e285ee2ce2875d241852ff14a168d | |
parent | f1a0eae704dcc8848847201d48922aa1984e522a (diff) | |
download | chromium_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
-rw-r--r-- | base/compiler_specific.h | 5 | ||||
-rw-r--r-- | chrome/common/logging_chrome.cc | 5 | ||||
-rw-r--r-- | webkit/glue/autofill_form.cc | 5 | ||||
-rw-r--r-- | webkit/glue/searchable_form_data.cc | 2 | ||||
-rwxr-xr-x | webkit/glue/stacking_order_iterator.cc | 5 | ||||
-rw-r--r-- | webkit/glue/weburlrequest_impl.cc | 5 | ||||
-rw-r--r-- | webkit/port/bridge/chromium/PluginsChromium.cpp | 7 | ||||
-rw-r--r-- | webkit/port/loader/IconLoader.cpp | 8 | ||||
-rw-r--r-- | webkit/port/platform/chromium/ClipboardChromium.cpp | 8 | ||||
-rw-r--r-- | webkit/port/platform/chromium/FileChooserChromium.cpp | 8 | ||||
-rw-r--r-- | webkit/port/platform/chromium/PopupMenuChromium.cpp | 8 | ||||
-rw-r--r-- | webkit/port/platform/chromium/PopupMenuChromium.h | 10 |
12 files changed, 57 insertions, 19 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 diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index b2a8381..575283b 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -14,6 +14,7 @@ #include "chrome/common/logging_chrome.h" #include "base/command_line.h" +#include "base/compiler_specific.h" #include "base/debug_util.h" #include "base/file_util.h" #include "base/logging.h" @@ -34,11 +35,11 @@ static bool chrome_logging_initialized_ = false; // Assertion handler for logging errors that occur when dialogs are // silenced. To record a new error, pass the log string associated // with that error in the str parameter. -#pragma optimize("", off) +MSVC_DISABLE_OPTIMIZE(); static void SilentRuntimeAssertHandler(const std::string& str) { DebugUtil::BreakDebugger(); } -#pragma optimize("", on) +MSVC_ENABLE_OPTIMIZE(); // Suppresses error/assertion dialogs and enables the logging of // those errors into silenced_errors_. diff --git a/webkit/glue/autofill_form.cc b/webkit/glue/autofill_form.cc index e5a4c5c..9ad9237 100644 --- a/webkit/glue/autofill_form.cc +++ b/webkit/glue/autofill_form.cc @@ -3,12 +3,13 @@ // found in the LICENSE file. #include "config.h" +#include "base/compiler_specific.h" -#pragma warning(push, 0) +MSVC_PUSH_WARNING_LEVEL(0); #include "Frame.h" #include "HTMLInputElement.h" #include "HTMLNames.h" -#pragma warning(pop) +MSVC_POP_WARNING(); #undef LOG diff --git a/webkit/glue/searchable_form_data.cc b/webkit/glue/searchable_form_data.cc index 582e78c..d8a982c 100644 --- a/webkit/glue/searchable_form_data.cc +++ b/webkit/glue/searchable_form_data.cc @@ -23,7 +23,7 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "ResourceRequest.h" #include "TextEncoding.h" #include <wtf/Vector.h> -#pragma warning(pop) +MSVC_POP_WARNING(); #undef LOG diff --git a/webkit/glue/stacking_order_iterator.cc b/webkit/glue/stacking_order_iterator.cc index c50c9b3..2d77ae9 100755 --- a/webkit/glue/stacking_order_iterator.cc +++ b/webkit/glue/stacking_order_iterator.cc @@ -3,11 +3,12 @@ // found in the LICENSE file. #include "config.h" +#include "base/compiler_specific.h" -#pragma warning(push, 0) +MSVC_PUSH_WARNING_LEVEL(0); #include "RenderLayer.h" #include "RenderObject.h" -#pragma warning(pop) +MSVC_POP_WARNING(); #undef LOG #include "webkit/glue/stacking_order_iterator.h" diff --git a/webkit/glue/weburlrequest_impl.cc b/webkit/glue/weburlrequest_impl.cc index 90e7f21..8dc1f17 100644 --- a/webkit/glue/weburlrequest_impl.cc +++ b/webkit/glue/weburlrequest_impl.cc @@ -3,12 +3,13 @@ // found in the LICENSE file. #include "config.h" +#include "base/compiler_specific.h" -#pragma warning(push, 0) +MSVC_PUSH_WARNING_LEVEL(0); #include "FormData.h" #include "HTTPHeaderMap.h" #include "ResourceRequest.h" -#pragma warning(pop) +MSVC_POP_WARNING(); #undef LOG #include "base/logging.h" diff --git a/webkit/port/bridge/chromium/PluginsChromium.cpp b/webkit/port/bridge/chromium/PluginsChromium.cpp index cdc69b1..20c2ce0 100644 --- a/webkit/port/bridge/chromium/PluginsChromium.cpp +++ b/webkit/port/bridge/chromium/PluginsChromium.cpp @@ -37,7 +37,14 @@ #include "ChromiumBridge.h" #include "PluginData.h" +#if COMPILER(MSVC) +__pragma(warning(push, 0)) +#endif #include "PluginInfoStore.h" +#if COMPILER(MSVC) +__pragma(warning(pop)) +#endif +#undef LOG namespace WebCore { diff --git a/webkit/port/loader/IconLoader.cpp b/webkit/port/loader/IconLoader.cpp index 345d2af..26c6c6cb 100644 --- a/webkit/port/loader/IconLoader.cpp +++ b/webkit/port/loader/IconLoader.cpp @@ -25,7 +25,9 @@ #include "config.h" -#pragma warning(push, 0) +#if COMPILER(MSVC) +__pragma(warning(push, 0)) +#endif #include "IconLoader.h" #include "Document.h" @@ -38,7 +40,9 @@ #include "ResourceResponse.h" #include "ResourceRequest.h" #include "SubresourceLoader.h" -#pragma warning(pop) +#if COMPILER(MSVC) +__pragma(warning(pop)) +#endif using namespace std; diff --git a/webkit/port/platform/chromium/ClipboardChromium.cpp b/webkit/port/platform/chromium/ClipboardChromium.cpp index 5087cdf..ac701fe 100644 --- a/webkit/port/platform/chromium/ClipboardChromium.cpp +++ b/webkit/port/platform/chromium/ClipboardChromium.cpp @@ -25,7 +25,9 @@ #include "config.h" -#pragma warning(push, 0) +#if COMPILER(MSVC) +__pragma(warning(push, 0)) +#endif #include "CachedImage.h" #include "ChromiumBridge.h" #include "ChromiumDataObject.h" @@ -53,7 +55,9 @@ #include "StringBuilder.h" #include "StringHash.h" #include <wtf/RefPtr.h> -#pragma warning(pop) +#if COMPILER(MSVC) +__pragma(warning(pop)) +#endif namespace WebCore { diff --git a/webkit/port/platform/chromium/FileChooserChromium.cpp b/webkit/port/platform/chromium/FileChooserChromium.cpp index 37a075e..2a80744 100644 --- a/webkit/port/platform/chromium/FileChooserChromium.cpp +++ b/webkit/port/platform/chromium/FileChooserChromium.cpp @@ -25,7 +25,9 @@ #include "config.h" -#pragma warning(push, 0) +#if COMPILER(MSVC) +__pragma(warning(push, 0)) +#endif #include "ChromeClientChromium.h" #include "Document.h" #include "Frame.h" @@ -35,7 +37,9 @@ #include "NotImplemented.h" #include "Page.h" #include "StringTruncator.h" -#pragma warning(pop) +#if COMPILER(MSVC) +__pragma(warning(pop)) +#endif namespace WebCore { diff --git a/webkit/port/platform/chromium/PopupMenuChromium.cpp b/webkit/port/platform/chromium/PopupMenuChromium.cpp index 29fcda3..5cda719 100644 --- a/webkit/port/platform/chromium/PopupMenuChromium.cpp +++ b/webkit/port/platform/chromium/PopupMenuChromium.cpp @@ -29,7 +29,9 @@ #include "config.h" -#pragma warning(push, 0) +#if COMPILER(MSVC) +__pragma(warning(push, 0)) +#endif #include "PopupMenu.h" #include "CharacterNames.h" @@ -55,7 +57,9 @@ #include "ScrollbarTheme.h" #include "SystemTime.h" #include "Widget.h" -#pragma warning(pop) +#if COMPILER(MSVC) +__pragma(warning(pop)) +#endif #include "webkit/port/platform/chromium/PopupMenuChromium.h" diff --git a/webkit/port/platform/chromium/PopupMenuChromium.h b/webkit/port/platform/chromium/PopupMenuChromium.h index 0b73774..0f97ee4 100644 --- a/webkit/port/platform/chromium/PopupMenuChromium.h +++ b/webkit/port/platform/chromium/PopupMenuChromium.h @@ -5,12 +5,18 @@ #ifndef PopupMenuChromium_h #define PopupMenuChromium_h -#pragma warning(push, 0) +#include "config.h" + +#if COMPILER(MSVC) +__pragma(warning(push, 0)) +#endif #include "PopupMenuClient.h" #include "FramelessScrollView.h" #include "IntRect.h" -#pragma warning(pop) +#if COMPILER(MSVC) +__pragma(warning(pop)) +#endif namespace WebCore { |