0

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
This commit is contained in:
deanm@chromium.org
2008-11-21 18:48:52 +00:00
parent f1a0eae704
commit 0eb9f434fb
12 changed files with 57 additions and 19 deletions

@ -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

@ -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_.

@ -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

@ -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

@ -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"

@ -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"

@ -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 {

@ -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;

@ -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 {

@ -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 {

@ -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"

@ -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 {