From acbcc283da22f4e4791a9771345112a38c7c7886 Mon Sep 17 00:00:00 2001 From: "mjs@apple.com" Date: Tue, 5 Jan 2010 08:58:28 +0000 Subject: [PATCH] 2010-01-04 Maciej Stachowiak Reviewed by Darin Fisher. Reorganize, document and rename OS() platform macros. https://bugs.webkit.org/show_bug.cgi?id=33198 * wtf/Platform.h: Rename, reorganize and document OS() macros. Adapt to name changes. Also fixed a few incorrect OS checks. * API/JSContextRef.cpp: * assembler/MacroAssemblerARM.cpp: (JSC::isVFPPresent): * assembler/MacroAssemblerX86Common.h: * bytecode/SamplingTool.cpp: * config.h: * interpreter/RegisterFile.cpp: (JSC::RegisterFile::~RegisterFile): * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile): (JSC::RegisterFile::grow): * jit/ExecutableAllocator.h: * jit/ExecutableAllocatorFixedVMPool.cpp: * jit/ExecutableAllocatorPosix.cpp: * jit/ExecutableAllocatorSymbian.cpp: * jit/ExecutableAllocatorWin.cpp: * jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): * jit/JITStubs.cpp: * jsc.cpp: (main): * parser/Grammar.y: * profiler/ProfileNode.cpp: (JSC::getCount): * runtime/Collector.cpp: (JSC::Heap::Heap): (JSC::Heap::allocateBlock): (JSC::Heap::freeBlockPtr): (JSC::currentThreadStackBase): (JSC::getCurrentPlatformThread): (JSC::suspendThread): (JSC::resumeThread): (JSC::getPlatformThreadRegisters): (JSC::otherThreadStackPointer): * runtime/Collector.h: * runtime/DateConstructor.cpp: * runtime/DatePrototype.cpp: (JSC::formatLocaleDate): * runtime/InitializeThreading.cpp: (JSC::initializeThreading): * runtime/MarkStack.h: (JSC::MarkStack::MarkStackArray::shrinkAllocation): * runtime/MarkStackPosix.cpp: * runtime/MarkStackSymbian.cpp: * runtime/MarkStackWin.cpp: * runtime/StringPrototype.cpp: (JSC::stringProtoFuncLastIndexOf): * runtime/TimeoutChecker.cpp: (JSC::getCPUTime): * runtime/UString.cpp: (JSC::UString::from): * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/CurrentTime.cpp: (WTF::lowResUTCTime): * wtf/CurrentTime.h: (WTF::getLocalTime): * wtf/DateMath.cpp: * wtf/FastMalloc.cpp: (WTF::TCMalloc_ThreadCache::InitModule): (WTF::TCMallocStats::): * wtf/FastMalloc.h: * wtf/MathExtras.h: * wtf/RandomNumber.cpp: (WTF::randomNumber): * wtf/RandomNumberSeed.h: (WTF::initializeRandomNumberGenerator): * wtf/StringExtras.h: * wtf/TCSpinLock.h: (TCMalloc_SpinLock::Unlock): (TCMalloc_SlowLock): * wtf/TCSystemAlloc.cpp: * wtf/ThreadSpecific.h: (WTF::::destroy): * wtf/Threading.h: * wtf/ThreadingPthreads.cpp: (WTF::initializeThreading): (WTF::isMainThread): * wtf/ThreadingWin.cpp: (WTF::wtfThreadEntryPoint): (WTF::createThreadInternal): * wtf/VMTags.h: * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::userDefault): * wtf/win/MainThreadWin.cpp: (WTF::initializeMainThreadPlatform): 2010-01-04 Maciej Stachowiak Reviewed by Darin Fisher. Reorganize, document and rename OS() platform macros. https://bugs.webkit.org/show_bug.cgi?id=33198 Adapt to name changes. * src/ChromiumBridge.cpp: * src/EditorClientImpl.cpp: (WebKit::EditorClientImpl::isSelectTrailingWhitespaceEnabled): (WebKit::): (WebKit::EditorClientImpl::handleEditingKeyboardEvent): * src/FrameLoaderClientImpl.cpp: (WebKit::FrameLoaderClientImpl::createPlugin): * src/GraphicsContext3D.cpp: (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal): (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal): (WebCore::GraphicsContext3DInternal::makeContextCurrent): * src/WebFrameImpl.cpp: (WebKit::WebFrameImpl::selectionAsText): (WebKit::WebFrameImpl::printPage): * src/WebPluginContainerImpl.cpp: (WebKit::WebPluginContainerImpl::handleMouseEvent): (WebKit::WebPluginContainerImpl::handleKeyboardEvent): * src/WebViewImpl.cpp: (WebKit::WebViewImpl::mouseDown): (WebKit::WebViewImpl::mouseContextMenu): (WebKit::WebViewImpl::mouseUp): (WebKit::WebViewImpl::keyEvent): (WebKit::WebViewImpl::sendContextMenuEvent): (WebKit::WebViewImpl::setScrollbarColors): (WebKit::WebViewImpl::navigationPolicyFromMouseEvent): 2010-01-04 Maciej Stachowiak Reviewed by Darin Fisher. Reorganize, document and rename OS() platform macros. https://bugs.webkit.org/show_bug.cgi?id=33198 Adapt to name changes. * webkit/webkitwebsettings.cpp: (webkit_get_user_agent): 2010-01-04 Maciej Stachowiak Reviewed by Darin Fisher. Reorganize, document and rename OS() platform macros. https://bugs.webkit.org/show_bug.cgi?id=33198 Adapt to name changes. Also fixed a few incorrect OS checks. * accessibility/AccessibilityObject.h: * config.h: * dom/SelectElement.cpp: (WebCore::SelectElement::listBoxDefaultEventHandler): * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::platform): * loader/CachedFont.cpp: * loader/FTPDirectoryDocument.cpp: * loader/FTPDirectoryParser.cpp: * page/EventHandler.cpp: * page/Frame.cpp: (WebCore::Frame::setUseSecureKeyboardEntry): * page/NavigatorBase.cpp: (WebCore::NavigatorBase::platform): * page/Page.h: * page/Settings.cpp: (WebCore::Settings::Settings): * page/Settings.h: * page/chromium/DragControllerChromium.cpp: (WebCore::DragController::isCopyKeyDown): * page/chromium/EventHandlerChromium.cpp: (WebCore::EventHandler::accessKeyModifiers): * page/win/EventHandlerWin.cpp: (WebCore::EventHandler::createDraggingClipboard): * platform/FileSystem.h: * platform/KeyboardCodes.h: * platform/PurgeableBuffer.h: * platform/chromium/ChromiumBridge.h: * platform/chromium/ClipboardChromium.cpp: (WebCore::ClipboardChromium::writeRange): * platform/chromium/ClipboardUtilitiesChromium.cpp: * platform/chromium/ClipboardUtilitiesChromium.h: * platform/chromium/PasteboardChromium.cpp: (WebCore::Pasteboard::writeSelection): (WebCore::Pasteboard::writePlainText): (WebCore::Pasteboard::documentFragment): * platform/chromium/PlatformKeyboardEventChromium.cpp: (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): (WebCore::PlatformKeyboardEvent::currentCapsLockState): * platform/chromium/PopupMenuChromium.cpp: (WebCore::PopupListBox::layout): (WebCore::PopupMenu::show): * platform/graphics/BitmapImage.h: (WebCore::BitmapImage::mayFillWithSolidColor): * platform/graphics/FloatPoint.h: * platform/graphics/FloatRect.h: * platform/graphics/FloatSize.h: * platform/graphics/FontCache.cpp: (WebCore::alternateFamilyName): * platform/graphics/FontCache.h: * platform/graphics/FontFastPath.cpp: (WebCore::Font::glyphDataForCharacter): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::advanceAt): (WebCore::GlyphBuffer::add): * platform/graphics/Gradient.h: * platform/graphics/GraphicsContext.cpp: * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsContext3D.h: * platform/graphics/ImageSource.h: * platform/graphics/IntRect.h: * platform/graphics/MediaPlayer.cpp: * platform/graphics/Path.h: * platform/graphics/Pattern.h: * platform/graphics/SimpleFontData.h: * platform/graphics/cg/ColorCG.cpp: * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/chromium/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::~FontCustomPlatformData): (WebCore::FontCustomPlatformData::fontPlatformData): (WebCore::createFontCustomPlatformData): * platform/graphics/chromium/FontCustomPlatformData.h: * platform/graphics/chromium/FontPlatformData.h: * platform/graphics/opentype/OpenTypeUtilities.cpp: * platform/graphics/opentype/OpenTypeUtilities.h: * platform/graphics/qt/GraphicsContextQt.cpp: (WebCore::GraphicsContext::getWindowsContext): * platform/graphics/qt/ImageQt.cpp: * platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::GraphicsContext::clipToImageBuffer): * platform/graphics/skia/ImageBufferSkia.cpp: (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/skia/PlatformContextSkia.cpp: (PlatformContextSkia::State::State): (PlatformContextSkia::PlatformContextSkia): (PlatformContextSkia::save): (PlatformContextSkia::restore): * platform/graphics/skia/PlatformContextSkia.h: * platform/graphics/win/IconWin.cpp: (WebCore::Icon::createIconForFiles): (WebCore::Icon::paint): * platform/graphics/wx/GraphicsContextWx.cpp: * platform/gtk/FileSystemGtk.cpp: (WebCore::filenameToString): (WebCore::filenameFromString): (WebCore::filenameForDisplay): * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: * platform/network/curl/ResourceHandleManager.cpp: * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::): * platform/text/String.cpp: (WebCore::String::format): (WebCore::String::number): * platform/text/TextEncoding.cpp: (WebCore::TextEncoding::encode): * platform/text/TextEncodingRegistry.cpp: (WebCore::buildBaseTextCodecMaps): (WebCore::extendTextCodecMaps): * platform/text/TextStream.cpp: * platform/text/TextStream.h: * platform/text/qt/TextCodecQt.cpp: (WebCore::TextCodecQt::decode): * platform/win/PlatformMouseEventWin.cpp: (WebCore::messageToEventType): (WebCore::PlatformMouseEvent::PlatformMouseEvent): * platform/win/PlatformScreenWin.cpp: (WebCore::deviceInfoForWidget): (WebCore::screenIsMonochrome): * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenu::show): (WebCore::PopupMenu::paint): (WebCore::PopupMenu::registerClass): (WebCore::PopupMenu::PopupMenuWndProc): (WebCore::PopupMenu::wndProc): * platform/win/SystemTimeWin.cpp: (WebCore::userIdleTime): * platform/wx/FileSystemWx.cpp: (WebCore::unloadModule): * plugins/PluginDatabase.cpp: * plugins/PluginPackage.cpp: (WebCore::PluginPackage::compareFileVersion): * plugins/PluginPackage.h: * plugins/PluginView.cpp: (WebCore::PluginView::setFrameRect): (WebCore::PluginView::stop): (WebCore::PluginView::PluginView): * plugins/PluginView.h: * plugins/win/PluginDatabaseWin.cpp: (WebCore::addWindowsMediaPlayerPluginDirectory): (WebCore::addMacromediaPluginDirectories): * plugins/win/PluginPackageWin.cpp: (WebCore::PluginPackage::load): * plugins/win/PluginViewWin.cpp: (WebCore::registerPluginView): (WebCore::PluginView::wndProc): (WebCore::PluginView::updatePluginWidget): (WebCore::PluginView::paintIntoTransformedContext): (WebCore::PluginView::paintWindowedPluginIntoContext): (WebCore::PluginView::paint): (WebCore::PluginView::handleMouseEvent): (WebCore::PluginView::setParent): (WebCore::PluginView::setNPWindowRect): (WebCore::PluginView::platformStart): 2010-01-04 Maciej Stachowiak Reviewed by Darin Fisher. Reorganize, document and rename OS() platform macros. https://bugs.webkit.org/show_bug.cgi?id=33198 Adapt to name changes. * DumpRenderTree/DumpRenderTree.h: * DumpRenderTree/config.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52791 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- JavaScriptCore/API/JSContextRef.cpp | 6 +- JavaScriptCore/ChangeLog | 98 ++++++++ .../assembler/MacroAssemblerARM.cpp | 4 +- .../assembler/MacroAssemblerX86Common.h | 6 +- JavaScriptCore/bytecode/SamplingTool.cpp | 4 +- JavaScriptCore/config.h | 8 +- JavaScriptCore/interpreter/RegisterFile.cpp | 2 +- JavaScriptCore/interpreter/RegisterFile.h | 8 +- JavaScriptCore/jit/ExecutableAllocator.h | 14 +- .../jit/ExecutableAllocatorFixedVMPool.cpp | 2 +- .../jit/ExecutableAllocatorPosix.cpp | 6 +- .../jit/ExecutableAllocatorSymbian.cpp | 2 +- JavaScriptCore/jit/ExecutableAllocatorWin.cpp | 2 +- JavaScriptCore/jit/JITOpcodes.cpp | 8 +- JavaScriptCore/jit/JITStubs.cpp | 18 +- JavaScriptCore/jsc.cpp | 8 +- JavaScriptCore/parser/Grammar.y | 2 +- JavaScriptCore/profiler/ProfileNode.cpp | 4 +- JavaScriptCore/runtime/Collector.cpp | 99 ++++---- JavaScriptCore/runtime/Collector.h | 2 +- JavaScriptCore/runtime/DateConstructor.cpp | 2 +- JavaScriptCore/runtime/DatePrototype.cpp | 4 +- .../runtime/InitializeThreading.cpp | 4 +- JavaScriptCore/runtime/MarkStack.h | 2 +- JavaScriptCore/runtime/MarkStackPosix.cpp | 2 +- JavaScriptCore/runtime/MarkStackSymbian.cpp | 2 +- JavaScriptCore/runtime/MarkStackWin.cpp | 2 +- JavaScriptCore/runtime/StringPrototype.cpp | 2 +- JavaScriptCore/runtime/TimeoutChecker.cpp | 8 +- JavaScriptCore/runtime/UString.cpp | 2 +- JavaScriptCore/wtf/Assertions.cpp | 10 +- JavaScriptCore/wtf/Assertions.h | 8 +- JavaScriptCore/wtf/CurrentTime.cpp | 8 +- JavaScriptCore/wtf/CurrentTime.h | 2 +- JavaScriptCore/wtf/DateMath.cpp | 4 +- JavaScriptCore/wtf/FastMalloc.cpp | 26 +-- JavaScriptCore/wtf/FastMalloc.h | 2 +- JavaScriptCore/wtf/MathExtras.h | 12 +- JavaScriptCore/wtf/Platform.h | 218 ++++++++++-------- JavaScriptCore/wtf/RandomNumber.cpp | 10 +- JavaScriptCore/wtf/RandomNumberSeed.h | 10 +- JavaScriptCore/wtf/StringExtras.h | 8 +- JavaScriptCore/wtf/TCSpinLock.h | 6 +- JavaScriptCore/wtf/TCSystemAlloc.cpp | 2 +- JavaScriptCore/wtf/ThreadSpecific.h | 14 +- JavaScriptCore/wtf/Threading.h | 18 +- JavaScriptCore/wtf/ThreadingPthreads.cpp | 10 +- JavaScriptCore/wtf/ThreadingWin.cpp | 10 +- JavaScriptCore/wtf/VMTags.h | 6 +- .../wtf/unicode/icu/CollatorICU.cpp | 6 +- JavaScriptCore/wtf/win/MainThreadWin.cpp | 6 +- WebCore/ChangeLog | 163 +++++++++++++ WebCore/accessibility/AccessibilityObject.h | 4 +- WebCore/config.h | 12 +- WebCore/dom/SelectElement.cpp | 6 +- WebCore/inspector/InspectorFrontendHost.cpp | 2 +- WebCore/loader/CachedFont.cpp | 2 +- WebCore/loader/FTPDirectoryDocument.cpp | 4 +- WebCore/loader/FTPDirectoryParser.cpp | 4 +- WebCore/page/EventHandler.cpp | 2 +- WebCore/page/Frame.cpp | 6 +- WebCore/page/NavigatorBase.cpp | 8 +- WebCore/page/Page.h | 4 +- WebCore/page/Settings.cpp | 6 +- WebCore/page/Settings.h | 4 +- .../page/chromium/DragControllerChromium.cpp | 4 +- .../page/chromium/EventHandlerChromium.cpp | 6 +- WebCore/page/win/EventHandlerWin.cpp | 2 +- WebCore/platform/FileSystem.h | 8 +- WebCore/platform/KeyboardCodes.h | 18 +- WebCore/platform/PurgeableBuffer.h | 2 +- WebCore/platform/chromium/ChromiumBridge.h | 8 +- .../platform/chromium/ClipboardChromium.cpp | 4 +- .../chromium/ClipboardUtilitiesChromium.cpp | 2 +- .../chromium/ClipboardUtilitiesChromium.h | 2 +- .../platform/chromium/PasteboardChromium.cpp | 8 +- .../PlatformKeyboardEventChromium.cpp | 12 +- .../platform/chromium/PopupMenuChromium.cpp | 6 +- WebCore/platform/graphics/BitmapImage.h | 6 +- WebCore/platform/graphics/FloatPoint.h | 4 +- WebCore/platform/graphics/FloatRect.h | 4 +- WebCore/platform/graphics/FloatSize.h | 4 +- WebCore/platform/graphics/FontCache.cpp | 4 +- WebCore/platform/graphics/FontCache.h | 2 +- WebCore/platform/graphics/FontFastPath.cpp | 4 +- WebCore/platform/graphics/GlyphBuffer.h | 10 +- WebCore/platform/graphics/Gradient.h | 2 +- WebCore/platform/graphics/GraphicsContext.cpp | 2 +- WebCore/platform/graphics/GraphicsContext.h | 10 +- WebCore/platform/graphics/GraphicsContext3D.h | 2 +- WebCore/platform/graphics/ImageSource.h | 4 +- WebCore/platform/graphics/IntRect.h | 6 +- WebCore/platform/graphics/MediaPlayer.cpp | 2 +- WebCore/platform/graphics/Path.h | 2 +- WebCore/platform/graphics/Pattern.h | 2 +- WebCore/platform/graphics/SimpleFontData.h | 10 +- WebCore/platform/graphics/cg/ColorCG.cpp | 4 +- .../graphics/cg/GraphicsContextCG.cpp | 2 +- .../chromium/FontCustomPlatformData.cpp | 24 +- .../chromium/FontCustomPlatformData.h | 12 +- .../graphics/chromium/FontPlatformData.h | 4 +- .../graphics/opentype/OpenTypeUtilities.cpp | 2 +- .../graphics/opentype/OpenTypeUtilities.h | 2 +- .../graphics/qt/GraphicsContextQt.cpp | 2 +- WebCore/platform/graphics/qt/ImageQt.cpp | 2 +- .../graphics/skia/GraphicsContextSkia.cpp | 2 +- .../graphics/skia/ImageBufferSkia.cpp | 2 +- .../graphics/skia/PlatformContextSkia.cpp | 16 +- .../graphics/skia/PlatformContextSkia.h | 8 +- WebCore/platform/graphics/win/IconWin.cpp | 6 +- .../graphics/wx/GraphicsContextWx.cpp | 2 +- WebCore/platform/gtk/FileSystemGtk.cpp | 6 +- .../image-decoders/jpeg/JPEGImageDecoder.cpp | 2 +- .../network/curl/ResourceHandleManager.cpp | 2 +- .../network/soup/ResourceHandleSoup.cpp | 2 +- WebCore/platform/text/String.cpp | 6 +- WebCore/platform/text/TextEncoding.cpp | 2 +- .../platform/text/TextEncodingRegistry.cpp | 6 +- WebCore/platform/text/TextStream.cpp | 2 +- WebCore/platform/text/TextStream.h | 2 +- WebCore/platform/text/qt/TextCodecQt.cpp | 2 +- .../platform/win/PlatformMouseEventWin.cpp | 4 +- WebCore/platform/win/PlatformScreenWin.cpp | 4 +- WebCore/platform/win/PopupMenuWin.cpp | 18 +- WebCore/platform/win/SystemTimeWin.cpp | 2 +- WebCore/platform/wx/FileSystemWx.cpp | 6 +- WebCore/plugins/PluginDatabase.cpp | 4 +- WebCore/plugins/PluginPackage.cpp | 8 +- WebCore/plugins/PluginPackage.h | 10 +- WebCore/plugins/PluginView.cpp | 12 +- WebCore/plugins/PluginView.h | 16 +- WebCore/plugins/win/PluginDatabaseWin.cpp | 6 +- WebCore/plugins/win/PluginPackageWin.cpp | 4 +- WebCore/plugins/win/PluginViewWin.cpp | 42 ++-- WebKit/chromium/ChangeLog | 35 +++ WebKit/chromium/src/ChromiumBridge.cpp | 10 +- WebKit/chromium/src/EditorClientImpl.cpp | 24 +- WebKit/chromium/src/FrameLoaderClientImpl.cpp | 2 +- WebKit/chromium/src/GraphicsContext3D.cpp | 30 +-- WebKit/chromium/src/WebFrameImpl.cpp | 10 +- .../chromium/src/WebPluginContainerImpl.cpp | 4 +- WebKit/chromium/src/WebViewImpl.cpp | 30 +-- WebKit/gtk/ChangeLog | 12 + WebKit/gtk/webkit/webkitwebsettings.cpp | 10 +- WebKitTools/ChangeLog | 12 + WebKitTools/DumpRenderTree/DumpRenderTree.h | 2 +- WebKitTools/DumpRenderTree/config.h | 2 +- 147 files changed, 951 insertions(+), 608 deletions(-) diff --git a/JavaScriptCore/API/JSContextRef.cpp b/JavaScriptCore/API/JSContextRef.cpp index e1f465de204..c821bb3e432 100644 --- a/JavaScriptCore/API/JSContextRef.cpp +++ b/JavaScriptCore/API/JSContextRef.cpp @@ -35,7 +35,7 @@ #include "JSObject.h" #include -#if PLATFORM(DARWIN) +#if OS(DARWIN) #include static const int32_t webkitFirstVersionWithConcurrentGlobalContexts = 0x2100500; // 528.5.0 @@ -63,7 +63,7 @@ void JSContextGroupRelease(JSContextGroupRef group) JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass) { initializeThreading(); -#if PLATFORM(DARWIN) +#if OS(DARWIN) // When running on Tiger or Leopard, or if the application was linked before JSGlobalContextCreate was changed // to use a unique JSGlobalData, we use a shared one for compatibility. #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) @@ -74,7 +74,7 @@ JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass) JSLock lock(LockForReal); return JSGlobalContextCreateInGroup(toRef(&JSGlobalData::sharedInstance()), globalObjectClass); } -#endif // PLATFORM(DARWIN) +#endif // OS(DARWIN) return JSGlobalContextCreateInGroup(0, globalObjectClass); } diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog index cfb97d1c6a3..10aa66a3b3f 100644 --- a/JavaScriptCore/ChangeLog +++ b/JavaScriptCore/ChangeLog @@ -1,3 +1,101 @@ +2010-01-04 Maciej Stachowiak + + Reviewed by Darin Fisher. + + Reorganize, document and rename OS() platform macros. + https://bugs.webkit.org/show_bug.cgi?id=33198 + + * wtf/Platform.h: Rename, reorganize and document OS() macros. + + Adapt to name changes. Also fixed a few incorrect OS checks. + + * API/JSContextRef.cpp: + * assembler/MacroAssemblerARM.cpp: + (JSC::isVFPPresent): + * assembler/MacroAssemblerX86Common.h: + * bytecode/SamplingTool.cpp: + * config.h: + * interpreter/RegisterFile.cpp: + (JSC::RegisterFile::~RegisterFile): + * interpreter/RegisterFile.h: + (JSC::RegisterFile::RegisterFile): + (JSC::RegisterFile::grow): + * jit/ExecutableAllocator.h: + * jit/ExecutableAllocatorFixedVMPool.cpp: + * jit/ExecutableAllocatorPosix.cpp: + * jit/ExecutableAllocatorSymbian.cpp: + * jit/ExecutableAllocatorWin.cpp: + * jit/JITOpcodes.cpp: + (JSC::JIT::privateCompileCTIMachineTrampolines): + * jit/JITStubs.cpp: + * jsc.cpp: + (main): + * parser/Grammar.y: + * profiler/ProfileNode.cpp: + (JSC::getCount): + * runtime/Collector.cpp: + (JSC::Heap::Heap): + (JSC::Heap::allocateBlock): + (JSC::Heap::freeBlockPtr): + (JSC::currentThreadStackBase): + (JSC::getCurrentPlatformThread): + (JSC::suspendThread): + (JSC::resumeThread): + (JSC::getPlatformThreadRegisters): + (JSC::otherThreadStackPointer): + * runtime/Collector.h: + * runtime/DateConstructor.cpp: + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + * runtime/InitializeThreading.cpp: + (JSC::initializeThreading): + * runtime/MarkStack.h: + (JSC::MarkStack::MarkStackArray::shrinkAllocation): + * runtime/MarkStackPosix.cpp: + * runtime/MarkStackSymbian.cpp: + * runtime/MarkStackWin.cpp: + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncLastIndexOf): + * runtime/TimeoutChecker.cpp: + (JSC::getCPUTime): + * runtime/UString.cpp: + (JSC::UString::from): + * wtf/Assertions.cpp: + * wtf/Assertions.h: + * wtf/CurrentTime.cpp: + (WTF::lowResUTCTime): + * wtf/CurrentTime.h: + (WTF::getLocalTime): + * wtf/DateMath.cpp: + * wtf/FastMalloc.cpp: + (WTF::TCMalloc_ThreadCache::InitModule): + (WTF::TCMallocStats::): + * wtf/FastMalloc.h: + * wtf/MathExtras.h: + * wtf/RandomNumber.cpp: + (WTF::randomNumber): + * wtf/RandomNumberSeed.h: + (WTF::initializeRandomNumberGenerator): + * wtf/StringExtras.h: + * wtf/TCSpinLock.h: + (TCMalloc_SpinLock::Unlock): + (TCMalloc_SlowLock): + * wtf/TCSystemAlloc.cpp: + * wtf/ThreadSpecific.h: + (WTF::::destroy): + * wtf/Threading.h: + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): + (WTF::isMainThread): + * wtf/ThreadingWin.cpp: + (WTF::wtfThreadEntryPoint): + (WTF::createThreadInternal): + * wtf/VMTags.h: + * wtf/unicode/icu/CollatorICU.cpp: + (WTF::Collator::userDefault): + * wtf/win/MainThreadWin.cpp: + (WTF::initializeMainThreadPlatform): + 2010-01-04 Gustavo Noronha Silva Add missing files to the build system - make distcheck build fix. diff --git a/JavaScriptCore/assembler/MacroAssemblerARM.cpp b/JavaScriptCore/assembler/MacroAssemblerARM.cpp index e636072a3ef..b5b20fa07d2 100644 --- a/JavaScriptCore/assembler/MacroAssemblerARM.cpp +++ b/JavaScriptCore/assembler/MacroAssemblerARM.cpp @@ -30,7 +30,7 @@ #include "MacroAssemblerARM.h" -#if PLATFORM(LINUX) +#if OS(LINUX) #include #include #include @@ -43,7 +43,7 @@ namespace JSC { static bool isVFPPresent() { -#if PLATFORM(LINUX) +#if OS(LINUX) int fd = open("/proc/self/auxv", O_RDONLY); if (fd > 0) { Elf32_auxv_t aux; diff --git a/JavaScriptCore/assembler/MacroAssemblerX86Common.h b/JavaScriptCore/assembler/MacroAssemblerX86Common.h index dd0b82b9d10..449df86c667 100644 --- a/JavaScriptCore/assembler/MacroAssemblerX86Common.h +++ b/JavaScriptCore/assembler/MacroAssemblerX86Common.h @@ -945,7 +945,7 @@ private: friend class MacroAssemblerX86; #if CPU(X86) -#if PLATFORM(MAC) +#if OS(MAC_OS_X) // All X86 Macs are guaranteed to support at least SSE2, static bool isSSE2Present() @@ -953,7 +953,7 @@ private: return true; } -#else // PLATFORM(MAC) +#else // OS(MAC_OS_X) enum SSE2CheckState { NotCheckedSSE2, @@ -996,7 +996,7 @@ private: static SSE2CheckState s_sse2CheckState; -#endif // PLATFORM(MAC) +#endif // OS(MAC_OS_X) #elif !defined(NDEBUG) // CPU(X86) // On x86-64 we should never be checking for SSE2 in a non-debug build, diff --git a/JavaScriptCore/bytecode/SamplingTool.cpp b/JavaScriptCore/bytecode/SamplingTool.cpp index 865c919335e..3f0babc5491 100644 --- a/JavaScriptCore/bytecode/SamplingTool.cpp +++ b/JavaScriptCore/bytecode/SamplingTool.cpp @@ -33,7 +33,7 @@ #include "Interpreter.h" #include "Opcode.h" -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) #include #endif @@ -91,7 +91,7 @@ void SamplingFlags::stop() {} uint32_t SamplingFlags::s_flags = 1 << 15; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) static void sleepForMicroseconds(unsigned us) { diff --git a/JavaScriptCore/config.h b/JavaScriptCore/config.h index 30757db2902..006ab3dce51 100644 --- a/JavaScriptCore/config.h +++ b/JavaScriptCore/config.h @@ -25,7 +25,7 @@ #include -#if PLATFORM(WIN_OS) && !defined(BUILDING_WX__) && !COMPILER(GCC) +#if OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC) #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF) #define JS_EXPORTDATA __declspec(dllexport) #else @@ -35,14 +35,14 @@ #define JS_EXPORTDATA #endif -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) // If we don't define these, they get defined in windef.h. // We want to use std::min and std::max #define max max #define min min -#if !COMPILER(MSVC7) && !PLATFORM(WINCE) +#if !COMPILER(MSVC7) && !OS(WINCE) // We need to define this before the first #include of stdlib.h or it won't contain rand_s. #ifndef _CRT_RAND_S #define _CRT_RAND_S @@ -51,7 +51,7 @@ #endif -#if PLATFORM(FREEBSD) || PLATFORM(OPENBSD) +#if OS(FREEBSD) || OS(OPENBSD) #define HAVE_PTHREAD_NP_H 1 #endif diff --git a/JavaScriptCore/interpreter/RegisterFile.cpp b/JavaScriptCore/interpreter/RegisterFile.cpp index 54241995968..510effe0dd6 100644 --- a/JavaScriptCore/interpreter/RegisterFile.cpp +++ b/JavaScriptCore/interpreter/RegisterFile.cpp @@ -36,7 +36,7 @@ RegisterFile::~RegisterFile() #if HAVE(MMAP) munmap(m_buffer, ((m_max - m_start) + m_maxGlobals) * sizeof(Register)); #elif HAVE(VIRTUALALLOC) -#if PLATFORM(WINCE) +#if OS(WINCE) VirtualFree(m_buffer, DWORD(m_commitEnd) - DWORD(m_buffer), MEM_DECOMMIT); #endif VirtualFree(m_buffer, 0, MEM_RELEASE); diff --git a/JavaScriptCore/interpreter/RegisterFile.h b/JavaScriptCore/interpreter/RegisterFile.h index 953c70f7bca..1fc4f828b48 100644 --- a/JavaScriptCore/interpreter/RegisterFile.h +++ b/JavaScriptCore/interpreter/RegisterFile.h @@ -176,7 +176,7 @@ namespace JSC { #if HAVE(MMAP) m_buffer = static_cast(mmap(0, bufferLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, VM_TAG_FOR_REGISTERFILE_MEMORY, 0)); if (m_buffer == MAP_FAILED) { -#if PLATFORM(WINCE) +#if OS(WINCE) fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); #else fprintf(stderr, "Could not allocate register file: %d\n", errno); @@ -186,7 +186,7 @@ namespace JSC { #elif HAVE(VIRTUALALLOC) m_buffer = static_cast(VirtualAlloc(0, roundUpAllocationSize(bufferLength, commitSize), MEM_RESERVE, PAGE_READWRITE)); if (!m_buffer) { -#if PLATFORM(WINCE) +#if OS(WINCE) fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); #else fprintf(stderr, "Could not allocate register file: %d\n", errno); @@ -196,7 +196,7 @@ namespace JSC { size_t committedSize = roundUpAllocationSize(maxGlobals * sizeof(Register), commitSize); void* commitCheck = VirtualAlloc(m_buffer, committedSize, MEM_COMMIT, PAGE_READWRITE); if (commitCheck != m_buffer) { -#if PLATFORM(WINCE) +#if OS(WINCE) fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); #else fprintf(stderr, "Could not allocate register file: %d\n", errno); @@ -242,7 +242,7 @@ namespace JSC { if (newEnd > m_commitEnd) { size_t size = roundUpAllocationSize(reinterpret_cast(newEnd) - reinterpret_cast(m_commitEnd), commitSize); if (!VirtualAlloc(m_commitEnd, size, MEM_COMMIT, PAGE_READWRITE)) { -#if PLATFORM(WINCE) +#if OS(WINCE) fprintf(stderr, "Could not allocate register file: %d\n", GetLastError()); #else fprintf(stderr, "Could not allocate register file: %d\n", errno); diff --git a/JavaScriptCore/jit/ExecutableAllocator.h b/JavaScriptCore/jit/ExecutableAllocator.h index c73bd1b4431..8d4b36d571f 100644 --- a/JavaScriptCore/jit/ExecutableAllocator.h +++ b/JavaScriptCore/jit/ExecutableAllocator.h @@ -34,12 +34,12 @@ #include #include -#if PLATFORM(IPHONE) +#if OS(IPHONE_OS) #include #include #endif -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) #include #endif @@ -85,7 +85,7 @@ private: struct Allocation { char* pages; size_t size; -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) RChunk* chunk; #endif }; @@ -190,13 +190,13 @@ public: static void cacheFlush(void*, size_t) { } -#elif CPU(ARM_THUMB2) && PLATFORM(IPHONE) +#elif CPU(ARM_THUMB2) && OS(IPHONE_OS) static void cacheFlush(void* code, size_t size) { sys_dcache_flush(code, size); sys_icache_invalidate(code, size); } -#elif CPU(ARM_THUMB2) && PLATFORM(LINUX) +#elif CPU(ARM_THUMB2) && OS(LINUX) static void cacheFlush(void* code, size_t size) { asm volatile ( @@ -212,12 +212,12 @@ public: : "r" (code), "r" (reinterpret_cast(code) + size) : "r0", "r1", "r2"); } -#elif PLATFORM(SYMBIAN) +#elif OS(SYMBIAN) static void cacheFlush(void* code, size_t size) { User::IMB_Range(code, static_cast(code) + size); } -#elif CPU(ARM_TRADITIONAL) && PLATFORM(LINUX) +#elif CPU(ARM_TRADITIONAL) && OS(LINUX) static void cacheFlush(void* code, size_t size) { asm volatile ( diff --git a/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp b/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp index 9f6412df612..dd1db4e24ab 100644 --- a/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp +++ b/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp @@ -29,7 +29,7 @@ #include -#if ENABLE(ASSEMBLER) && PLATFORM(MAC) && CPU(X86_64) +#if ENABLE(ASSEMBLER) && OS(DARWIN) && CPU(X86_64) #include "TCSpinLock.h" #include diff --git a/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp b/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp index 0cb9052d3bb..06375adb537 100644 --- a/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp +++ b/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp @@ -27,7 +27,7 @@ #include "ExecutableAllocator.h" -#if ENABLE(ASSEMBLER) && PLATFORM(UNIX) && !PLATFORM(SYMBIAN) +#if ENABLE(ASSEMBLER) && OS(UNIX) && !OS(SYMBIAN) #include #include @@ -35,7 +35,7 @@ namespace JSC { -#if !(PLATFORM(MAC) && CPU(X86_64)) +#if !(OS(DARWIN) && CPU(X86_64)) void ExecutableAllocator::intializePageSize() { @@ -57,7 +57,7 @@ void ExecutablePool::systemRelease(const ExecutablePool::Allocation& alloc) ASSERT_UNUSED(result, !result); } -#endif // !(PLATFORM(MAC) && CPU(X86_64)) +#endif // !(OS(DARWIN) && CPU(X86_64)) #if ENABLE(ASSEMBLER_WX_EXCLUSIVE) void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSeting setting) diff --git a/JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp b/JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp index d8e812a836b..e82975c9c25 100644 --- a/JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp +++ b/JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp @@ -22,7 +22,7 @@ #include "ExecutableAllocator.h" -#if ENABLE(ASSEMBLER) && PLATFORM(SYMBIAN) +#if ENABLE(ASSEMBLER) && OS(SYMBIAN) #include #include diff --git a/JavaScriptCore/jit/ExecutableAllocatorWin.cpp b/JavaScriptCore/jit/ExecutableAllocatorWin.cpp index bf6274a667f..e38323c5fdd 100644 --- a/JavaScriptCore/jit/ExecutableAllocatorWin.cpp +++ b/JavaScriptCore/jit/ExecutableAllocatorWin.cpp @@ -27,7 +27,7 @@ #include "ExecutableAllocator.h" -#if ENABLE(ASSEMBLER) && PLATFORM(WIN_OS) +#if ENABLE(ASSEMBLER) && OS(WINDOWS) #include "windows.h" diff --git a/JavaScriptCore/jit/JITOpcodes.cpp b/JavaScriptCore/jit/JITOpcodes.cpp index 5f5623bc73f..d9a32d9ae39 100644 --- a/JavaScriptCore/jit/JITOpcodes.cpp +++ b/JavaScriptCore/jit/JITOpcodes.cpp @@ -160,7 +160,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr* executable * stack pointer by the right amount after the call. */ -#if COMPILER(MSVC) || PLATFORM(LINUX) +#if COMPILER(MSVC) || OS(LINUX) #if COMPILER(MSVC) #pragma pack(push) #pragma pack(4) @@ -223,7 +223,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr* executable storePtr(regT2, Address(stackPointerRegister, OBJECT_OFFSETOF(NativeCallFrameStructure, thisValue) + OBJECT_OFFSETOF(JSValue, u.asBits.payload))); storePtr(regT3, Address(stackPointerRegister, OBJECT_OFFSETOF(NativeCallFrameStructure, thisValue) + OBJECT_OFFSETOF(JSValue, u.asBits.tag))); -#if COMPILER(MSVC) || PLATFORM(LINUX) +#if COMPILER(MSVC) || OS(LINUX) // ArgList is passed by reference so is stackPointerRegister + 4 * sizeof(Register) addPtr(Imm32(OBJECT_OFFSETOF(NativeCallFrameStructure, result)), stackPointerRegister, X86Registers::ecx); @@ -1648,7 +1648,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr* executable * not the rest of the callframe so we need a nice way to ensure we increment the * stack pointer by the right amount after the call. */ -#if COMPILER(MSVC) || PLATFORM(LINUX) +#if COMPILER(MSVC) || OS(LINUX) struct NativeCallFrameStructure { // CallFrame* callFrame; // passed in EDX JSObject* callee; @@ -1701,7 +1701,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr* executable loadPtr(Address(regT1, -(int)sizeof(Register)), regT1); storePtr(regT1, Address(stackPointerRegister, OBJECT_OFFSETOF(NativeCallFrameStructure, thisValue))); -#if COMPILER(MSVC) || PLATFORM(LINUX) +#if COMPILER(MSVC) || OS(LINUX) // ArgList is passed by reference so is stackPointerRegister + 4 * sizeof(Register) addPtr(Imm32(OBJECT_OFFSETOF(NativeCallFrameStructure, result)), stackPointerRegister, X86Registers::ecx); diff --git a/JavaScriptCore/jit/JITStubs.cpp b/JavaScriptCore/jit/JITStubs.cpp index 9a32a463727..5fa2f65b287 100644 --- a/JavaScriptCore/jit/JITStubs.cpp +++ b/JavaScriptCore/jit/JITStubs.cpp @@ -64,31 +64,37 @@ using namespace std; namespace JSC { -#if PLATFORM(DARWIN) || PLATFORM(WIN_OS) +#if OS(DARWIN) || OS(WINDOWS) #define SYMBOL_STRING(name) "_" #name #else #define SYMBOL_STRING(name) #name #endif -#if PLATFORM(IPHONE) +#if OS(IPHONE_OS) #define THUMB_FUNC_PARAM(name) SYMBOL_STRING(name) #else #define THUMB_FUNC_PARAM(name) #endif -#if PLATFORM(LINUX) && CPU(X86_64) +#if OS(LINUX) && CPU(X86_64) #define SYMBOL_STRING_RELOCATION(name) #name "@plt" #else #define SYMBOL_STRING_RELOCATION(name) SYMBOL_STRING(name) #endif -#if PLATFORM(DARWIN) +#if OS(DARWIN) // Mach-O platform #define HIDE_SYMBOL(name) ".private_extern _" #name -#elif PLATFORM(AIX) +#elif OS(AIX) // IBM's own file format #define HIDE_SYMBOL(name) ".lglobl " #name -#elif PLATFORM(LINUX) || PLATFORM(FREEBSD) || PLATFORM(OPENBSD) || PLATFORM(SOLARIS) || (PLATFORM(HPUX) && CPU(IA64)) || PLATFORM(SYMBIAN) || PLATFORM(NETBSD) +#elif OS(LINUX) \ + || OS(FREEBSD) \ + || OS(OPENBSD) \ + || OS(SOLARIS) \ + || (OS(HPUX) && CPU(IA64)) \ + || OS(SYMBIAN) \ + || OS(NETBSD) // ELF platform #define HIDE_SYMBOL(name) ".hidden " #name #else diff --git a/JavaScriptCore/jsc.cpp b/JavaScriptCore/jsc.cpp index 6c618897fb5..30c1e384222 100644 --- a/JavaScriptCore/jsc.cpp +++ b/JavaScriptCore/jsc.cpp @@ -37,7 +37,7 @@ #include #include -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) #include #endif @@ -54,7 +54,7 @@ #include #endif -#if COMPILER(MSVC) && !PLATFORM(WINCE) +#if COMPILER(MSVC) && !OS(WINCE) #include #include #include @@ -313,7 +313,7 @@ int jscmain(int argc, char** argv, JSGlobalData*); int main(int argc, char** argv) { -#if defined(_DEBUG) && PLATFORM(WIN_OS) +#if defined(_DEBUG) && OS(WINDOWS) _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); @@ -322,7 +322,7 @@ int main(int argc, char** argv) _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); #endif -#if COMPILER(MSVC) && !PLATFORM(WINCE) +#if COMPILER(MSVC) && !OS(WINCE) timeBeginPeriod(1); #endif diff --git a/JavaScriptCore/parser/Grammar.y b/JavaScriptCore/parser/Grammar.y index 6d953dfed12..717a2668193 100644 --- a/JavaScriptCore/parser/Grammar.y +++ b/JavaScriptCore/parser/Grammar.y @@ -43,7 +43,7 @@ // Default values for bison. #define YYDEBUG 0 // Set to 1 to debug a parse error. #define jscyydebug 0 // Set to 1 to debug a parse error. -#if !PLATFORM(DARWIN) +#if !OS(DARWIN) // Avoid triggering warnings in older bison by not setting this on the Darwin platform. // FIXME: Is this still needed? #define YYERROR_VERBOSE diff --git a/JavaScriptCore/profiler/ProfileNode.cpp b/JavaScriptCore/profiler/ProfileNode.cpp index 02fb7c95503..fb126b3febd 100644 --- a/JavaScriptCore/profiler/ProfileNode.cpp +++ b/JavaScriptCore/profiler/ProfileNode.cpp @@ -33,7 +33,7 @@ #include #include -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include #endif @@ -43,7 +43,7 @@ namespace JSC { static double getCount() { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) static LARGE_INTEGER frequency = {0}; if (!frequency.QuadPart) QueryPerformanceFrequency(&frequency); diff --git a/JavaScriptCore/runtime/Collector.cpp b/JavaScriptCore/runtime/Collector.cpp index 37b2ca4f588..f15cb2ca565 100644 --- a/JavaScriptCore/runtime/Collector.cpp +++ b/JavaScriptCore/runtime/Collector.cpp @@ -45,7 +45,7 @@ #include #include -#if PLATFORM(DARWIN) +#if OS(DARWIN) #include #include @@ -53,29 +53,29 @@ #include #include -#elif PLATFORM(SYMBIAN) +#elif OS(SYMBIAN) #include #include #include -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) #include #include -#elif PLATFORM(HAIKU) +#elif OS(HAIKU) #include -#elif PLATFORM(UNIX) +#elif OS(UNIX) #include -#if !PLATFORM(HAIKU) +#if !OS(HAIKU) #include #endif #include -#if PLATFORM(SOLARIS) +#if OS(SOLARIS) #include #else #include @@ -85,7 +85,7 @@ #include #endif -#if PLATFORM(QNX) +#if OS(QNX) #include #include #include @@ -109,16 +109,16 @@ const size_t ALLOCATIONS_PER_COLLECTION = 3600; // a PIC branch in Mach-O binaries, see . #define MIN_ARRAY_SIZE (static_cast(14)) -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) const size_t MAX_NUM_BLOCKS = 256; // Max size of collector heap set to 16 MB static RHeap* userChunk = 0; #endif #if ENABLE(JSC_MULTIPLE_THREADS) -#if PLATFORM(DARWIN) +#if OS(DARWIN) typedef mach_port_t PlatformThread; -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) typedef HANDLE PlatformThread; #endif @@ -149,7 +149,7 @@ Heap::Heap(JSGlobalData* globalData) { ASSERT(globalData); -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) // Symbian OpenC supports mmap but currently not the MAP_ANON flag. // Using fastMalloc() does not properly align blocks on 64k boundaries // and previous implementation was flawed/incomplete. @@ -167,7 +167,7 @@ Heap::Heap(JSGlobalData* globalData) if (!userChunk) CRASH(); } -#endif // PLATFORM(SYMBIAN) +#endif // OS(SYMBIAN) memset(&m_heap, 0, sizeof(CollectorHeap)); allocateBlock(); @@ -214,18 +214,18 @@ void Heap::destroy() NEVER_INLINE CollectorBlock* Heap::allocateBlock() { -#if PLATFORM(DARWIN) +#if OS(DARWIN) vm_address_t address = 0; vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE | VM_TAG_FOR_COLLECTOR_MEMORY, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT); -#elif PLATFORM(SYMBIAN) +#elif OS(SYMBIAN) // Allocate a 64 kb aligned CollectorBlock unsigned char* mask = reinterpret_cast(userChunk->Alloc(BLOCK_SIZE)); if (!mask) CRASH(); uintptr_t address = reinterpret_cast(mask); -#elif PLATFORM(WINCE) +#elif OS(WINCE) void* address = VirtualAlloc(NULL, BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) #if COMPILER(MINGW) void* address = __mingw_aligned_malloc(BLOCK_SIZE, BLOCK_SIZE); #else @@ -308,13 +308,13 @@ NEVER_INLINE void Heap::freeBlock(size_t block) NEVER_INLINE void Heap::freeBlockPtr(CollectorBlock* block) { -#if PLATFORM(DARWIN) +#if OS(DARWIN) vm_deallocate(current_task(), reinterpret_cast(block), BLOCK_SIZE); -#elif PLATFORM(SYMBIAN) +#elif OS(SYMBIAN) userChunk->Free(reinterpret_cast(block)); -#elif PLATFORM(WINCE) +#elif OS(WINCE) VirtualFree(block, 0, MEM_RELEASE); -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) #if COMPILER(MINGW) __mingw_aligned_free(block); #else @@ -450,7 +450,7 @@ void Heap::shrinkBlocks(size_t neededBlocks) m_heap.blocks[i]->marked.set(HeapConstants::cellsPerBlock - 1); } -#if PLATFORM(WINCE) +#if OS(WINCE) void* g_stackBase = 0; inline bool isPageWritable(void* page) @@ -507,7 +507,7 @@ static void* getStackBase(void* previousFrame) } #endif -#if PLATFORM(QNX) +#if OS(QNX) static inline void *currentThreadStackBaseQNX() { static void* stackBase = 0; @@ -536,10 +536,10 @@ static inline void *currentThreadStackBaseQNX() static inline void* currentThreadStackBase() { -#if PLATFORM(DARWIN) +#if OS(DARWIN) pthread_t thread = pthread_self(); return pthread_get_stackaddr_np(thread); -#elif PLATFORM(WIN_OS) && CPU(X86) && COMPILER(MSVC) +#elif OS(WINDOWS) && CPU(X86) && COMPILER(MSVC) // offset 0x18 from the FS segment register gives a pointer to // the thread information block for the current thread NT_TIB* pTib; @@ -548,10 +548,11 @@ static inline void* currentThreadStackBase() MOV pTib, EAX } return static_cast(pTib->StackBase); -#elif PLATFORM(WIN_OS) && CPU(X86_64) && COMPILER(MSVC) +#elif OS(WINDOWS) && CPU(X86_64) && COMPILER(MSVC) + // FIXME: why only for MSVC? PNT_TIB64 pTib = reinterpret_cast(NtCurrentTeb()); return reinterpret_cast(pTib->StackBase); -#elif PLATFORM(WIN_OS) && CPU(X86) && COMPILER(GCC) +#elif OS(WINDOWS) && CPU(X86) && COMPILER(GCC) // offset 0x18 from the FS segment register gives a pointer to // the thread information block for the current thread NT_TIB* pTib; @@ -559,18 +560,18 @@ static inline void* currentThreadStackBase() : "=r" (pTib) ); return static_cast(pTib->StackBase); -#elif PLATFORM(QNX) +#elif OS(QNX) return currentThreadStackBaseQNX(); -#elif PLATFORM(SOLARIS) +#elif OS(SOLARIS) stack_t s; thr_stksegment(&s); return s.ss_sp; -#elif PLATFORM(OPENBSD) +#elif OS(OPENBSD) pthread_t thread = pthread_self(); stack_t stack; pthread_stackseg_np(thread, &stack); return stack.ss_sp; -#elif PLATFORM(SYMBIAN) +#elif OS(SYMBIAN) static void* stackBase = 0; if (stackBase == 0) { TThreadStackInfo info; @@ -579,11 +580,11 @@ static inline void* currentThreadStackBase() stackBase = (void*)info.iBase; } return (void*)stackBase; -#elif PLATFORM(HAIKU) +#elif OS(HAIKU) thread_info threadInfo; get_thread_info(find_thread(NULL), &threadInfo); return threadInfo.stack_end; -#elif PLATFORM(UNIX) +#elif OS(UNIX) static void* stackBase = 0; static size_t stackSize = 0; static pthread_t stackThread; @@ -591,7 +592,7 @@ static inline void* currentThreadStackBase() if (stackBase == 0 || thread != stackThread) { pthread_attr_t sattr; pthread_attr_init(&sattr); -#if HAVE(PTHREAD_NP_H) || PLATFORM(NETBSD) +#if HAVE(PTHREAD_NP_H) || OS(NETBSD) // e.g. on FreeBSD 5.4, neundorf@kde.org pthread_attr_get_np(thread, &sattr); #else @@ -605,7 +606,7 @@ static inline void* currentThreadStackBase() stackThread = thread; } return static_cast(stackBase) + stackSize; -#elif PLATFORM(WINCE) +#elif OS(WINCE) if (g_stackBase) return g_stackBase; else { @@ -621,9 +622,9 @@ static inline void* currentThreadStackBase() static inline PlatformThread getCurrentPlatformThread() { -#if PLATFORM(DARWIN) +#if OS(DARWIN) return pthread_mach_thread_np(pthread_self()); -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) return pthread_getw32threadhandle_np(pthread_self()); #endif } @@ -799,9 +800,9 @@ void Heap::markCurrentThreadConservatively(MarkStack& markStack) static inline void suspendThread(const PlatformThread& platformThread) { -#if PLATFORM(DARWIN) +#if OS(DARWIN) thread_suspend(platformThread); -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) SuspendThread(platformThread); #else #error Need a way to suspend threads on this platform @@ -810,9 +811,9 @@ static inline void suspendThread(const PlatformThread& platformThread) static inline void resumeThread(const PlatformThread& platformThread) { -#if PLATFORM(DARWIN) +#if OS(DARWIN) thread_resume(platformThread); -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) ResumeThread(platformThread); #else #error Need a way to resume threads on this platform @@ -821,7 +822,7 @@ static inline void resumeThread(const PlatformThread& platformThread) typedef unsigned long usword_t; // word size, assumed to be either 32 or 64 bit -#if PLATFORM(DARWIN) +#if OS(DARWIN) #if CPU(X86) typedef i386_thread_state_t PlatformThreadRegisters; @@ -837,7 +838,7 @@ typedef arm_thread_state_t PlatformThreadRegisters; #error Unknown Architecture #endif -#elif PLATFORM(WIN_OS)&& CPU(X86) +#elif OS(WINDOWS) && CPU(X86) typedef CONTEXT PlatformThreadRegisters; #else #error Need a thread register struct for this platform @@ -845,7 +846,7 @@ typedef CONTEXT PlatformThreadRegisters; static size_t getPlatformThreadRegisters(const PlatformThread& platformThread, PlatformThreadRegisters& regs) { -#if PLATFORM(DARWIN) +#if OS(DARWIN) #if CPU(X86) unsigned user_count = sizeof(regs)/sizeof(int); @@ -873,9 +874,9 @@ static size_t getPlatformThreadRegisters(const PlatformThread& platformThread, P CRASH(); } return user_count * sizeof(usword_t); -// end PLATFORM(DARWIN) +// end OS(DARWIN) -#elif PLATFORM(WIN_OS) && CPU(X86) +#elif OS(WINDOWS) && CPU(X86) regs.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL | CONTEXT_SEGMENTS; GetThreadContext(platformThread, ®s); return sizeof(CONTEXT); @@ -886,7 +887,7 @@ static size_t getPlatformThreadRegisters(const PlatformThread& platformThread, P static inline void* otherThreadStackPointer(const PlatformThreadRegisters& regs) { -#if PLATFORM(DARWIN) +#if OS(DARWIN) #if __DARWIN_UNIX03 @@ -916,8 +917,8 @@ static inline void* otherThreadStackPointer(const PlatformThreadRegisters& regs) #endif // __DARWIN_UNIX03 -// end PLATFORM(DARWIN) -#elif CPU(X86) && PLATFORM(WIN_OS) +// end OS(DARWIN) +#elif CPU(X86) && OS(WINDOWS) return reinterpret_cast((uintptr_t) regs.Esp); #else #error Need a way to get the stack pointer for another thread on this platform diff --git a/JavaScriptCore/runtime/Collector.h b/JavaScriptCore/runtime/Collector.h index 8096f3dbee3..7f7a67916e1 100644 --- a/JavaScriptCore/runtime/Collector.h +++ b/JavaScriptCore/runtime/Collector.h @@ -181,7 +181,7 @@ namespace JSC { #endif template<> struct CellSize { static const size_t m_value = 64; }; -#if PLATFORM(WINCE) || PLATFORM(SYMBIAN) +#if OS(WINCE) || OS(SYMBIAN) const size_t BLOCK_SIZE = 64 * 1024; // 64k #else const size_t BLOCK_SIZE = 64 * 4096; // 256k diff --git a/JavaScriptCore/runtime/DateConstructor.cpp b/JavaScriptCore/runtime/DateConstructor.cpp index e25765b7862..2e476b3b756 100644 --- a/JavaScriptCore/runtime/DateConstructor.cpp +++ b/JavaScriptCore/runtime/DateConstructor.cpp @@ -35,7 +35,7 @@ #include #include -#if PLATFORM(WINCE) && !PLATFORM(QT) +#if OS(WINCE) && !PLATFORM(QT) extern "C" time_t time(time_t* timer); // Provided by libce. #endif diff --git a/JavaScriptCore/runtime/DatePrototype.cpp b/JavaScriptCore/runtime/DatePrototype.cpp index 2b5e0d00321..ca9d4ea4358 100644 --- a/JavaScriptCore/runtime/DatePrototype.cpp +++ b/JavaScriptCore/runtime/DatePrototype.cpp @@ -59,7 +59,7 @@ #include #endif -#if PLATFORM(WINCE) && !PLATFORM(QT) +#if OS(WINCE) && !PLATFORM(QT) extern "C" size_t strftime(char * const s, const size_t maxsize, const char * const format, const struct tm * const t); //provided by libce #endif @@ -197,7 +197,7 @@ static JSCell* formatLocaleDate(ExecState* exec, const GregorianDateTime& gdt, L { #if HAVE(LANGINFO_H) static const nl_item formats[] = { D_T_FMT, D_FMT, T_FMT }; -#elif (PLATFORM(WINCE) && !PLATFORM(QT)) || PLATFORM(SYMBIAN) +#elif (OS(WINCE) && !PLATFORM(QT)) || OS(SYMBIAN) // strftime() does not support '#' on WinCE or Symbian static const char* const formatStrings[] = { "%c", "%x", "%X" }; #else diff --git a/JavaScriptCore/runtime/InitializeThreading.cpp b/JavaScriptCore/runtime/InitializeThreading.cpp index aad1af8121c..5b1468f70cc 100644 --- a/JavaScriptCore/runtime/InitializeThreading.cpp +++ b/JavaScriptCore/runtime/InitializeThreading.cpp @@ -41,7 +41,7 @@ using namespace WTF; namespace JSC { -#if PLATFORM(DARWIN) && ENABLE(JSC_MULTIPLE_THREADS) +#if OS(DARWIN) && ENABLE(JSC_MULTIPLE_THREADS) static pthread_once_t initializeThreadingKeyOnce = PTHREAD_ONCE_INIT; #endif @@ -57,7 +57,7 @@ static void initializeThreadingOnce() void initializeThreading() { -#if PLATFORM(DARWIN) && ENABLE(JSC_MULTIPLE_THREADS) +#if OS(DARWIN) && ENABLE(JSC_MULTIPLE_THREADS) pthread_once(&initializeThreadingKeyOnce, initializeThreadingOnce); #else static bool initializedThreading = false; diff --git a/JavaScriptCore/runtime/MarkStack.h b/JavaScriptCore/runtime/MarkStack.h index a114ae08c4c..b0707fe35f3 100644 --- a/JavaScriptCore/runtime/MarkStack.h +++ b/JavaScriptCore/runtime/MarkStack.h @@ -153,7 +153,7 @@ namespace JSC { ASSERT(0 == (size % MarkStack::pageSize())); if (size == m_allocated) return; -#if PLATFORM(WIN_OS) || PLATFORM(SYMBIAN) +#if OS(WINDOWS) || OS(SYMBIAN) // We cannot release a part of a region with VirtualFree. To get around this, // we'll release the entire region and reallocate the size that we want. releaseStack(m_data, m_allocated); diff --git a/JavaScriptCore/runtime/MarkStackPosix.cpp b/JavaScriptCore/runtime/MarkStackPosix.cpp index 376c8da9af2..c28bc0de99c 100644 --- a/JavaScriptCore/runtime/MarkStackPosix.cpp +++ b/JavaScriptCore/runtime/MarkStackPosix.cpp @@ -26,7 +26,7 @@ #include "config.h" #include "MarkStack.h" -#if PLATFORM(UNIX) && !PLATFORM(SYMBIAN) +#if OS(UNIX) && !OS(SYMBIAN) #include #include diff --git a/JavaScriptCore/runtime/MarkStackSymbian.cpp b/JavaScriptCore/runtime/MarkStackSymbian.cpp index 421e9b555e8..bda14ac3abe 100644 --- a/JavaScriptCore/runtime/MarkStackSymbian.cpp +++ b/JavaScriptCore/runtime/MarkStackSymbian.cpp @@ -20,7 +20,7 @@ #include "config.h" #include "MarkStack.h" -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) #include diff --git a/JavaScriptCore/runtime/MarkStackWin.cpp b/JavaScriptCore/runtime/MarkStackWin.cpp index 63a51aecc0a..a171c788c58 100644 --- a/JavaScriptCore/runtime/MarkStackWin.cpp +++ b/JavaScriptCore/runtime/MarkStackWin.cpp @@ -26,7 +26,7 @@ #include "config.h" #include "MarkStack.h" -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include "windows.h" diff --git a/JavaScriptCore/runtime/StringPrototype.cpp b/JavaScriptCore/runtime/StringPrototype.cpp index 205f4697634..6498564dadf 100644 --- a/JavaScriptCore/runtime/StringPrototype.cpp +++ b/JavaScriptCore/runtime/StringPrototype.cpp @@ -479,7 +479,7 @@ JSValue JSC_HOST_CALL stringProtoFuncLastIndexOf(ExecState* exec, JSObject*, JSV dpos = 0; else if (!(dpos <= len)) // true for NaN dpos = len; -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) // Work around for broken NaN compare operator else if (isnan(dpos)) dpos = len; diff --git a/JavaScriptCore/runtime/TimeoutChecker.cpp b/JavaScriptCore/runtime/TimeoutChecker.cpp index 2a056c9d5cd..6883888d89b 100644 --- a/JavaScriptCore/runtime/TimeoutChecker.cpp +++ b/JavaScriptCore/runtime/TimeoutChecker.cpp @@ -33,9 +33,9 @@ #include "CallFrame.h" #include "JSGlobalObject.h" -#if PLATFORM(DARWIN) +#if OS(DARWIN) #include -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) #include #else #include "CurrentTime.h" @@ -54,7 +54,7 @@ static const int intervalBetweenChecks = 1000; // Returns the time the current thread has spent executing, in milliseconds. static inline unsigned getCPUTime() { -#if PLATFORM(DARWIN) +#if OS(DARWIN) mach_msg_type_number_t infoCount = THREAD_BASIC_INFO_COUNT; thread_basic_info_data_t info; @@ -67,7 +67,7 @@ static inline unsigned getCPUTime() time += info.system_time.seconds * 1000 + info.system_time.microseconds / 1000; return time; -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) union { FILETIME fileTime; unsigned long long fileTimeAsLong; diff --git a/JavaScriptCore/runtime/UString.cpp b/JavaScriptCore/runtime/UString.cpp index e04b798e2c0..cb3803ffa2e 100644 --- a/JavaScriptCore/runtime/UString.cpp +++ b/JavaScriptCore/runtime/UString.cpp @@ -289,7 +289,7 @@ UString UString::from(long long i) *--p = '0'; else if (i == std::numeric_limits::min()) { char minBuf[1 + sizeof(i) * 3]; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) snprintf(minBuf, sizeof(minBuf) - 1, "%I64d", std::numeric_limits::min()); #else snprintf(minBuf, sizeof(minBuf) - 1, "%lld", std::numeric_limits::min()); diff --git a/JavaScriptCore/wtf/Assertions.cpp b/JavaScriptCore/wtf/Assertions.cpp index 6c5e2e3069b..cadbc915dc3 100644 --- a/JavaScriptCore/wtf/Assertions.cpp +++ b/JavaScriptCore/wtf/Assertions.cpp @@ -35,7 +35,7 @@ #include #endif -#if COMPILER(MSVC) && !PLATFORM(WINCE) +#if COMPILER(MSVC) && !OS(WINCE) #ifndef WINVER #define WINVER 0x0500 #endif @@ -46,7 +46,7 @@ #include #endif -#if PLATFORM(WINCE) +#if OS(WINCE) #include #endif @@ -82,7 +82,7 @@ static void vprintf_stderr_common(const char* format, va_list args) break; if (_vsnprintf(buffer, size, format, args) != -1) { -#if PLATFORM(WINCE) +#if OS(WINCE) // WinCE only supports wide chars wchar_t* wideBuffer = (wchar_t*)malloc(size * sizeof(wchar_t)); if (wideBuffer == NULL) @@ -105,7 +105,7 @@ static void vprintf_stderr_common(const char* format, va_list args) } while (size > 1024); } #endif -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) vfprintf(stdout, format, args); #else vfprintf(stderr, format, args); @@ -123,7 +123,7 @@ static void printf_stderr_common(const char* format, ...) static void printCallSite(const char* file, int line, const char* function) { -#if PLATFORM(WIN) && !PLATFORM(WINCE) && defined _DEBUG +#if OS(WIN) && !OS(WINCE) && defined _DEBUG _CrtDbgReport(_CRT_WARN, file, line, NULL, "%s\n", function); #else printf_stderr_common("(%s:%d %s)\n", file, line, function); diff --git a/JavaScriptCore/wtf/Assertions.h b/JavaScriptCore/wtf/Assertions.h index e8005786b98..9e2da7c006b 100644 --- a/JavaScriptCore/wtf/Assertions.h +++ b/JavaScriptCore/wtf/Assertions.h @@ -50,7 +50,7 @@ #include #endif -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) #include #include #endif @@ -125,7 +125,7 @@ void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChann /* CRASH -- gets us into the debugger or the crash reporter -- signals are ignored by the crash reporter so we must do better */ #ifndef CRASH -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) #define CRASH() do { \ __DEBUGGER(); \ User::Panic(_L("Webkit CRASH"),0); \ @@ -140,7 +140,7 @@ void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChann /* ASSERT, ASSERT_WITH_MESSAGE, ASSERT_NOT_REACHED */ -#if PLATFORM(WINCE) && !PLATFORM(TORCHMOBILE) +#if OS(WINCE) && !PLATFORM(TORCHMOBILE) /* FIXME: We include this here only to avoid a conflict with the ASSERT macro. */ #include #undef min @@ -148,7 +148,7 @@ void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChann #undef ERROR #endif -#if PLATFORM(WIN_OS) || PLATFORM(SYMBIAN) +#if OS(WINDOWS) || OS(SYMBIAN) /* FIXME: Change to use something other than ASSERT to avoid this conflict with the underlying platform */ #undef ASSERT #endif diff --git a/JavaScriptCore/wtf/CurrentTime.cpp b/JavaScriptCore/wtf/CurrentTime.cpp index b36cae5abb0..b2728747bbb 100644 --- a/JavaScriptCore/wtf/CurrentTime.cpp +++ b/JavaScriptCore/wtf/CurrentTime.cpp @@ -33,7 +33,7 @@ #include "config.h" #include "CurrentTime.h" -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) // Windows is first since we want to use hires timers, despite PLATFORM(CF) // being defined. @@ -45,7 +45,7 @@ #include #if USE(QUERY_PERFORMANCE_COUNTER) -#if PLATFORM(WINCE) +#if OS(WINCE) extern "C" time_t mktime(struct tm *t); #else #include @@ -71,7 +71,7 @@ namespace WTF { const double msPerSecond = 1000.0; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #if USE(QUERY_PERFORMANCE_COUNTER) @@ -123,7 +123,7 @@ static double highResUpTime() static double lowResUTCTime() { -#if PLATFORM(WINCE) +#if OS(WINCE) SYSTEMTIME systemTime; GetSystemTime(&systemTime); struct tm tmtime; diff --git a/JavaScriptCore/wtf/CurrentTime.h b/JavaScriptCore/wtf/CurrentTime.h index 472770ead0a..334a6e98a5c 100644 --- a/JavaScriptCore/wtf/CurrentTime.h +++ b/JavaScriptCore/wtf/CurrentTime.h @@ -49,7 +49,7 @@ namespace WTF { inline void getLocalTime(const time_t* localTime, struct tm* localTM) { - #if COMPILER(MSVC7) || COMPILER(MINGW) || PLATFORM(WINCE) + #if COMPILER(MSVC7) || COMPILER(MINGW) || OS(WINCE) *localTM = *localtime(localTime); #elif COMPILER(MSVC) localtime_s(localTM, localTime); diff --git a/JavaScriptCore/wtf/DateMath.cpp b/JavaScriptCore/wtf/DateMath.cpp index 1f9c0e49c23..202a5571c08 100644 --- a/JavaScriptCore/wtf/DateMath.cpp +++ b/JavaScriptCore/wtf/DateMath.cpp @@ -88,7 +88,7 @@ #include #endif -#if PLATFORM(WINCE) +#if OS(WINCE) extern "C" size_t strftime(char * const s, const size_t maxsize, const char * const format, const struct tm * const t); extern "C" struct tm * localtime(const time_t *timer); #endif @@ -488,7 +488,7 @@ static inline double ymdhmsToSeconds(long year, int mon, int day, int hour, int // We follow the recommendation of RFC 2822 to consider all // obsolete time zones not listed here equivalent to "-0000". static const struct KnownZone { -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) const #endif char tzName[4]; diff --git a/JavaScriptCore/wtf/FastMalloc.cpp b/JavaScriptCore/wtf/FastMalloc.cpp index 21060a53298..a5633ea9673 100644 --- a/JavaScriptCore/wtf/FastMalloc.cpp +++ b/JavaScriptCore/wtf/FastMalloc.cpp @@ -192,7 +192,7 @@ TryMallocReturnValue tryFastZeroedMalloc(size_t n) #if FORCE_SYSTEM_MALLOC #include -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) #include #else #include "windows.h" @@ -349,7 +349,7 @@ FastMallocStatistics fastMallocStatistics() } // namespace WTF -#if PLATFORM(DARWIN) +#if OS(DARWIN) // This symbol is present in the JavaScriptCore exports file even when FastMalloc is disabled. // It will never be used in this case, so it's type and value are less interesting than its presence. extern "C" const int jscore_fastmalloc_introspection = 0; @@ -379,7 +379,7 @@ extern "C" const int jscore_fastmalloc_introspection = 0; #include #include #include -#if PLATFORM(UNIX) +#if OS(UNIX) #include #endif #if COMPILER(MSVC) @@ -391,7 +391,7 @@ extern "C" const int jscore_fastmalloc_introspection = 0; #if WTF_CHANGES -#if PLATFORM(DARWIN) +#if OS(DARWIN) #include "MallocZoneSupport.h" #include #include @@ -405,7 +405,7 @@ extern "C" const int jscore_fastmalloc_introspection = 0; // call to the function on Mac OS X, and it's used in performance-critical code. So we // use a function pointer. But that's not necessarily faster on other platforms, and we had // problems with this technique on Windows, so we'll do this only on Mac OS X. -#if PLATFORM(DARWIN) +#if OS(DARWIN) static void* (*pthread_getspecific_function_pointer)(pthread_key_t) = pthread_getspecific; #define pthread_getspecific(key) pthread_getspecific_function_pointer(key) #endif @@ -433,7 +433,7 @@ namespace WTF { #define MESSAGE LOG_ERROR #define CHECK_CONDITION ASSERT -#if PLATFORM(DARWIN) +#if OS(DARWIN) class Span; class TCMalloc_Central_FreeListPadded; class TCMalloc_PageHeap; @@ -990,7 +990,7 @@ class PageHeapAllocator { int inuse() const { return inuse_; } -#if defined(WTF_CHANGES) && PLATFORM(DARWIN) +#if defined(WTF_CHANGES) && OS(DARWIN) template void recordAdministrativeRegions(Recorder& recorder, const RemoteMemoryReader& reader) { @@ -1223,7 +1223,7 @@ static const int kScavengeTimerDelayInSeconds = 5; static const size_t kMinimumFreeCommittedPageCount = 512; // During a scavenge, we'll release up to a fraction of the free committed pages. -#if PLATFORM(WIN) +#if OS(WINDOWS) // We are slightly less aggressive in releasing memory on Windows due to performance reasons. static const int kMaxScavengeAmountFactor = 3; #else @@ -1372,7 +1372,7 @@ class TCMalloc_PageHeap { // Index of last free list we scavenged size_t scavenge_index_; -#if defined(WTF_CHANGES) && PLATFORM(DARWIN) +#if defined(WTF_CHANGES) && OS(DARWIN) friend class FastMallocZone; #endif @@ -2278,7 +2278,7 @@ static inline TCMalloc_PageHeap* getPageHeap() #define pageheap getPageHeap() #if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) static void sleep(unsigned seconds) { ::Sleep(seconds * 1000); @@ -2816,7 +2816,7 @@ void TCMalloc_ThreadCache::InitModule() { } pageheap->init(); phinited = 1; -#if defined(WTF_CHANGES) && PLATFORM(DARWIN) +#if defined(WTF_CHANGES) && OS(DARWIN) FastMallocZone::init(); #endif } @@ -4014,7 +4014,7 @@ void *(*__memalign_hook)(size_t, size_t, const void *) = MemalignOverride; #endif -#if defined(WTF_CHANGES) && PLATFORM(DARWIN) +#if defined(WTF_CHANGES) && OS(DARWIN) class FreeObjectFinder { const RemoteMemoryReader& m_reader; @@ -4297,7 +4297,7 @@ extern "C" { malloc_introspection_t jscore_fastmalloc_introspection = { &FastMallocZone::enumerate, &FastMallocZone::goodSize, &FastMallocZone::check, &FastMallocZone::print, &FastMallocZone::log, &FastMallocZone::forceLock, &FastMallocZone::forceUnlock, &FastMallocZone::statistics -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !PLATFORM(IPHONE) +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !OS(IPHONE_OS) , 0 // zone_locked will not be called on the zone unless it advertises itself as version five or higher. #endif diff --git a/JavaScriptCore/wtf/FastMalloc.h b/JavaScriptCore/wtf/FastMalloc.h index 9a35c75280d..d3792912773 100644 --- a/JavaScriptCore/wtf/FastMalloc.h +++ b/JavaScriptCore/wtf/FastMalloc.h @@ -194,7 +194,7 @@ using WTF::fastMallocForbid; using WTF::fastMallocAllow; #endif -#if COMPILER(GCC) && PLATFORM(DARWIN) +#if COMPILER(GCC) && OS(DARWIN) #define WTF_PRIVATE_INLINE __private_extern__ inline __attribute__((always_inline)) #elif COMPILER(GCC) #define WTF_PRIVATE_INLINE inline __attribute__((always_inline)) diff --git a/JavaScriptCore/wtf/MathExtras.h b/JavaScriptCore/wtf/MathExtras.h index ee2110eca4f..9ea57fd771b 100644 --- a/JavaScriptCore/wtf/MathExtras.h +++ b/JavaScriptCore/wtf/MathExtras.h @@ -30,17 +30,17 @@ #include #include -#if PLATFORM(SOLARIS) +#if OS(SOLARIS) #include #endif -#if PLATFORM(OPENBSD) +#if OS(OPENBSD) #include #include #endif #if COMPILER(MSVC) -#if PLATFORM(WINCE) +#if OS(WINCE) #include #endif #include @@ -62,7 +62,7 @@ const double piOverFourDouble = M_PI_4; const float piOverFourFloat = static_cast(M_PI_4); #endif -#if PLATFORM(DARWIN) +#if OS(DARWIN) // Work around a bug in the Mac OS X libc where ceil(-0.1) return +0. inline double wtf_ceil(double x) { return copysign(ceil(x), x); } @@ -71,7 +71,7 @@ inline double wtf_ceil(double x) { return copysign(ceil(x), x); } #endif -#if PLATFORM(SOLARIS) +#if OS(SOLARIS) #ifndef isfinite inline bool isfinite(double x) { return finite(x) && !isnand(x); } @@ -85,7 +85,7 @@ inline bool signbit(double x) { return x < 0.0; } // FIXME: Wrong for negative 0 #endif -#if PLATFORM(OPENBSD) +#if OS(OPENBSD) #ifndef isfinite inline bool isfinite(double x) { return finite(x); } diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h index cff18dc92a7..b9d97d88b55 100644 --- a/JavaScriptCore/wtf/Platform.h +++ b/JavaScriptCore/wtf/Platform.h @@ -94,7 +94,6 @@ /* This also defines CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as appropriate. */ - /* CPU(ALPHA) - DEC Alpha */ #if defined(__alpha__) #define WTF_CPU_ALPHA 1 @@ -278,13 +277,24 @@ -/* Operating systems - low-level dependencies */ +/* ==== OS() - underlying operating system; only to be used for mandated low-level services like + virtual memory, not to choose a GUI toolkit ==== */ + +/* OS(ANDROID) - Android */ +#ifdef ANDROID +#define WTF_OS_ANDROID 1 +#endif + +/* OS(AIX) - AIX */ +#ifdef _AIX +#define WTF_OS_AIX 1 +#endif -/* PLATFORM(DARWIN) */ -/* Operating system level dependencies for Mac OS X / Darwin that should */ -/* be used regardless of operating environment */ +/* OS(DARWIN) - Any Darwin-based OS, including Mac OS X and iPhone OS */ #ifdef __APPLE__ -#define WTF_PLATFORM_DARWIN 1 +#define WTF_OS_DARWIN 1 + +// FIXME: BUILDING_ON_.., and TARGETING... macros should be folded into the OS() system #include #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 #define BUILDING_ON_TIGER 1 @@ -301,92 +311,93 @@ #define TARGETING_SNOW_LEOPARD 1 #endif #include + #endif -/* PLATFORM(WIN_OS) */ -/* Operating system level dependencies for Windows that should be used */ -/* regardless of operating environment */ -#if defined(WIN32) || defined(_WIN32) -#define WTF_PLATFORM_WIN_OS 1 +/* OS(IPHONE_OS) - iPhone OS */ +/* OS(MAC_OS_X) - Mac OS X (not including iPhone OS) */ +#if OS(DARWIN) && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) \ + || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) \ + || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR)) +#define WTF_OS_IPHONE_OS 1 +#elif OS(DARWIN) && defined(TARGET_OS_MAC) && TARGET_OS_MAC +#define WTF_OS_MAC_OS_X 1 #endif -/* PLATFORM(WINCE) */ -/* Operating system level dependencies for Windows CE that should be used */ -/* regardless of operating environment */ -/* Note that for this platform PLATFORM(WIN_OS) is also defined. */ -#if defined(_WIN32_WCE) -#define WTF_PLATFORM_WINCE 1 +/* OS(FREEBSD) - FreeBSD */ +#ifdef __FreeBSD__ +#define WTF_OS_FREEBSD 1 +#endif + +/* OS(HAIKU) - Haiku */ +#ifdef __HAIKU__ +#define WTF_OS_HAIKU 1 #endif -/* PLATFORM(LINUX) */ -/* Operating system level dependencies for Linux-like systems that */ -/* should be used regardless of operating environment */ +/* OS(LINUX) - Linux */ #ifdef __linux__ -#define WTF_PLATFORM_LINUX 1 +#define WTF_OS_LINUX 1 #endif -/* PLATFORM(FREEBSD) */ -/* Operating system level dependencies for FreeBSD-like systems that */ -/* should be used regardless of operating environment */ -#ifdef __FreeBSD__ -#define WTF_PLATFORM_FREEBSD 1 +/* OS(NETBSD) - NetBSD */ +#if defined(__NetBSD__) +#define WTF_PLATFORM_NETBSD 1 #endif -/* PLATFORM(OPENBSD) */ -/* Operating system level dependencies for OpenBSD systems that */ -/* should be used regardless of operating environment */ +/* OS(OPENBSD) - OpenBSD */ #ifdef __OpenBSD__ -#define WTF_PLATFORM_OPENBSD 1 +#define WTF_OS_OPENBSD 1 #endif -/* PLATFORM(SOLARIS) */ -/* Operating system level dependencies for Solaris that should be used */ -/* regardless of operating environment */ -#if defined(sun) || defined(__sun) -#define WTF_PLATFORM_SOLARIS 1 +/* OS(QNX) - QNX */ +#if defined(__QNXNTO__) +#define WTF_OS_QNX 1 #endif -#if defined (__SYMBIAN32__) -/* we are cross-compiling, it is not really windows */ -#undef WTF_PLATFORM_WIN_OS -#undef WTF_PLATFORM_WIN -#define WTF_PLATFORM_SYMBIAN 1 +/* OS(SOLARIS) - Solaris */ +#if defined(sun) || defined(__sun) +#define WTF_OS_SOLARIS 1 #endif - -/* PLATFORM(NETBSD) */ -/* Operating system level dependencies for NetBSD that should be used */ -/* regardless of operating environment */ -#if defined(__NetBSD__) -#define WTF_PLATFORM_NETBSD 1 +/* OS(WINCE) - Windows CE; note that for this platform OS(WINDOWS) is also defined */ +#if defined(_WIN32_WCE) +#define WTF_OS_WINCE 1 #endif -/* PLATFORM(QNX) */ -/* Operating system level dependencies for QNX that should be used */ -/* regardless of operating environment */ -#if defined(__QNXNTO__) -#define WTF_PLATFORM_QNX 1 +/* OS(WINDOWS) - Any version of Windows */ +#if defined(WIN32) || defined(_WIN32) +#define WTF_OS_WINDOWS 1 #endif -/* PLATFORM(UNIX) */ -/* Operating system level dependencies for Unix-like systems that */ -/* should be used regardless of operating environment */ -#if PLATFORM(DARWIN) \ - || PLATFORM(FREEBSD) \ - || PLATFORM(SYMBIAN) \ - || PLATFORM(NETBSD) \ +/* OS(SYMBIAN) - Symbian */ +#if defined (__SYMBIAN32__) +/* we are cross-compiling, it is not really windows */ +#undef WTF_OS_WINDOWS +#undef WTF_PLATFORM_WIN +#define WTF_OS_SYMBIAN 1 +#endif + +/* OS(UNIX) - Any Unix-like system */ +#if OS(AIX) \ + || OS(ANDROID) \ + || OS(DARWIN) \ + || OS(FREEBSD) \ + || OS(HAIKU) \ + || OS(LINUX) \ + || OS(NETBSD) \ + || OS(OPENBSD) \ + || OS(QNX) \ + || OS(SOLARIS) \ + || OS(SYMBIAN) \ || defined(unix) \ || defined(__unix) \ - || defined(__unix__) \ - || defined(_AIX) \ - || defined(__HAIKU__) \ - || defined(__QNXNTO__) \ - || defined(ANDROID) -#define WTF_PLATFORM_UNIX 1 + || defined(__unix__) +#define WTF_OS_UNIX 1 #endif /* Operating environments */ +// FIXME: these are all mixes of OS, operating environment and policy choices. */ /* PLATFORM(CHROMIUM) */ /* PLATFORM(QT) */ /* PLATFORM(WX) */ @@ -404,13 +415,14 @@ #define WTF_PLATFORM_GTK 1 #elif defined(BUILDING_HAIKU__) #define WTF_PLATFORM_HAIKU 1 -#elif PLATFORM(DARWIN) +#elif OS(DARWIN) #define WTF_PLATFORM_MAC 1 -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) #define WTF_PLATFORM_WIN 1 #endif /* PLATFORM(IPHONE) */ +// FIXME: this is sometimes used as an OS switch and sometimes for higher-level things #if (defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) #define WTF_PLATFORM_IPHONE 1 #endif @@ -428,6 +440,8 @@ #endif /* PLATFORM(ANDROID) */ +// FIXME: this is sometimes used as an OS() switch, and other times to drive +// policy choices #if defined(ANDROID) #define WTF_PLATFORM_ANDROID 1 #endif @@ -444,7 +458,7 @@ /* PLATFORM(SKIA) for Win/Linux, CG/CI for Mac */ #if PLATFORM(CHROMIUM) -#if PLATFORM(DARWIN) +#if OS(DARWIN) #define WTF_PLATFORM_CG 1 #define WTF_PLATFORM_CI 1 #define WTF_USE_ATSUI 1 @@ -459,12 +473,12 @@ #endif -/* PLATFORM(WINCE) && PLATFORM(QT) +/* OS(WINCE) && PLATFORM(QT) We can not determine the endianess at compile time. For Qt for Windows CE the endianess is specified in the device specific makespec */ -#if PLATFORM(WINCE) && PLATFORM(QT) +#if OS(WINCE) && PLATFORM(QT) # include # undef WTF_PLATFORM_BIG_ENDIAN # undef WTF_PLATFORM_MIDDLE_ENDIAN @@ -475,16 +489,16 @@ # include #endif -#if (PLATFORM(IPHONE) || PLATFORM(MAC) || PLATFORM(WIN) || (PLATFORM(QT) && PLATFORM(DARWIN) && !ENABLE(SINGLE_THREADED))) && !defined(ENABLE_JSC_MULTIPLE_THREADS) +#if (PLATFORM(IPHONE) || PLATFORM(MAC) || PLATFORM(WIN) || (PLATFORM(QT) && OS(DARWIN) && !ENABLE(SINGLE_THREADED))) && !defined(ENABLE_JSC_MULTIPLE_THREADS) #define ENABLE_JSC_MULTIPLE_THREADS 1 #endif /* On Windows, use QueryPerformanceCounter by default */ -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #define WTF_USE_QUERY_PERFORMANCE_COUNTER 1 #endif -#if PLATFORM(WINCE) && !PLATFORM(QT) +#if OS(WINCE) && !PLATFORM(QT) #undef ENABLE_JSC_MULTIPLE_THREADS #define ENABLE_JSC_MULTIPLE_THREADS 0 #define USE_SYSTEM_MALLOC 0 @@ -509,11 +523,11 @@ #define _countof(x) (sizeof(x) / sizeof((x)[0])) #endif -#endif /* PLATFORM(WINCE) && !PLATFORM(QT) */ +#endif /* OS(WINCE) && !PLATFORM(QT) */ #if PLATFORM(QT) #define WTF_USE_QT4_UNICODE 1 -#elif PLATFORM(WINCE) +#elif OS(WINCE) #define WTF_USE_WINCE_UNICODE 1 #elif PLATFORM(GTK) /* The GTK+ Unicode backend is configurable */ @@ -538,13 +552,13 @@ #define HAVE_RUNLOOP_TIMER 1 #endif /* PLATFORM(MAC) && !PLATFORM(IPHONE) */ -#if PLATFORM(CHROMIUM) && PLATFORM(DARWIN) +#if PLATFORM(CHROMIUM) && OS(DARWIN) #define WTF_PLATFORM_CF 1 #define WTF_USE_PTHREADS 1 #define HAVE_PTHREAD_RWLOCK 1 #endif -#if PLATFORM(QT) && PLATFORM(DARWIN) +#if PLATFORM(QT) && OS(DARWIN) #define WTF_PLATFORM_CF 1 #endif @@ -583,7 +597,7 @@ #if PLATFORM(WX) #define ENABLE_ASSEMBLER 1 -#if PLATFORM(DARWIN) +#if OS(DARWIN) #define WTF_PLATFORM_CF 1 #endif #endif @@ -610,19 +624,19 @@ #endif #endif /* !defined(HAVE_ACCESSIBILITY) */ -#if PLATFORM(UNIX) && !PLATFORM(SYMBIAN) +#if OS(UNIX) && !OS(SYMBIAN) #define HAVE_SIGNAL_H 1 #endif -#if !PLATFORM(WIN_OS) && !PLATFORM(SOLARIS) && !PLATFORM(QNX) \ - && !PLATFORM(SYMBIAN) && !PLATFORM(HAIKU) && !COMPILER(RVCT) \ - && !PLATFORM(ANDROID) +#if !OS(WINDOWS) && !OS(SOLARIS) && !OS(QNX) \ + && !OS(SYMBIAN) && !OS(HAIKU) && !OS(RVCT) \ + && !OS(ANDROID) #define HAVE_TM_GMTOFF 1 #define HAVE_TM_ZONE 1 #define HAVE_TIMEGM 1 #endif -#if PLATFORM(DARWIN) +#if OS(DARWIN) #define HAVE_ERRNO_H 1 #define HAVE_LANGINFO_H 1 @@ -644,16 +658,16 @@ #define HAVE_MADV_FREE 1 #endif -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) -#if PLATFORM(WINCE) +#if OS(WINCE) #define HAVE_ERRNO_H 0 #else #define HAVE_SYS_TIMEB_H 1 #endif #define HAVE_VIRTUALALLOC 1 -#elif PLATFORM(SYMBIAN) +#elif OS(SYMBIAN) #define HAVE_ERRNO_H 1 #define HAVE_MMAP 0 @@ -666,7 +680,7 @@ #define HAVE_SYS_PARAM_H 1 #endif -#elif PLATFORM(QNX) +#elif OS(QNX) #define HAVE_ERRNO_H 1 #define HAVE_MMAP 1 @@ -675,7 +689,7 @@ #define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_TIME_H 1 -#elif PLATFORM(ANDROID) +#elif OS(ANDROID) #define HAVE_ERRNO_H 1 #define HAVE_LANGINFO_H 0 @@ -691,7 +705,7 @@ #define HAVE_ERRNO_H 1 /* As long as Haiku doesn't have a complete support of locale this will be disabled. */ -#if !PLATFORM(HAIKU) +#if !OS(HAIKU) #define HAVE_LANGINFO_H 1 #endif #define HAVE_MMAP 1 @@ -790,11 +804,11 @@ #endif #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) -#if (CPU(X86_64) && (PLATFORM(UNIX) || PLATFORM(WIN_OS))) || CPU(IA64) || CPU(ALPHA) +#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) || CPU(IA64) || CPU(ALPHA) #define WTF_USE_JSVALUE64 1 #elif CPU(ARM) || CPU(PPC64) #define WTF_USE_JSVALUE32 1 -#elif PLATFORM(WIN_OS) && COMPILER(MINGW) +#elif OS(WINDOWS) && COMPILER(MINGW) /* Using JSVALUE32_64 causes padding/alignement issues for JITStubArg on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #define WTF_USE_JSVALUE32 1 @@ -824,21 +838,21 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #endif #if PLATFORM(QT) -#if CPU(X86_64) && PLATFORM(DARWIN) +#if CPU(X86_64) && OS(DARWIN) #define ENABLE_JIT 1 -#elif CPU(X86) && PLATFORM(DARWIN) +#elif CPU(X86) && OS(DARWIN) #define ENABLE_JIT 1 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 -#elif CPU(X86) && PLATFORM(WIN_OS) && COMPILER(MINGW) && GCC_VERSION >= 40100 +#elif CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100 #define ENABLE_JIT 1 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 -#elif CPU(X86) && PLATFORM(WIN_OS) && COMPILER(MSVC) +#elif CPU(X86) && OS(WINDOWS) && COMPILER(MSVC) #define ENABLE_JIT 1 #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1 -#elif CPU(X86) && PLATFORM(LINUX) && GCC_VERSION >= 40100 +#elif CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100 #define ENABLE_JIT 1 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 -#elif CPU(ARM_TRADITIONAL) && PLATFORM(LINUX) +#elif CPU(ARM_TRADITIONAL) && OS(LINUX) #define ENABLE_JIT 1 #endif #endif /* PLATFORM(QT) */ @@ -891,10 +905,10 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #endif #if PLATFORM(QT) -#if (CPU(X86) && PLATFORM(WIN_OS) && COMPILER(MINGW) && GCC_VERSION >= 40100) \ - || (CPU(X86) && PLATFORM(WIN_OS) && COMPILER(MSVC)) \ - || (CPU(X86) && PLATFORM(LINUX) && GCC_VERSION >= 40100) \ - || (CPU(ARM_TRADITIONAL) && PLATFORM(LINUX)) +#if (CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100) \ + || (CPU(X86) && OS(WINDOWS) && COMPILER(MSVC)) \ + || (CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100) \ + || (CPU(ARM_TRADITIONAL) && OS(LINUX)) #define ENABLE_YARR 1 #define ENABLE_YARR_JIT 1 #endif @@ -918,7 +932,7 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 0 #endif -#if !defined(ENABLE_PAN_SCROLLING) && PLATFORM(WIN_OS) +#if !defined(ENABLE_PAN_SCROLLING) && OS(WINDOWS) #define ENABLE_PAN_SCROLLING 1 #endif @@ -961,7 +975,7 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #define WARN_UNUSED_RETURN #endif -#if !ENABLE(NETSCAPE_PLUGIN_API) || (ENABLE(NETSCAPE_PLUGIN_API) && ((PLATFORM(UNIX) && (PLATFORM(QT) || PLATFORM(WX))) || PLATFORM(GTK))) +#if !ENABLE(NETSCAPE_PLUGIN_API) || (ENABLE(NETSCAPE_PLUGIN_API) && ((OS(UNIX) && (PLATFORM(QT) || PLATFORM(WX))) || PLATFORM(GTK))) #define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1 #endif diff --git a/JavaScriptCore/wtf/RandomNumber.cpp b/JavaScriptCore/wtf/RandomNumber.cpp index 52fb13084e3..74bb45c6928 100644 --- a/JavaScriptCore/wtf/RandomNumber.cpp +++ b/JavaScriptCore/wtf/RandomNumber.cpp @@ -34,7 +34,7 @@ #include #include -#if PLATFORM(WINCE) +#if OS(WINCE) extern "C" { #include "wince/mt19937ar.c" } @@ -66,10 +66,10 @@ double randomNumber() uint32_t bits; rand_s(&bits); return static_cast(bits) / (static_cast(std::numeric_limits::max()) + 1.0); -#elif PLATFORM(DARWIN) +#elif OS(DARWIN) uint32_t bits = arc4random(); return static_cast(bits) / (static_cast(std::numeric_limits::max()) + 1.0); -#elif PLATFORM(UNIX) +#elif OS(UNIX) uint32_t part1 = random() & (RAND_MAX - 1); uint32_t part2 = random() & (RAND_MAX - 1); // random only provides 31 bits @@ -80,9 +80,9 @@ double randomNumber() // Mask off the low 53bits fullRandom &= (1LL << 53) - 1; return static_cast(fullRandom)/static_cast(1LL << 53); -#elif PLATFORM(WINCE) +#elif OS(WINCE) return genrand_res53(); -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) uint32_t part1 = rand() & (RAND_MAX - 1); uint32_t part2 = rand() & (RAND_MAX - 1); uint32_t part3 = rand() & (RAND_MAX - 1); diff --git a/JavaScriptCore/wtf/RandomNumberSeed.h b/JavaScriptCore/wtf/RandomNumberSeed.h index a66433e61dc..ae414c0e32a 100644 --- a/JavaScriptCore/wtf/RandomNumberSeed.h +++ b/JavaScriptCore/wtf/RandomNumberSeed.h @@ -33,12 +33,12 @@ #include #endif -#if PLATFORM(UNIX) +#if OS(UNIX) #include #include #endif -#if PLATFORM(WINCE) +#if OS(WINCE) extern "C" { void init_by_array(unsigned long init_key[],int key_length); } @@ -49,9 +49,9 @@ namespace WTF { inline void initializeRandomNumberGenerator() { -#if PLATFORM(DARWIN) +#if OS(DARWIN) // On Darwin we use arc4random which initialises itself. -#elif PLATFORM(WINCE) +#elif OS(WINCE) // initialize rand() srand(static_cast(time(0))); @@ -64,7 +64,7 @@ inline void initializeRandomNumberGenerator() init_by_array(initializationBuffer, 4); #elif COMPILER(MSVC) && defined(_CRT_RAND_S) // On Windows we use rand_s which initialises itself -#elif PLATFORM(UNIX) +#elif OS(UNIX) // srandomdev is not guaranteed to exist on linux so we use this poor seed, this should be improved timeval time; gettimeofday(&time, 0); diff --git a/JavaScriptCore/wtf/StringExtras.h b/JavaScriptCore/wtf/StringExtras.h index a24397da2f4..b1ec09f095c 100644 --- a/JavaScriptCore/wtf/StringExtras.h +++ b/JavaScriptCore/wtf/StringExtras.h @@ -34,6 +34,7 @@ #endif #if COMPILER(MSVC) +// FIXME: why a COMPILER check instead of OS? also, these should be HAVE checks inline int snprintf(char* buffer, size_t count, const char* format, ...) { @@ -45,7 +46,7 @@ inline int snprintf(char* buffer, size_t count, const char* format, ...) return result; } -#if COMPILER(MSVC7) || PLATFORM(WINCE) +#if COMPILER(MSVC7) || OS(WINCE) inline int vsnprintf(char* buffer, size_t count, const char* format, va_list args) { @@ -54,7 +55,7 @@ inline int vsnprintf(char* buffer, size_t count, const char* format, va_list arg #endif -#if PLATFORM(WINCE) +#if OS(WINCE) inline int strnicmp(const char* string1, const char* string2, size_t count) { @@ -85,7 +86,8 @@ inline int strcasecmp(const char* s1, const char* s2) #endif -#if PLATFORM(WIN_OS) || PLATFORM(LINUX) || PLATFORM(SOLARIS) +#if OS(WINDOWS) || OS(LINUX) || OS(SOLARIS) +// FIXME: should check HAVE_STRNSTR inline char* strnstr(const char* buffer, const char* target, size_t bufferLength) { diff --git a/JavaScriptCore/wtf/TCSpinLock.h b/JavaScriptCore/wtf/TCSpinLock.h index cbec7de5dfb..632f8e44285 100644 --- a/JavaScriptCore/wtf/TCSpinLock.h +++ b/JavaScriptCore/wtf/TCSpinLock.h @@ -47,7 +47,7 @@ #include #endif -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif @@ -103,7 +103,7 @@ struct TCMalloc_SpinLock { ("isync\n\t" "eieio\n\t" "stw %1, %0" -#if PLATFORM(DARWIN) || CPU(PPC) +#if OS(DARWIN) || CPU(PPC) : "=o" (lockword_) #else : "=m" (lockword_) @@ -178,7 +178,7 @@ static void TCMalloc_SlowLock(volatile unsigned int* lockword) { // from taking 30 seconds to 16 seconds. // Sleep for a few milliseconds -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) Sleep(2); #else struct timespec tm; diff --git a/JavaScriptCore/wtf/TCSystemAlloc.cpp b/JavaScriptCore/wtf/TCSystemAlloc.cpp index 659bb0e64d9..4d029195ec1 100644 --- a/JavaScriptCore/wtf/TCSystemAlloc.cpp +++ b/JavaScriptCore/wtf/TCSystemAlloc.cpp @@ -47,7 +47,7 @@ #include #endif -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include "windows.h" #else #include diff --git a/JavaScriptCore/wtf/ThreadSpecific.h b/JavaScriptCore/wtf/ThreadSpecific.h index b6f5fd3c8b9..fe2f8f3cf85 100644 --- a/JavaScriptCore/wtf/ThreadSpecific.h +++ b/JavaScriptCore/wtf/ThreadSpecific.h @@ -47,13 +47,13 @@ #include #elif PLATFORM(QT) #include -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) #include #endif namespace WTF { -#if !USE(PTHREADS) && !PLATFORM(QT) && PLATFORM(WIN_OS) +#if !USE(PTHREADS) && !PLATFORM(QT) && OS(WINDOWS) // ThreadSpecificThreadExit should be called each time when a thread is detached. // This is done automatically for threads created with WTF::createThread. void ThreadSpecificThreadExit(); @@ -68,7 +68,7 @@ public: ~ThreadSpecific(); private: -#if !USE(PTHREADS) && !PLATFORM(QT) && PLATFORM(WIN_OS) +#if !USE(PTHREADS) && !PLATFORM(QT) && OS(WINDOWS) friend void ThreadSpecificThreadExit(); #endif @@ -76,7 +76,7 @@ private: void set(T*); void static destroy(void* ptr); -#if USE(PTHREADS) || PLATFORM(QT) || PLATFORM(WIN_OS) +#if USE(PTHREADS) || PLATFORM(QT) || OS(WINDOWS) struct Data : Noncopyable { Data(T* value, ThreadSpecific* owner) : value(value), owner(owner) {} #if PLATFORM(QT) @@ -95,7 +95,7 @@ private: pthread_key_t m_key; #elif PLATFORM(QT) QThreadStorage m_key; -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) int m_index; #endif }; @@ -157,7 +157,7 @@ inline void ThreadSpecific::set(T* ptr) m_key.setLocalData(data); } -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) // The maximum number of TLS keys that can be created. For simplification, we assume that: // 1) Once the instance of ThreadSpecific<> is created, it will not be destructed until the program dies. @@ -230,7 +230,7 @@ inline void ThreadSpecific::destroy(void* ptr) pthread_setspecific(data->owner->m_key, 0); #elif PLATFORM(QT) // Do nothing here -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) TlsSetValue(tlsKeys()[data->owner->m_index], 0); #else #error ThreadSpecific is not implemented for this platform. diff --git a/JavaScriptCore/wtf/Threading.h b/JavaScriptCore/wtf/Threading.h index d72a08e993d..3a6ae59edf7 100644 --- a/JavaScriptCore/wtf/Threading.h +++ b/JavaScriptCore/wtf/Threading.h @@ -61,7 +61,7 @@ #include "Platform.h" -#if PLATFORM(WINCE) +#if OS(WINCE) #include #endif @@ -69,11 +69,11 @@ #include #include -#if PLATFORM(WIN_OS) && !PLATFORM(WINCE) +#if OS(WINDOWS) && !OS(WINCE) #include -#elif PLATFORM(DARWIN) +#elif OS(DARWIN) #include -#elif PLATFORM(ANDROID) +#elif OS(ANDROID) #include #elif COMPILER(GCC) #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) @@ -144,7 +144,7 @@ typedef GOwnPtr PlatformCondition; typedef QT_PREPEND_NAMESPACE(QMutex)* PlatformMutex; typedef void* PlatformReadWriteLock; // FIXME: Implement. typedef QT_PREPEND_NAMESPACE(QWaitCondition)* PlatformCondition; -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) struct PlatformMutex { CRITICAL_SECTION m_internalMutex; size_t m_recursionCount; @@ -217,10 +217,10 @@ private: PlatformCondition m_condition; }; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #define WTF_USE_LOCKFREE_THREADSAFESHARED 1 -#if COMPILER(MINGW) || COMPILER(MSVC7) || PLATFORM(WINCE) +#if COMPILER(MINGW) || COMPILER(MSVC7) || OS(WINCE) inline int atomicIncrement(int* addend) { return InterlockedIncrement(reinterpret_cast(addend)); } inline int atomicDecrement(int* addend) { return InterlockedDecrement(reinterpret_cast(addend)); } #else @@ -228,13 +228,13 @@ inline int atomicIncrement(int volatile* addend) { return InterlockedIncrement(r inline int atomicDecrement(int volatile* addend) { return InterlockedDecrement(reinterpret_cast(addend)); } #endif -#elif PLATFORM(DARWIN) +#elif OS(DARWIN) #define WTF_USE_LOCKFREE_THREADSAFESHARED 1 inline int atomicIncrement(int volatile* addend) { return OSAtomicIncrement32Barrier(const_cast(addend)); } inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Barrier(const_cast(addend)); } -#elif PLATFORM(ANDROID) +#elif OS(ANDROID) inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); } inline int atomicDecrement(int volatile* addend) { return android_atomic_dec(addend); } diff --git a/JavaScriptCore/wtf/ThreadingPthreads.cpp b/JavaScriptCore/wtf/ThreadingPthreads.cpp index fbd7164600f..9f6ff7c4591 100644 --- a/JavaScriptCore/wtf/ThreadingPthreads.cpp +++ b/JavaScriptCore/wtf/ThreadingPthreads.cpp @@ -45,7 +45,7 @@ #include #endif -#if PLATFORM(ANDROID) +#if OS(ANDROID) #include "jni_utility.h" #endif @@ -55,7 +55,7 @@ typedef HashMap ThreadMap; static Mutex* atomicallyInitializedStaticMutex; -#if !PLATFORM(DARWIN) || PLATFORM(CHROMIUM) || USE(WEB_THREAD) +#if !OS(DARWIN) || PLATFORM(CHROMIUM) || USE(WEB_THREAD) static pthread_t mainThread; // The thread that was the first to call initializeThreading(), which must be the main thread. #endif @@ -71,7 +71,7 @@ void initializeThreading() atomicallyInitializedStaticMutex = new Mutex; threadMapMutex(); initializeRandomNumberGenerator(); -#if !PLATFORM(DARWIN) || PLATFORM(CHROMIUM) || USE(WEB_THREAD) +#if !OS(DARWIN) || PLATFORM(CHROMIUM) || USE(WEB_THREAD) mainThread = pthread_self(); #endif initializeMainThread(); @@ -137,7 +137,7 @@ static void clearPthreadHandleForIdentifier(ThreadIdentifier id) threadMap().remove(id); } -#if PLATFORM(ANDROID) +#if OS(ANDROID) // On the Android platform, threads must be registered with the VM before they run. struct ThreadData { ThreadFunction entryPoint; @@ -229,7 +229,7 @@ ThreadIdentifier currentThread() bool isMainThread() { -#if PLATFORM(DARWIN) && !PLATFORM(CHROMIUM) && !USE(WEB_THREAD) +#if OS(DARWIN) && !PLATFORM(CHROMIUM) && !USE(WEB_THREAD) return pthread_main_np(); #else return pthread_equal(pthread_self(), mainThread); diff --git a/JavaScriptCore/wtf/ThreadingWin.cpp b/JavaScriptCore/wtf/ThreadingWin.cpp index cccbda14ef6..1fd84d2bdec 100644 --- a/JavaScriptCore/wtf/ThreadingWin.cpp +++ b/JavaScriptCore/wtf/ThreadingWin.cpp @@ -87,10 +87,10 @@ #include "Threading.h" #include "MainThread.h" -#if !USE(PTHREADS) && PLATFORM(WIN_OS) +#if !USE(PTHREADS) && OS(WINDOWS) #include "ThreadSpecific.h" #endif -#if !PLATFORM(WINCE) +#if !OS(WINCE) #include #endif #if HAVE(ERRNO_H) @@ -205,7 +205,7 @@ static unsigned __stdcall wtfThreadEntryPoint(void* param) void* result = invocation.function(invocation.data); -#if !USE(PTHREADS) && PLATFORM(WIN_OS) +#if !USE(PTHREADS) && OS(WINDOWS) // Do the TLS cleanup. ThreadSpecificThreadExit(); #endif @@ -218,7 +218,7 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con unsigned threadIdentifier = 0; ThreadIdentifier threadID = 0; ThreadFunctionInvocation* invocation = new ThreadFunctionInvocation(entryPoint, data); -#if PLATFORM(WINCE) +#if OS(WINCE) // This is safe on WINCE, since CRT is in the core and innately multithreaded. // On desktop Windows, need to use _beginthreadex (not available on WinCE) if using any CRT functions HANDLE threadHandle = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)wtfThreadEntryPoint, invocation, 0, (LPDWORD)&threadIdentifier); @@ -226,7 +226,7 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con HANDLE threadHandle = reinterpret_cast(_beginthreadex(0, 0, wtfThreadEntryPoint, invocation, 0, &threadIdentifier)); #endif if (!threadHandle) { -#if PLATFORM(WINCE) +#if OS(WINCE) LOG_ERROR("Failed to create thread at entry point %p with data %p: %ld", entryPoint, data, ::GetLastError()); #elif defined(NO_ERRNO) LOG_ERROR("Failed to create thread at entry point %p with data %p.", entryPoint, data); diff --git a/JavaScriptCore/wtf/VMTags.h b/JavaScriptCore/wtf/VMTags.h index 519f5189492..1ec79d9e1df 100644 --- a/JavaScriptCore/wtf/VMTags.h +++ b/JavaScriptCore/wtf/VMTags.h @@ -30,7 +30,7 @@ // On Mac OS X, the VM subsystem allows tagging memory requested from mmap and vm_map // in order to aid tools that inspect system memory use. -#if PLATFORM(DARWIN) && !defined(BUILDING_ON_TIGER) +#if OS(DARWIN) && !defined(BUILDING_ON_TIGER) #include @@ -44,12 +44,12 @@ #define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(65) #endif // defined(VM_MEMORY_JAVASCRIPT_CORE) && defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) -#else // PLATFORM(DARWIN) && !defined(BUILDING_ON_TIGER) +#else // OS(DARWIN) && !defined(BUILDING_ON_TIGER) #define VM_TAG_FOR_COLLECTOR_MEMORY -1 #define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY -1 #define VM_TAG_FOR_REGISTERFILE_MEMORY -1 -#endif // PLATFORM(DARWIN) && !defined(BUILDING_ON_TIGER) +#endif // OS(DARWIN) && !defined(BUILDING_ON_TIGER) #endif // VMTags_h diff --git a/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp b/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp index 6376bb31fe0..a1753a4c096 100644 --- a/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp +++ b/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp @@ -36,7 +36,7 @@ #include #include -#if PLATFORM(DARWIN) +#if OS(DARWIN) #include "RetainPtr.h" #include #endif @@ -59,9 +59,9 @@ Collator::Collator(const char* locale) std::auto_ptr Collator::userDefault() { -#if PLATFORM(DARWIN) && PLATFORM(CF) +#if OS(DARWIN) && PLATFORM(CF) // Mac OS X doesn't set UNIX locale to match user-selected one, so ICU default doesn't work. -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !PLATFORM(IPHONE) +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !OS(IPHONE_OS) RetainPtr currentLocale(AdoptCF, CFLocaleCopyCurrent()); CFStringRef collationOrder = (CFStringRef)CFLocaleGetValue(currentLocale.get(), kCFLocaleCollatorIdentifier); #else diff --git a/JavaScriptCore/wtf/win/MainThreadWin.cpp b/JavaScriptCore/wtf/win/MainThreadWin.cpp index d583c12dc8f..ee70b59b670 100644 --- a/JavaScriptCore/wtf/win/MainThreadWin.cpp +++ b/JavaScriptCore/wtf/win/MainThreadWin.cpp @@ -32,7 +32,7 @@ #include "Assertions.h" #include "Threading.h" -#if !PLATFORM(WINCE) +#if !OS(WINCE) #include #endif @@ -57,7 +57,7 @@ void initializeMainThreadPlatform() return; HWND hWndParent = 0; -#if PLATFORM(WINCE) +#if OS(WINCE) WNDCLASS wcex; memset(&wcex, 0, sizeof(WNDCLASS)); #else @@ -67,7 +67,7 @@ void initializeMainThreadPlatform() #endif wcex.lpfnWndProc = ThreadingWindowWndProc; wcex.lpszClassName = kThreadingWindowClassName; -#if PLATFORM(WINCE) +#if OS(WINCE) RegisterClass(&wcex); #else RegisterClassEx(&wcex); diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 096541dc0be..768cf87a957 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,166 @@ +2010-01-04 Maciej Stachowiak + + Reviewed by Darin Fisher. + + Reorganize, document and rename OS() platform macros. + https://bugs.webkit.org/show_bug.cgi?id=33198 + + Adapt to name changes. Also fixed a few incorrect OS checks. + + * accessibility/AccessibilityObject.h: + * config.h: + * dom/SelectElement.cpp: + (WebCore::SelectElement::listBoxDefaultEventHandler): + * inspector/InspectorFrontendHost.cpp: + (WebCore::InspectorFrontendHost::platform): + * loader/CachedFont.cpp: + * loader/FTPDirectoryDocument.cpp: + * loader/FTPDirectoryParser.cpp: + * page/EventHandler.cpp: + * page/Frame.cpp: + (WebCore::Frame::setUseSecureKeyboardEntry): + * page/NavigatorBase.cpp: + (WebCore::NavigatorBase::platform): + * page/Page.h: + * page/Settings.cpp: + (WebCore::Settings::Settings): + * page/Settings.h: + * page/chromium/DragControllerChromium.cpp: + (WebCore::DragController::isCopyKeyDown): + * page/chromium/EventHandlerChromium.cpp: + (WebCore::EventHandler::accessKeyModifiers): + * page/win/EventHandlerWin.cpp: + (WebCore::EventHandler::createDraggingClipboard): + * platform/FileSystem.h: + * platform/KeyboardCodes.h: + * platform/PurgeableBuffer.h: + * platform/chromium/ChromiumBridge.h: + * platform/chromium/ClipboardChromium.cpp: + (WebCore::ClipboardChromium::writeRange): + * platform/chromium/ClipboardUtilitiesChromium.cpp: + * platform/chromium/ClipboardUtilitiesChromium.h: + * platform/chromium/PasteboardChromium.cpp: + (WebCore::Pasteboard::writeSelection): + (WebCore::Pasteboard::writePlainText): + (WebCore::Pasteboard::documentFragment): + * platform/chromium/PlatformKeyboardEventChromium.cpp: + (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): + (WebCore::PlatformKeyboardEvent::currentCapsLockState): + * platform/chromium/PopupMenuChromium.cpp: + (WebCore::PopupListBox::layout): + (WebCore::PopupMenu::show): + * platform/graphics/BitmapImage.h: + (WebCore::BitmapImage::mayFillWithSolidColor): + * platform/graphics/FloatPoint.h: + * platform/graphics/FloatRect.h: + * platform/graphics/FloatSize.h: + * platform/graphics/FontCache.cpp: + (WebCore::alternateFamilyName): + * platform/graphics/FontCache.h: + * platform/graphics/FontFastPath.cpp: + (WebCore::Font::glyphDataForCharacter): + * platform/graphics/GlyphBuffer.h: + (WebCore::GlyphBuffer::advanceAt): + (WebCore::GlyphBuffer::add): + * platform/graphics/Gradient.h: + * platform/graphics/GraphicsContext.cpp: + * platform/graphics/GraphicsContext.h: + * platform/graphics/GraphicsContext3D.h: + * platform/graphics/ImageSource.h: + * platform/graphics/IntRect.h: + * platform/graphics/MediaPlayer.cpp: + * platform/graphics/Path.h: + * platform/graphics/Pattern.h: + * platform/graphics/SimpleFontData.h: + * platform/graphics/cg/ColorCG.cpp: + * platform/graphics/cg/GraphicsContextCG.cpp: + * platform/graphics/chromium/FontCustomPlatformData.cpp: + (WebCore::FontCustomPlatformData::~FontCustomPlatformData): + (WebCore::FontCustomPlatformData::fontPlatformData): + (WebCore::createFontCustomPlatformData): + * platform/graphics/chromium/FontCustomPlatformData.h: + * platform/graphics/chromium/FontPlatformData.h: + * platform/graphics/opentype/OpenTypeUtilities.cpp: + * platform/graphics/opentype/OpenTypeUtilities.h: + * platform/graphics/qt/GraphicsContextQt.cpp: + (WebCore::GraphicsContext::getWindowsContext): + * platform/graphics/qt/ImageQt.cpp: + * platform/graphics/skia/GraphicsContextSkia.cpp: + (WebCore::GraphicsContext::clipToImageBuffer): + * platform/graphics/skia/ImageBufferSkia.cpp: + (WebCore::ImageBuffer::ImageBuffer): + * platform/graphics/skia/PlatformContextSkia.cpp: + (PlatformContextSkia::State::State): + (PlatformContextSkia::PlatformContextSkia): + (PlatformContextSkia::save): + (PlatformContextSkia::restore): + * platform/graphics/skia/PlatformContextSkia.h: + * platform/graphics/win/IconWin.cpp: + (WebCore::Icon::createIconForFiles): + (WebCore::Icon::paint): + * platform/graphics/wx/GraphicsContextWx.cpp: + * platform/gtk/FileSystemGtk.cpp: + (WebCore::filenameToString): + (WebCore::filenameFromString): + (WebCore::filenameForDisplay): + * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: + * platform/network/curl/ResourceHandleManager.cpp: + * platform/network/soup/ResourceHandleSoup.cpp: + (WebCore::): + * platform/text/String.cpp: + (WebCore::String::format): + (WebCore::String::number): + * platform/text/TextEncoding.cpp: + (WebCore::TextEncoding::encode): + * platform/text/TextEncodingRegistry.cpp: + (WebCore::buildBaseTextCodecMaps): + (WebCore::extendTextCodecMaps): + * platform/text/TextStream.cpp: + * platform/text/TextStream.h: + * platform/text/qt/TextCodecQt.cpp: + (WebCore::TextCodecQt::decode): + * platform/win/PlatformMouseEventWin.cpp: + (WebCore::messageToEventType): + (WebCore::PlatformMouseEvent::PlatformMouseEvent): + * platform/win/PlatformScreenWin.cpp: + (WebCore::deviceInfoForWidget): + (WebCore::screenIsMonochrome): + * platform/win/PopupMenuWin.cpp: + (WebCore::PopupMenu::show): + (WebCore::PopupMenu::paint): + (WebCore::PopupMenu::registerClass): + (WebCore::PopupMenu::PopupMenuWndProc): + (WebCore::PopupMenu::wndProc): + * platform/win/SystemTimeWin.cpp: + (WebCore::userIdleTime): + * platform/wx/FileSystemWx.cpp: + (WebCore::unloadModule): + * plugins/PluginDatabase.cpp: + * plugins/PluginPackage.cpp: + (WebCore::PluginPackage::compareFileVersion): + * plugins/PluginPackage.h: + * plugins/PluginView.cpp: + (WebCore::PluginView::setFrameRect): + (WebCore::PluginView::stop): + (WebCore::PluginView::PluginView): + * plugins/PluginView.h: + * plugins/win/PluginDatabaseWin.cpp: + (WebCore::addWindowsMediaPlayerPluginDirectory): + (WebCore::addMacromediaPluginDirectories): + * plugins/win/PluginPackageWin.cpp: + (WebCore::PluginPackage::load): + * plugins/win/PluginViewWin.cpp: + (WebCore::registerPluginView): + (WebCore::PluginView::wndProc): + (WebCore::PluginView::updatePluginWidget): + (WebCore::PluginView::paintIntoTransformedContext): + (WebCore::PluginView::paintWindowedPluginIntoContext): + (WebCore::PluginView::paint): + (WebCore::PluginView::handleMouseEvent): + (WebCore::PluginView::setParent): + (WebCore::PluginView::setNPWindowRect): + (WebCore::PluginView::platformStart): + 2010-01-04 Chris Fleizach Reviewed by Darin Adler. diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h index 263b67829fb..d6b9c889915 100644 --- a/WebCore/accessibility/AccessibilityObject.h +++ b/WebCore/accessibility/AccessibilityObject.h @@ -40,7 +40,7 @@ #if PLATFORM(MAC) #include -#elif PLATFORM(WIN) && !PLATFORM(WINCE) +#elif PLATFORM(WIN) && !OS(WINCE) #include "AccessibilityObjectWrapperWin.h" #include "COMPtr.h" #elif PLATFORM(CHROMIUM) @@ -552,7 +552,7 @@ protected: #if PLATFORM(MAC) RetainPtr m_wrapper; -#elif PLATFORM(WIN) && !PLATFORM(WINCE) +#elif PLATFORM(WIN) && !OS(WINCE) COMPtr m_wrapper; #elif PLATFORM(GTK) AtkObject* m_wrapper; diff --git a/WebCore/config.h b/WebCore/config.h index a880427cdcf..16f5a8f7657 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -25,7 +25,7 @@ #include -#if PLATFORM(WIN_OS) && !defined(BUILDING_WX__) && !COMPILER(GCC) +#if OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC) #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF) #define JS_EXPORTDATA __declspec(dllexport) #else @@ -47,7 +47,7 @@ #define HAVE_FUNC_USLEEP 1 #endif /* __APPLE__ */ -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0500 @@ -73,7 +73,7 @@ #endif #endif -#endif /* PLATFORM(WIN_OS) */ +#endif /* OS(WINDOWS) */ #if PLATFORM(ANDROID) #define WEBCORE_NAVIGATOR_VENDOR "Google Inc." @@ -169,7 +169,7 @@ #define WTF_USE_NEW_THEME 1 #endif // PLATFORM(MAC) -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) #undef WIN32 #undef _WIN32 #undef SKIP_STATIC_CONSTRUCTORS_ON_GCC @@ -187,10 +187,10 @@ #if PLATFORM(CHROMIUM) -#if !PLATFORM(DARWIN) +#if !OS(DARWIN) // Define SKIA on non-Mac. #define WTF_PLATFORM_SKIA 1 -#endif /* !PLATFORM(DARWIN) */ +#endif /* !OS(DARWIN) */ // Chromium uses this file instead of JavaScriptCore/config.h to compile // JavaScriptCore/wtf (chromium doesn't compile the rest of JSC). Therefore, diff --git a/WebCore/dom/SelectElement.cpp b/WebCore/dom/SelectElement.cpp index 54387fcdfdf..0e84a09869e 100644 --- a/WebCore/dom/SelectElement.cpp +++ b/WebCore/dom/SelectElement.cpp @@ -50,10 +50,10 @@ // Configure platform-specific behavior when focused pop-up receives arrow/space/return keystroke. // (PLATFORM(MAC) and PLATFORM(GTK) are always false in Chromium, hence the extra tests.) -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) #define ARROW_KEYS_POP_MENU 1 #define SPACE_OR_RETURN_POP_MENU 0 -#elif PLATFORM(GTK) || (PLATFORM(CHROMIUM) && PLATFORM(LINUX)) +#elif PLATFORM(GTK) || (PLATFORM(CHROMIUM) && OS(LINUX)) #define ARROW_KEYS_POP_MENU 0 #define SPACE_OR_RETURN_POP_MENU 1 #else @@ -683,7 +683,7 @@ void SelectElement::listBoxDefaultEventHandler(SelectElementData& data, Element* data.setActiveSelectionState(true); bool multiSelectKeyPressed = false; -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) multiSelectKeyPressed = mouseEvent->metaKey(); #else multiSelectKeyPressed = mouseEvent->ctrlKey(); diff --git a/WebCore/inspector/InspectorFrontendHost.cpp b/WebCore/inspector/InspectorFrontendHost.cpp index 5bc5ac1940f..42a20d796a6 100644 --- a/WebCore/inspector/InspectorFrontendHost.cpp +++ b/WebCore/inspector/InspectorFrontendHost.cpp @@ -125,7 +125,7 @@ const String& InspectorFrontendHost::platform() const #else DEFINE_STATIC_LOCAL(const String, platform, ("mac-leopard")); #endif -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) DEFINE_STATIC_LOCAL(const String, platform, ("windows")); #else DEFINE_STATIC_LOCAL(const String, platform, ("unknown")); diff --git a/WebCore/loader/CachedFont.cpp b/WebCore/loader/CachedFont.cpp index 51b1e97b44a..64ab24f5d7f 100644 --- a/WebCore/loader/CachedFont.cpp +++ b/WebCore/loader/CachedFont.cpp @@ -27,7 +27,7 @@ #include "config.h" #include "CachedFont.h" -#if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (PLATFORM(WIN_OS) || PLATFORM(LINUX))) || PLATFORM(HAIKU) || PLATFORM(WINCE) +#if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX))) || PLATFORM(HAIKU) || OS(WINCE) #define STORE_FONT_CUSTOM_PLATFORM_DATA #endif diff --git a/WebCore/loader/FTPDirectoryDocument.cpp b/WebCore/loader/FTPDirectoryDocument.cpp index ee0f4ca3890..7a71d02d584 100644 --- a/WebCore/loader/FTPDirectoryDocument.cpp +++ b/WebCore/loader/FTPDirectoryDocument.cpp @@ -43,7 +43,7 @@ #if PLATFORM(QT) #include // On Windows, use the threadsafe *_r functions provided by pthread. -#elif PLATFORM(WIN_OS) && (USE(PTHREADS) || HAVE(PTHREAD_H)) +#elif OS(WINDOWS) && (USE(PTHREADS) || HAVE(PTHREAD_H)) #include #endif @@ -234,7 +234,7 @@ static struct tm *localTimeQt(const time_t *const timep, struct tm *result) } #define localtime_r(x, y) localTimeQt(x, y) -#elif PLATFORM(WIN_OS) && !defined(localtime_r) +#elif OS(WINDOWS) && !defined(localtime_r) #if defined(_MSC_VER) && (_MSC_VER >= 1400) #define localtime_r(x, y) localtime_s((y), (x)) #else /* !_MSC_VER */ diff --git a/WebCore/loader/FTPDirectoryParser.cpp b/WebCore/loader/FTPDirectoryParser.cpp index 40bd714c0e6..8e83a7ecda1 100644 --- a/WebCore/loader/FTPDirectoryParser.cpp +++ b/WebCore/loader/FTPDirectoryParser.cpp @@ -27,7 +27,7 @@ #if PLATFORM(QT) #include // On Windows, use the threadsafe *_r functions provided by pthread. -#elif PLATFORM(WIN_OS) && (USE(PTHREADS) || HAVE(PTHREAD_H)) +#elif OS(WINDOWS) && (USE(PTHREADS) || HAVE(PTHREAD_H)) #include #endif @@ -49,7 +49,7 @@ static struct tm *gmtimeQt(const time_t *const timep, struct tm *result) } #define gmtime_r(x, y) gmtimeQt(x, y) -#elif PLATFORM(WIN_OS) && !defined(gmtime_r) +#elif OS(WINDOWS) && !defined(gmtime_r) #if defined(_MSC_VER) && (_MSC_VER >= 1400) #define gmtime_r(x, y) gmtime_s((y), (x)) #else /* !_MSC_VER */ diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp index 1481549a5a7..223a3f7652f 100644 --- a/WebCore/page/EventHandler.cpp +++ b/WebCore/page/EventHandler.cpp @@ -1786,7 +1786,7 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe return swallowEvent; } -#if !PLATFORM(GTK) && !(PLATFORM(CHROMIUM) && PLATFORM(LINUX)) +#if !PLATFORM(GTK) && !(PLATFORM(CHROMIUM) && OS(LINUX)) bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&) const { return false; diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp index 4c370a69e39..54a7f067847 100644 --- a/WebCore/page/Frame.cpp +++ b/WebCore/page/Frame.cpp @@ -83,7 +83,7 @@ #include #include -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) #import #endif @@ -922,12 +922,12 @@ bool Frame::isContentEditable() const return m_doc->inDesignMode(); } -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) const short enableRomanKeyboardsOnly = -23; #endif void Frame::setUseSecureKeyboardEntry(bool enable) { -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) if (enable == IsSecureEventInputEnabled()) return; if (enable) { diff --git a/WebCore/page/NavigatorBase.cpp b/WebCore/page/NavigatorBase.cpp index ba4d33617e8..341db66cf61 100644 --- a/WebCore/page/NavigatorBase.cpp +++ b/WebCore/page/NavigatorBase.cpp @@ -29,7 +29,7 @@ #include "NetworkStateNotifier.h" #include "PlatformString.h" -#if PLATFORM(LINUX) +#if OS(LINUX) #include "sys/utsname.h" #include #endif @@ -39,9 +39,9 @@ #define WEBCORE_NAVIGATOR_PLATFORM "MacPPC" #elif PLATFORM(MAC) && (CPU(X86) || CPU(X86_64)) #define WEBCORE_NAVIGATOR_PLATFORM "MacIntel" -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) #define WEBCORE_NAVIGATOR_PLATFORM "Win32" -#elif PLATFORM(SYMBIAN) +#elif OS(SYMBIAN) #define WEBCORE_NAVIGATOR_PLATFORM "Symbian" #else #define WEBCORE_NAVIGATOR_PLATFORM "" @@ -85,7 +85,7 @@ String NavigatorBase::appVersion() const String NavigatorBase::platform() const { -#if PLATFORM(LINUX) +#if OS(LINUX) if (String("") != WEBCORE_NAVIGATOR_PLATFORM) return WEBCORE_NAVIGATOR_PLATFORM; struct utsname osname; diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h index 95c6aa1c50d..ad611d13b71 100644 --- a/WebCore/page/Page.h +++ b/WebCore/page/Page.h @@ -31,7 +31,7 @@ #include "SchedulePair.h" #endif -#if PLATFORM(WIN) || (PLATFORM(WX) && PLATFORM(WIN_OS)) || (PLATFORM(QT) && defined(Q_WS_WIN)) +#if PLATFORM(WIN) || (PLATFORM(WX) && OS(WINDOWS)) || (PLATFORM(QT) && defined(Q_WS_WIN)) typedef struct HINSTANCE__* HINSTANCE; #endif @@ -204,7 +204,7 @@ namespace WebCore { void setDebugger(JSC::Debugger*); JSC::Debugger* debugger() const { return m_debugger; } -#if PLATFORM(WIN) || (PLATFORM(WX) && PLATFORM(WIN_OS)) || (PLATFORM(QT) && defined(Q_WS_WIN)) +#if PLATFORM(WIN) || (PLATFORM(WX) && OS(WINDOWS)) || (PLATFORM(QT) && defined(Q_WS_WIN)) // The global DLL or application instance used for all windows. static void setInstanceHandle(HINSTANCE instanceHandle) { s_instanceHandle = instanceHandle; } static HINSTANCE instanceHandle() { return s_instanceHandle; } diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp index 10f228c30a3..3873c89fb78 100644 --- a/WebCore/page/Settings.cpp +++ b/WebCore/page/Settings.cpp @@ -49,7 +49,7 @@ static void setNeedsReapplyStylesInAllFrames(Page* page) bool Settings::gShouldPaintNativeControls = true; #endif -#if PLATFORM(WIN) || (PLATFORM(WIN_OS) && PLATFORM(WX)) +#if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX)) bool Settings::gShouldUseHighResolutionTimers = true; #endif @@ -104,7 +104,7 @@ Settings::Settings(Page* page) , m_usesEncodingDetector(false) , m_allowScriptsToCloseWindows(false) , m_editingBehavior( -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) // (PLATFORM(MAC) is always false in Chromium, hence the extra condition.) EditingMacBehavior #else @@ -533,7 +533,7 @@ void Settings::setPluginAllowedRunTime(unsigned runTime) m_page->pluginAllowedRunTimeChanged(); } -#if PLATFORM(WIN) || (PLATFORM(WIN_OS) && PLATFORM(WX)) +#if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX)) void Settings::setShouldUseHighResolutionTimers(bool shouldUseHighResolutionTimers) { gShouldUseHighResolutionTimers = shouldUseHighResolutionTimers; diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h index 673ba8f995e..9f00b0dc8d8 100644 --- a/WebCore/page/Settings.h +++ b/WebCore/page/Settings.h @@ -262,7 +262,7 @@ namespace WebCore { void setExperimentalNotificationsEnabled(bool); bool experimentalNotificationsEnabled() const { return m_experimentalNotificationsEnabled; } -#if PLATFORM(WIN) || (PLATFORM(WIN_OS) && PLATFORM(WX)) +#if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX)) static void setShouldUseHighResolutionTimers(bool); static bool shouldUseHighResolutionTimers() { return gShouldUseHighResolutionTimers; } #endif @@ -350,7 +350,7 @@ namespace WebCore { #if USE(SAFARI_THEME) static bool gShouldPaintNativeControls; #endif -#if PLATFORM(WIN) || (PLATFORM(WIN_OS) && PLATFORM(WX)) +#if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX)) static bool gShouldUseHighResolutionTimers; #endif }; diff --git a/WebCore/page/chromium/DragControllerChromium.cpp b/WebCore/page/chromium/DragControllerChromium.cpp index 18688fd3c3a..7b0958d25ec 100644 --- a/WebCore/page/chromium/DragControllerChromium.cpp +++ b/WebCore/page/chromium/DragControllerChromium.cpp @@ -31,7 +31,7 @@ #include "SelectionController.h" #include -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include #endif @@ -57,7 +57,7 @@ DragOperation DragController::dragOperation(DragData* dragData) bool DragController::isCopyKeyDown() { // FIXME: This should not be OS specific. Delegate to the embedder instead. -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) return ::GetAsyncKeyState(VK_CONTROL); #else return false; diff --git a/WebCore/page/chromium/EventHandlerChromium.cpp b/WebCore/page/chromium/EventHandlerChromium.cpp index ac76a292e62..ff161af4b54 100644 --- a/WebCore/page/chromium/EventHandlerChromium.cpp +++ b/WebCore/page/chromium/EventHandlerChromium.cpp @@ -46,7 +46,7 @@ namespace WebCore { -#if PLATFORM(DARWIN) +#if OS(DARWIN) const double EventHandler::TextDragDelay = 0.15; #else const double EventHandler::TextDragDelay = 0.0; @@ -147,14 +147,14 @@ bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget) unsigned EventHandler::accessKeyModifiers() { -#if PLATFORM(DARWIN) +#if OS(DARWIN) return PlatformKeyboardEvent::CtrlKey | PlatformKeyboardEvent::AltKey; #else return PlatformKeyboardEvent::AltKey; #endif } -#if PLATFORM(LINUX) +#if OS(LINUX) // GTK+ must scroll horizontally if the mouse pointer is on top of the // horizontal scrollbar while scrolling with the wheel. // This code comes from gtk/EventHandlerGtk.cpp. diff --git a/WebCore/page/win/EventHandlerWin.cpp b/WebCore/page/win/EventHandlerWin.cpp index 50e50fb13e9..5511209609c 100644 --- a/WebCore/page/win/EventHandlerWin.cpp +++ b/WebCore/page/win/EventHandlerWin.cpp @@ -88,7 +88,7 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const PassRefPtr EventHandler::createDraggingClipboard() const { -#if PLATFORM(WINCE) +#if OS(WINCE) return 0; #else COMPtr dataObject; diff --git a/WebCore/platform/FileSystem.h b/WebCore/platform/FileSystem.h index 3220d51456c..c5395a9cffb 100644 --- a/WebCore/platform/FileSystem.h +++ b/WebCore/platform/FileSystem.h @@ -54,7 +54,7 @@ typedef const struct __CFData* CFDataRef; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) // These are to avoid including in a header for Chromium typedef void *HANDLE; // Assuming STRICT @@ -67,7 +67,7 @@ namespace WebCore { class CString; // PlatformModule -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) typedef HMODULE PlatformModule; #elif PLATFORM(QT) #if defined(Q_WS_MAC) @@ -84,7 +84,7 @@ typedef void* PlatformModule; #endif // PlatformModuleVersion -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) struct PlatformModuleVersion { unsigned leastSig; unsigned mostSig; @@ -110,7 +110,7 @@ typedef unsigned PlatformModuleVersion; #if PLATFORM(QT) typedef QFile* PlatformFileHandle; const PlatformFileHandle invalidPlatformFileHandle = 0; -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) typedef HANDLE PlatformFileHandle; // FIXME: -1 is INVALID_HANDLE_VALUE, defined in . Chromium tries to // avoid using Windows headers in headers. We'd rather move this into the .cpp. diff --git a/WebCore/platform/KeyboardCodes.h b/WebCore/platform/KeyboardCodes.h index 48582a87e08..04ee0716d09 100644 --- a/WebCore/platform/KeyboardCodes.h +++ b/WebCore/platform/KeyboardCodes.h @@ -33,7 +33,7 @@ // FIXME: We should get rid of these Chromium-related ifdefs. #if PLATFORM(CHROMIUM) -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include "KeyboardCodesWin.h" #else #include "KeyboardCodesPosix.h" @@ -43,7 +43,7 @@ namespace WebCore { -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) // VK_LBUTTON (01) Left mouse button // VK_RBUTTON (02) Right mouse button // VK_CANCEL (03) Control-break processing @@ -160,7 +160,7 @@ const int VK_DELETE = 0x2E; // VK_HELP (2F) HELP key const int VK_HELP = 0x2F; -#endif // PLATFORM(WIN_OS) +#endif // OS(WINDOWS) // (30) 0 key const int VK_0 = 0x30; @@ -271,7 +271,7 @@ const int VK_Y = 0x59; // (5A) Z key const int VK_Z = 0x5A; -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) // VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard) const int VK_LWIN = 0x5B; @@ -483,9 +483,9 @@ const int VK_MEDIA_LAUNCH_APP1 = 0xB6; // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key const int VK_MEDIA_LAUNCH_APP2 = 0xB7; -#endif // !PLATFORM(WIN_OS) +#endif // !OS(WINDOWS) -#if !PLATFORM(WIN_OS) || PLATFORM(WINCE) +#if !OS(WINDOWS) || OS(WINCE) // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key const int VK_OEM_1 = 0xBA; @@ -523,9 +523,9 @@ const int VK_OEM_7 = 0xDE; // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard. const int VK_OEM_8 = 0xDF; -#endif // !PLATFORM(WIN_OS) || PLATFORM(WINCE) +#endif // !OS(WINDOWS) || OS(WINCE) -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard const int VK_OEM_102 = 0xE2; @@ -565,7 +565,7 @@ const int VK_OEM_CLEAR = 0xFE; const int VK_UNKNOWN = 0; -#endif // PLATFORM(WIN_OS) +#endif // OS(WINDOWS) } diff --git a/WebCore/platform/PurgeableBuffer.h b/WebCore/platform/PurgeableBuffer.h index c487eb994bf..94e58da9f96 100644 --- a/WebCore/platform/PurgeableBuffer.h +++ b/WebCore/platform/PurgeableBuffer.h @@ -62,7 +62,7 @@ namespace WebCore { mutable State m_state; }; -#if !PLATFORM(DARWIN) || defined(BUILDING_ON_TIGER) || PLATFORM(QT) || PLATFORM(GTK) +#if !OS(DARWIN) || defined(BUILDING_ON_TIGER) || PLATFORM(QT) || PLATFORM(GTK) inline PurgeableBuffer* PurgeableBuffer::create(const char*, size_t) { return 0; } inline PurgeableBuffer::~PurgeableBuffer() { } inline const char* PurgeableBuffer::data() const { return 0; } diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h index d30b9a8dd04..92b4c13c200 100644 --- a/WebCore/platform/chromium/ChromiumBridge.h +++ b/WebCore/platform/chromium/ChromiumBridge.h @@ -43,7 +43,7 @@ typedef struct NPObject NPObject; typedef struct _NPP NPP_t; typedef NPP_t* NPP; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) typedef struct HFONT__* HFONT; #endif @@ -106,10 +106,10 @@ namespace WebCore { static KURL filePathToURL(const String&); // Font --------------------------------------------------------------- -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) static bool ensureFontLoaded(HFONT font); #endif -#if PLATFORM(LINUX) +#if OS(LINUX) static String getFontFamilyForCharacters(const UChar*, size_t numCharacters); #endif @@ -188,7 +188,7 @@ namespace WebCore { static double currentTime(); // Theming ------------------------------------------------------------ -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) static void paintButton( GraphicsContext*, int part, int state, int classicState, const IntRect&); static void paintMenuList( diff --git a/WebCore/platform/chromium/ClipboardChromium.cpp b/WebCore/platform/chromium/ClipboardChromium.cpp index 6c1e050c554..32f7d507fb5 100644 --- a/WebCore/platform/chromium/ClipboardChromium.cpp +++ b/WebCore/platform/chromium/ClipboardChromium.cpp @@ -363,13 +363,13 @@ void ClipboardChromium::writeRange(Range* selectedRange, Frame* frame) m_dataObject->textHtml = createMarkup(selectedRange, 0, AnnotateForInterchange); -#if PLATFORM(DARWIN) +#if OS(DARWIN) m_dataObject->textHtml = String("") + m_dataObject->textHtml; #endif m_dataObject->htmlBaseUrl = frame->document()->url(); String str = frame->selectedText(); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) replaceNewlinesWithWindowsStyleNewlines(str); #endif replaceNBSPWithSpace(str); diff --git a/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp b/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp index 7efcb3cf024..5d9ed0549c5 100644 --- a/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp +++ b/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp @@ -36,7 +36,7 @@ namespace WebCore { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) void replaceNewlinesWithWindowsStyleNewlines(String& str) { static const UChar Newline = '\n'; diff --git a/WebCore/platform/chromium/ClipboardUtilitiesChromium.h b/WebCore/platform/chromium/ClipboardUtilitiesChromium.h index c5970895611..23fd29cf4ca 100644 --- a/WebCore/platform/chromium/ClipboardUtilitiesChromium.h +++ b/WebCore/platform/chromium/ClipboardUtilitiesChromium.h @@ -33,7 +33,7 @@ namespace WebCore { class KURL; class String; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) void replaceNewlinesWithWindowsStyleNewlines(String&); #endif void replaceNBSPWithSpace(String&); diff --git a/WebCore/platform/chromium/PasteboardChromium.cpp b/WebCore/platform/chromium/PasteboardChromium.cpp index ce06e55a06b..9213718270f 100644 --- a/WebCore/platform/chromium/PasteboardChromium.cpp +++ b/WebCore/platform/chromium/PasteboardChromium.cpp @@ -82,13 +82,13 @@ void Pasteboard::setSelectionMode(bool selectionMode) void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame) { String html = createMarkup(selectedRange, 0, AnnotateForInterchange); -#if PLATFORM(DARWIN) +#if OS(DARWIN) html = String("") + html; #endif ExceptionCode ec = 0; KURL url = selectedRange->startContainer(ec)->document()->url(); String plainText = frame->selectedText(); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) replaceNewlinesWithWindowsStyleNewlines(plainText); #endif replaceNBSPWithSpace(plainText); @@ -98,7 +98,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, void Pasteboard::writePlainText(const String& text) { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) String plainText(text); replaceNewlinesWithWindowsStyleNewlines(plainText); ChromiumBridge::clipboardWritePlainText(plainText); @@ -170,7 +170,7 @@ PassRefPtr Pasteboard::documentFragment(Frame* frame, PassRefP String markup; KURL srcURL; ChromiumBridge::clipboardReadHTML(buffer, &markup, &srcURL); -#if PLATFORM(DARWIN) +#if OS(DARWIN) DEFINE_STATIC_LOCAL(const String, forceUtf8String, ("")); if (markup.startsWith(forceUtf8String)) markup = markup.substring(forceUtf8String.length()); diff --git a/WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp b/WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp index ae55afee824..74643f7764d 100644 --- a/WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp +++ b/WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp @@ -27,9 +27,9 @@ #include "config.h" #include "PlatformKeyboardEvent.h" -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include -#elif PLATFORM(DARWIN) +#elif OS(DARWIN) #import #else #include "NotImplemented.h" @@ -39,7 +39,7 @@ namespace WebCore { void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode) { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) // No KeyDown events on Windows to disambiguate. ASSERT_NOT_REACHED(); #else @@ -56,7 +56,7 @@ void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCom } else { m_keyIdentifier = String(); m_windowsVirtualKeyCode = 0; -#if PLATFORM(DARWIN) +#if OS(DARWIN) if (m_text.length() == 1 && (m_text[0U] >= 0xF700 && m_text[0U] <= 0xF7FF)) { // According to NSEvents.h, OpenStep reserves the range 0xF700-0xF8FF for function keys. However, some actual private use characters // happen to be in this range, e.g. the Apple logo (Option+Shift+K). @@ -71,10 +71,10 @@ void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCom bool PlatformKeyboardEvent::currentCapsLockState() { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) // FIXME: Does this even work inside the sandbox? return GetKeyState(VK_CAPITAL) & 1; -#elif PLATFORM(DARWIN) +#elif OS(DARWIN) return GetCurrentKeyModifiers() & alphaLock; #else notImplemented(); diff --git a/WebCore/platform/chromium/PopupMenuChromium.cpp b/WebCore/platform/chromium/PopupMenuChromium.cpp index 7298b27446e..b1f8f3bf65b 100644 --- a/WebCore/platform/chromium/PopupMenuChromium.cpp +++ b/WebCore/platform/chromium/PopupMenuChromium.cpp @@ -1135,7 +1135,7 @@ void PopupListBox::layout() // Calculate scroll bar width. int windowHeight = 0; -#if PLATFORM(DARWIN) +#if OS(DARWIN) // Set the popup's window to contain all available items on Mac only, which // uses native controls that manage their own scrolling. This allows hit // testing to work when selecting items in popups that have more menu entries @@ -1147,7 +1147,7 @@ void PopupListBox::layout() for (int i = 0; i < m_visibleRows; ++i) { int rowHeight = getRowHeight(i); -#if !PLATFORM(DARWIN) +#if !OS(DARWIN) // Only clip the window height for non-Mac platforms. if (windowHeight + rowHeight > kMaxHeight) { m_visibleRows = i; @@ -1225,7 +1225,7 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index) { if (!p.popup) p.popup = PopupContainer::create(client(), dropDownSettings); -#if PLATFORM(DARWIN) +#if OS(DARWIN) p.popup->showExternal(r, v, index); #else p.popup->show(r, v, index); diff --git a/WebCore/platform/graphics/BitmapImage.h b/WebCore/platform/graphics/BitmapImage.h index 614ebaf9a24..a7436722a4c 100644 --- a/WebCore/platform/graphics/BitmapImage.h +++ b/WebCore/platform/graphics/BitmapImage.h @@ -140,7 +140,7 @@ public: virtual CGImageRef getCGImageRef(); #endif -#if PLATFORM(WIN) || (PLATFORM(QT) && PLATFORM(WIN_OS)) +#if PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS)) static PassRefPtr create(HBITMAP); #endif #if PLATFORM(WIN) @@ -169,7 +169,7 @@ protected: #endif virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator); -#if PLATFORM(WX) || (PLATFORM(WINCE) && !PLATFORM(QT)) +#if PLATFORM(WX) || (OS(WINCE) && !PLATFORM(QT)) virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const TransformationMatrix& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect); #endif @@ -236,7 +236,7 @@ protected: checkForSolidColor(); // WINCE PORT: checkForSolidColor() doesn't set m_checkedForSolidColor until // it gets enough information to make final decision. -#if !PLATFORM(WINCE) +#if !OS(WINCE) ASSERT(m_checkedForSolidColor); #endif } diff --git a/WebCore/platform/graphics/FloatPoint.h b/WebCore/platform/graphics/FloatPoint.h index 45a1e832da9..6b037ff86ae 100644 --- a/WebCore/platform/graphics/FloatPoint.h +++ b/WebCore/platform/graphics/FloatPoint.h @@ -36,7 +36,7 @@ typedef struct CGPoint CGPoint; #endif -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES typedef struct CGPoint NSPoint; #else @@ -85,7 +85,7 @@ public: #endif #if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) \ - || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) + || (PLATFORM(CHROMIUM) && OS(DARWIN)) FloatPoint(const NSPoint&); operator NSPoint() const; #endif diff --git a/WebCore/platform/graphics/FloatRect.h b/WebCore/platform/graphics/FloatRect.h index 2dc854df88c..b4772c7742c 100644 --- a/WebCore/platform/graphics/FloatRect.h +++ b/WebCore/platform/graphics/FloatRect.h @@ -33,7 +33,7 @@ typedef struct CGRect CGRect; #endif -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES typedef struct CGRect NSRect; #else @@ -129,7 +129,7 @@ public: #endif #if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) \ - || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) + || (PLATFORM(CHROMIUM) && OS(DARWIN)) FloatRect(const NSRect&); operator NSRect() const; #endif diff --git a/WebCore/platform/graphics/FloatSize.h b/WebCore/platform/graphics/FloatSize.h index 5a84fd1a157..1bc3423a339 100644 --- a/WebCore/platform/graphics/FloatSize.h +++ b/WebCore/platform/graphics/FloatSize.h @@ -34,7 +34,7 @@ typedef struct CGSize CGSize; #endif -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES typedef struct CGSize NSSize; #else @@ -80,7 +80,7 @@ public: #endif #if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) \ - || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) + || (PLATFORM(CHROMIUM) && OS(DARWIN)) explicit FloatSize(const NSSize &); // don't do this implicitly since it's lossy operator NSSize() const; #endif diff --git a/WebCore/platform/graphics/FontCache.cpp b/WebCore/platform/graphics/FontCache.cpp index bb833198da0..2aa68f12ee8 100644 --- a/WebCore/platform/graphics/FontCache.cpp +++ b/WebCore/platform/graphics/FontCache.cpp @@ -139,7 +139,7 @@ static const AtomicString& alternateFamilyName(const AtomicString& familyName) DEFINE_STATIC_LOCAL(AtomicString, courierNew, ("Courier New")); if (equalIgnoringCase(familyName, courier)) return courierNew; -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) // On Windows, Courier New (truetype font) is always present and // Courier is a bitmap font. So, we don't want to map Courier New to // Courier. @@ -163,7 +163,7 @@ static const AtomicString& alternateFamilyName(const AtomicString& familyName) if (equalIgnoringCase(familyName, helvetica)) return arial; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) // On Windows, bitmap fonts are blocked altogether so that we have to // alias MS Sans Serif (bitmap font) -> Microsoft Sans Serif (truetype font) DEFINE_STATIC_LOCAL(AtomicString, msSans, ("MS Sans Serif")); diff --git a/WebCore/platform/graphics/FontCache.h b/WebCore/platform/graphics/FontCache.h index 4a6222bf338..9b41e38cd9f 100644 --- a/WebCore/platform/graphics/FontCache.h +++ b/WebCore/platform/graphics/FontCache.h @@ -64,7 +64,7 @@ public: // Also implemented by the platform. void platformInit(); -#if PLATFORM(WINCE) && !PLATFORM(QT) +#if OS(WINCE) && !PLATFORM(QT) #if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) IMLangFontLink2* getFontLinkInterface(); #else diff --git a/WebCore/platform/graphics/FontFastPath.cpp b/WebCore/platform/graphics/FontFastPath.cpp index dd945e5d316..0c9046c8b07 100644 --- a/WebCore/platform/graphics/FontFastPath.cpp +++ b/WebCore/platform/graphics/FontFastPath.cpp @@ -151,7 +151,7 @@ GlyphData Font::glyphDataForCharacter(UChar32 c, bool mirror, bool forceSmallCap GlyphData data = fallbackPage && fallbackPage->fontDataForCharacter(c) ? fallbackPage->glyphDataForCharacter(c) : characterFontData->missingGlyphData(); // Cache it so we don't have to do system fallback again next time. if (!useSmallCapsFont) { -#if PLATFORM(WINCE) +#if OS(WINCE) // missingGlyphData returns a null character, which is not suitable for GDI to display. // Also, sometimes we cannot map a font for the character on WINCE, but GDI can still // display the character, probably because the font package is not installed correctly. @@ -169,7 +169,7 @@ GlyphData Font::glyphDataForCharacter(UChar32 c, bool mirror, bool forceSmallCap // FIXME: It would be nicer to use the missing glyph from the last resort font instead. GlyphData data = primaryFont()->missingGlyphData(); if (!useSmallCapsFont) { -#if PLATFORM(WINCE) +#if OS(WINCE) // See comment about WINCE GDI handling near setGlyphDataForCharacter above. page->setGlyphDataForCharacter(c, c, data.fontData); return page->glyphDataForCharacter(c); diff --git a/WebCore/platform/graphics/GlyphBuffer.h b/WebCore/platform/graphics/GlyphBuffer.h index 04491a7ce12..edb804cd931 100644 --- a/WebCore/platform/graphics/GlyphBuffer.h +++ b/WebCore/platform/graphics/GlyphBuffer.h @@ -50,7 +50,7 @@ class SimpleFontData; #if PLATFORM(CAIRO) // FIXME: Why does Cairo use such a huge struct instead of just an offset into an array? typedef cairo_glyph_t GlyphBufferGlyph; -#elif PLATFORM(WINCE) +#elif OS(WINCE) typedef wchar_t GlyphBufferGlyph; #else typedef Glyph GlyphBufferGlyph; @@ -60,7 +60,7 @@ typedef Glyph GlyphBufferGlyph; // can be passed directly to CGContextShowGlyphsWithAdvances in FontMac.mm #if PLATFORM(CG) typedef CGSize GlyphBufferAdvance; -#elif PLATFORM(WINCE) +#elif OS(WINCE) // There is no cross-platform code that uses the height of GlyphBufferAdvance, // so we can save memory space on embedded devices by storing only the width typedef float GlyphBufferAdvance; @@ -124,7 +124,7 @@ public: { #if PLATFORM(CG) return m_advances[index].width; -#elif PLATFORM(WINCE) +#elif OS(WINCE) return m_advances[index]; #else return m_advances[index].width(); @@ -156,7 +156,7 @@ public: #if PLATFORM(CG) CGSize advance = { width, 0 }; m_advances.append(advance); -#elif PLATFORM(WINCE) +#elif OS(WINCE) m_advances.append(width); #else m_advances.append(FloatSize(width, 0)); @@ -172,7 +172,7 @@ public: #endif } -#if !PLATFORM(WINCE) +#if !OS(WINCE) void add(Glyph glyph, const SimpleFontData* font, GlyphBufferAdvance advance) { m_fontData.append(font); diff --git a/WebCore/platform/graphics/Gradient.h b/WebCore/platform/graphics/Gradient.h index 0e39e73302d..821b4128a76 100644 --- a/WebCore/platform/graphics/Gradient.h +++ b/WebCore/platform/graphics/Gradient.h @@ -74,7 +74,7 @@ namespace WebCore { void getColor(float value, float* r, float* g, float* b, float* a) const; -#if PLATFORM(WINCE) && !PLATFORM(QT) +#if OS(WINCE) && !PLATFORM(QT) const FloatPoint& p0() const { return m_p0; } const FloatPoint& p1() const { return m_p1; } float r0() const { return m_r0; } diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp index d89bd28d951..652c1cb56fd 100644 --- a/WebCore/platform/graphics/GraphicsContext.cpp +++ b/WebCore/platform/graphics/GraphicsContext.cpp @@ -328,7 +328,7 @@ void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const drawImage(image, styleColorSpace, FloatRect(dest), srcRect, op, useLowQualityScale); } -#if !PLATFORM(WINCE) || PLATFORM(QT) +#if !OS(WINCE) || PLATFORM(QT) void GraphicsContext::drawText(const Font& font, const TextRun& run, const IntPoint& point, int from, int to) { if (paintingDisabled()) diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h index 8fdcaf72d23..88e41e60788 100644 --- a/WebCore/platform/graphics/GraphicsContext.h +++ b/WebCore/platform/graphics/GraphicsContext.h @@ -71,7 +71,7 @@ typedef class PlatformContextSkia PlatformGraphicsContext; class BView; typedef BView PlatformGraphicsContext; struct pattern; -#elif PLATFORM(WINCE) +#elif OS(WINCE) typedef struct HDC__ PlatformGraphicsContext; #else typedef void PlatformGraphicsContext; @@ -96,7 +96,7 @@ typedef unsigned char UInt8; namespace WebCore { -#if PLATFORM(WINCE) && !PLATFORM(QT) +#if OS(WINCE) && !PLATFORM(QT) class SharedBitmap; class SimpleFontData; class GlyphBuffer; @@ -144,7 +144,7 @@ namespace WebCore { GraphicsContext(PlatformGraphicsContext*); ~GraphicsContext(); -#if !PLATFORM(WINCE) || PLATFORM(QT) +#if !OS(WINCE) || PLATFORM(QT) PlatformGraphicsContext* platformContext() const; #endif @@ -299,7 +299,7 @@ namespace WebCore { void concatCTM(const TransformationMatrix&); TransformationMatrix getCTM() const; -#if PLATFORM(WINCE) && !PLATFORM(QT) +#if OS(WINCE) && !PLATFORM(QT) void setBitmap(PassRefPtr); const TransformationMatrix& affineTransform() const; TransformationMatrix& affineTransform(); @@ -357,7 +357,7 @@ namespace WebCore { void drawWindowsBitmap(WindowsBitmap*, const IntPoint&); #endif -#if (PLATFORM(QT) && defined(Q_WS_WIN)) || (PLATFORM(WX) && PLATFORM(WIN_OS)) +#if (PLATFORM(QT) && defined(Q_WS_WIN)) || (PLATFORM(WX) && OS(WINDOWS)) HDC getWindowsContext(const IntRect&, bool supportAlphaBlend = true, bool mayCreateBitmap = true); void releaseWindowsContext(HDC, const IntRect&, bool supportAlphaBlend = true, bool mayCreateBitmap = true); bool shouldIncludeChildWindows() const { return false; } diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h index aad8dd40735..94629b2a011 100644 --- a/WebCore/platform/graphics/GraphicsContext3D.h +++ b/WebCore/platform/graphics/GraphicsContext3D.h @@ -33,7 +33,7 @@ #include // FIXME: Find a better way to avoid the name confliction for NO_ERROR. -#if PLATFORM(CHROMIUM) && PLATFORM(WIN_OS) +#if PLATFORM(CHROMIUM) && OS(WINDOWS) #undef NO_ERROR #endif diff --git a/WebCore/platform/graphics/ImageSource.h b/WebCore/platform/graphics/ImageSource.h index 3559abe9518..258fd0f6959 100644 --- a/WebCore/platform/graphics/ImageSource.h +++ b/WebCore/platform/graphics/ImageSource.h @@ -49,7 +49,7 @@ typedef struct _cairo_surface cairo_surface_t; class NativeImageSkia; #elif PLATFORM(HAIKU) class BBitmap; -#elif PLATFORM(WINCE) +#elif OS(WINCE) #include "SharedBitmap.h" #endif @@ -81,7 +81,7 @@ typedef cairo_surface_t* NativeImagePtr; typedef NativeImageSkia* NativeImagePtr; #elif PLATFORM(HAIKU) typedef BBitmap* NativeImagePtr; -#elif PLATFORM(WINCE) +#elif OS(WINCE) typedef RefPtr NativeImagePtr; #endif #endif diff --git a/WebCore/platform/graphics/IntRect.h b/WebCore/platform/graphics/IntRect.h index 34f7fd85775..e3633dfefde 100644 --- a/WebCore/platform/graphics/IntRect.h +++ b/WebCore/platform/graphics/IntRect.h @@ -34,7 +34,7 @@ typedef struct CGRect CGRect; #endif -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES typedef struct CGRect NSRect; #else @@ -163,7 +163,7 @@ public: #endif #if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) \ - || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) + || (PLATFORM(CHROMIUM) && OS(DARWIN)) operator NSRect() const; #endif @@ -203,7 +203,7 @@ IntRect enclosingIntRect(const CGRect&); #endif #if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) \ - || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) + || (PLATFORM(CHROMIUM) && OS(DARWIN)) IntRect enclosingIntRect(const NSRect&); #endif diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp index 78d766378d1..b37351dac91 100644 --- a/WebCore/platform/graphics/MediaPlayer.cpp +++ b/WebCore/platform/graphics/MediaPlayer.cpp @@ -39,7 +39,7 @@ #if PLATFORM(MAC) #include "MediaPlayerPrivateQTKit.h" -#elif PLATFORM(WINCE) && !PLATFORM(QT) +#elif OS(WINCE) && !PLATFORM(QT) #include "MediaPlayerPrivateWince.h" #elif PLATFORM(WIN) #include "MediaPlayerPrivateQuickTimeWin.h" diff --git a/WebCore/platform/graphics/Path.h b/WebCore/platform/graphics/Path.h index 6618fb7a7d0..bf4cd9d8381 100644 --- a/WebCore/platform/graphics/Path.h +++ b/WebCore/platform/graphics/Path.h @@ -53,7 +53,7 @@ typedef SkPath PlatformPath; #elif PLATFORM(HAIKU) class BRegion; typedef BRegion PlatformPath; -#elif PLATFORM(WINCE) +#elif OS(WINCE) namespace WebCore { class PlatformPath; } diff --git a/WebCore/platform/graphics/Pattern.h b/WebCore/platform/graphics/Pattern.h index aa0a3570276..f7f612abd03 100644 --- a/WebCore/platform/graphics/Pattern.h +++ b/WebCore/platform/graphics/Pattern.h @@ -56,7 +56,7 @@ typedef wxBrush* PlatformPatternPtr; #elif PLATFORM(HAIKU) #include typedef pattern* PlatformPatternPtr; -#elif PLATFORM(WINCE) +#elif OS(WINCE) typedef void* PlatformPatternPtr; #endif diff --git a/WebCore/platform/graphics/SimpleFontData.h b/WebCore/platform/graphics/SimpleFontData.h index 7d787566ee1..1a388bed7f0 100644 --- a/WebCore/platform/graphics/SimpleFontData.h +++ b/WebCore/platform/graphics/SimpleFontData.h @@ -35,7 +35,7 @@ typedef struct OpaqueATSUStyle* ATSUStyle; #endif -#if PLATFORM(WIN) && !PLATFORM(WINCE) +#if PLATFORM(WIN) && !OS(WINCE) #include #endif @@ -115,7 +115,7 @@ public: virtual String description() const; #endif -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) NSFont* getNSFont() const { return m_platformData.font(); } #endif @@ -140,7 +140,7 @@ public: #if PLATFORM(WIN) bool isSystemFont() const { return m_isSystemFont; } -#if !PLATFORM(WINCE) // disable unused members to save space +#if !OS(WINCE) // disable unused members to save space SCRIPT_FONTPROPERTIES* scriptFontProperties() const; SCRIPT_CACHE* scriptCache() const { return &m_scriptCache; } #endif @@ -162,7 +162,7 @@ private: void commonInit(); -#if PLATFORM(WIN) && !PLATFORM(WINCE) +#if PLATFORM(WIN) && !OS(WINCE) void initGDIFont(); void platformCommonDestroy(); float widthForGDIGlyph(Glyph glyph) const; @@ -227,7 +227,7 @@ private: #if PLATFORM(WIN) bool m_isSystemFont; -#if !PLATFORM(WINCE) // disable unused members to save space +#if !OS(WINCE) // disable unused members to save space mutable SCRIPT_CACHE m_scriptCache; mutable SCRIPT_FONTPROPERTIES* m_scriptFontProperties; #endif diff --git a/WebCore/platform/graphics/cg/ColorCG.cpp b/WebCore/platform/graphics/cg/ColorCG.cpp index 40aacc5c3ac..e514fa358a3 100644 --- a/WebCore/platform/graphics/cg/ColorCG.cpp +++ b/WebCore/platform/graphics/cg/ColorCG.cpp @@ -68,7 +68,7 @@ Color::Color(CGColorRef color) m_color = makeRGBA(r * 255, g * 255, b * 255, a * 255); } -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) CGColorRef createCGColor(const Color& c) { @@ -89,7 +89,7 @@ CGColorRef createCGColor(const Color& c) return color; } -#endif // PLATFORM(WIN_OS) +#endif // OS(WINDOWS) } diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp index 39f06a62382..19bc2c25644 100644 --- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp +++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp @@ -43,7 +43,7 @@ #include #include -#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) +#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) // Building on 10.6 or later: kCGInterpolationMedium is defined in the CGInterpolationQuality enum. diff --git a/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp b/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp index a902057fe43..6432e171eb1 100644 --- a/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp +++ b/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp @@ -32,11 +32,11 @@ #include "config.h" #include "FontCustomPlatformData.h" -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include "Base64.h" #include "ChromiumBridge.h" #include "OpenTypeUtilities.h" -#elif PLATFORM(LINUX) +#elif OS(LINUX) #include "SkStream.h" #endif @@ -45,9 +45,9 @@ #include "OpenTypeSanitizer.h" #include "SharedBuffer.h" -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include -#elif PLATFORM(LINUX) +#elif OS(LINUX) #include #endif @@ -55,10 +55,10 @@ namespace WebCore { FontCustomPlatformData::~FontCustomPlatformData() { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) if (m_fontReference) RemoveFontMemResourceEx(m_fontReference); -#elif PLATFORM(LINUX) +#elif OS(LINUX) if (m_fontReference) m_fontReference->unref(); #endif @@ -66,7 +66,7 @@ FontCustomPlatformData::~FontCustomPlatformData() FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode mode) { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) ASSERT(m_fontReference); LOGFONT logFont; @@ -99,7 +99,7 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, b HFONT hfont = CreateFontIndirect(&logFont); return FontPlatformData(hfont, size); -#elif PLATFORM(LINUX) +#elif OS(LINUX) ASSERT(m_fontReference); return FontPlatformData(m_fontReference, size, bold && !m_fontReference->isBold(), italic && !m_fontReference->isItalic()); #else @@ -108,7 +108,7 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, b #endif } -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) // Creates a unique and unpredictable font name, in order to avoid collisions and to // not allow access from CSS. static String createUniqueFontName() @@ -123,7 +123,7 @@ static String createUniqueFontName() } #endif -#if PLATFORM(LINUX) +#if OS(LINUX) class RemoteFontStream : public SkStream { public: explicit RemoteFontStream(PassRefPtr buffer) @@ -180,7 +180,7 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer) buffer = transcodeBuffer.get(); #endif -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) // Introduce the font to GDI. AddFontMemResourceEx should be used with care, because it will pollute the process's // font namespace (Windows has no API for creating an HFONT from data without exposing the font to the // entire process first). @@ -189,7 +189,7 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer) if (!fontReference) return 0; return new FontCustomPlatformData(fontReference, fontName); -#elif PLATFORM(LINUX) +#elif OS(LINUX) RemoteFontStream* stream = new RemoteFontStream(buffer); SkTypeface* typeface = SkTypeface::CreateFromStream(stream); if (!typeface) diff --git a/WebCore/platform/graphics/chromium/FontCustomPlatformData.h b/WebCore/platform/graphics/chromium/FontCustomPlatformData.h index a42f1ecad0e..e1fbd483176 100644 --- a/WebCore/platform/graphics/chromium/FontCustomPlatformData.h +++ b/WebCore/platform/graphics/chromium/FontCustomPlatformData.h @@ -35,10 +35,10 @@ #include "FontRenderingMode.h" #include -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include "PlatformString.h" #include -#elif PLATFORM(LINUX) +#elif OS(LINUX) #include "SkTypeface.h" #endif @@ -48,12 +48,12 @@ class FontPlatformData; class SharedBuffer; struct FontCustomPlatformData : Noncopyable { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) FontCustomPlatformData(HANDLE fontReference, const String& name) : m_fontReference(fontReference) , m_name(name) {} -#elif PLATFORM(LINUX) +#elif OS(LINUX) explicit FontCustomPlatformData(SkTypeface* typeface) : m_fontReference(typeface) {} @@ -64,10 +64,10 @@ struct FontCustomPlatformData : Noncopyable { FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) HANDLE m_fontReference; String m_name; -#elif PLATFORM(LINUX) +#elif OS(LINUX) SkTypeface* m_fontReference; #endif }; diff --git a/WebCore/platform/graphics/chromium/FontPlatformData.h b/WebCore/platform/graphics/chromium/FontPlatformData.h index c6f19126e11..871fec8e9e2 100644 --- a/WebCore/platform/graphics/chromium/FontPlatformData.h +++ b/WebCore/platform/graphics/chromium/FontPlatformData.h @@ -31,9 +31,9 @@ #ifndef FontPlatformData_h #define FontPlatformData_h -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include "FontPlatformDataChromiumWin.h" -#elif defined(__linux__) +#elif OS(LINUX) #include "FontPlatformDataLinux.h" #endif diff --git a/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp b/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp index 3a6016072b3..12ae09d931d 100644 --- a/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp +++ b/WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp @@ -401,7 +401,7 @@ static size_t renameFontInternal(SharedBuffer* fontData, const String& fontName, return nameTableSize; } -#if PLATFORM(WINCE) +#if OS(WINCE) // AddFontMemResourceEx does not exist on WinCE, so we must handle the font data manually // This function just renames the font and overwrites the old font data with the new bool renameFont(SharedBuffer* fontData, const String& fontName) diff --git a/WebCore/platform/graphics/opentype/OpenTypeUtilities.h b/WebCore/platform/graphics/opentype/OpenTypeUtilities.h index 4c753142ce2..0ef1b2b92b3 100644 --- a/WebCore/platform/graphics/opentype/OpenTypeUtilities.h +++ b/WebCore/platform/graphics/opentype/OpenTypeUtilities.h @@ -36,7 +36,7 @@ struct BigEndianUShort; struct EOTPrefix; class SharedBuffer; -#if PLATFORM(WINCE) +#if OS(WINCE) typedef unsigned __int8 UInt8; #endif diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index 49d7a27b201..ae31d4c7c57 100644 --- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -1292,7 +1292,7 @@ HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlpha memset(bmpInfo.bmBits, 0, bufferSize); } -#if !PLATFORM(WINCE) +#if !OS(WINCE) // Make sure we can do world transforms. SetGraphicsMode(bitmapDC, GM_ADVANCED); diff --git a/WebCore/platform/graphics/qt/ImageQt.cpp b/WebCore/platform/graphics/qt/ImageQt.cpp index 9a82911ba74..fea14485748 100644 --- a/WebCore/platform/graphics/qt/ImageQt.cpp +++ b/WebCore/platform/graphics/qt/ImageQt.cpp @@ -213,7 +213,7 @@ void BitmapImage::checkForSolidColor() m_solidColor = QColor::fromRgba(framePixmap->toImage().pixel(0, 0)); } -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) PassRefPtr BitmapImage::create(HBITMAP hBitmap) { return BitmapImage::create(new QPixmap(QPixmap::fromWinHBITMAP(hBitmap))); diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp index 877da89a4af..81fad7b93f3 100644 --- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp +++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp @@ -431,7 +431,7 @@ void GraphicsContext::clipToImageBuffer(const FloatRect& rect, if (paintingDisabled()) return; -#if defined(__linux__) || PLATFORM(WIN_OS) +#if OS(LINUX) || OS(WINDOWS) platformContext()->beginLayerClippedToImage(rect, imageBuffer); #endif } diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp index c36f1ced67d..4ea3d7addd2 100644 --- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp +++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp @@ -66,7 +66,7 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b m_data.m_platformContext.setCanvas(&m_data.m_canvas); m_context.set(new GraphicsContext(&m_data.m_platformContext)); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) m_context->platformContext()->setDrawingToImageBuffer(true); #endif diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp index 4900dfb10ca..92a187097ff 100644 --- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp +++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp @@ -89,7 +89,7 @@ struct PlatformContextSkia::State { // color to produce a new output color. SkColor applyAlpha(SkColor) const; -#if defined(__linux__) || PLATFORM(WIN_OS) +#if OS(LINUX) || OS(WINDOWS) // If non-empty, the current State is clipped to this image. SkBitmap m_imageBufferClip; // If m_imageBufferClip is non-empty, this is the region the image is clipped to. @@ -143,7 +143,7 @@ PlatformContextSkia::State::State(const State& other) , m_lineJoin(other.m_lineJoin) , m_dash(other.m_dash) , m_textDrawingMode(other.m_textDrawingMode) -#if defined(__linux__) || PLATFORM(WIN_OS) +#if OS(LINUX) || OS(WINDOWS) , m_imageBufferClip(other.m_imageBufferClip) , m_clip(other.m_clip) #endif @@ -180,7 +180,7 @@ SkColor PlatformContextSkia::State::applyAlpha(SkColor c) const // Danger: canvas can be NULL. PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas) : m_canvas(canvas) -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) , m_drawingToImageBuffer(false) #endif { @@ -197,7 +197,7 @@ void PlatformContextSkia::setCanvas(skia::PlatformCanvas* canvas) m_canvas = canvas; } -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) void PlatformContextSkia::setDrawingToImageBuffer(bool value) { m_drawingToImageBuffer = value; @@ -214,7 +214,7 @@ void PlatformContextSkia::save() m_stateStack.append(*m_state); m_state = &m_stateStack.last(); -#if defined(__linux__) || PLATFORM(WIN_OS) +#if OS(LINUX) || OS(WINDOWS) // The clip image only needs to be applied once. Reset the image so that we // don't attempt to clip multiple times. m_state->m_imageBufferClip.reset(); @@ -224,7 +224,7 @@ void PlatformContextSkia::save() canvas()->save(); } -#if defined(__linux__) || PLATFORM(WIN_OS) +#if OS(LINUX) || OS(WINDOWS) void PlatformContextSkia::beginLayerClippedToImage(const WebCore::FloatRect& rect, const WebCore::ImageBuffer* imageBuffer) { @@ -272,7 +272,7 @@ void PlatformContextSkia::clipPathAntiAliased(const SkPath& clipPath) void PlatformContextSkia::restore() { -#if defined(__linux__) || PLATFORM(WIN_OS) +#if OS(LINUX) || OS(WINDOWS) if (!m_state->m_imageBufferClip.empty()) { applyClipFromImage(m_state->m_clip, m_state->m_imageBufferClip); canvas()->restore(); @@ -575,7 +575,7 @@ bool PlatformContextSkia::isPrinting() return m_canvas->getTopPlatformDevice().IsVectorial(); } -#if defined(__linux__) || PLATFORM(WIN_OS) +#if OS(LINUX) || OS(WINDOWS) void PlatformContextSkia::applyClipFromImage(const WebCore::FloatRect& rect, const SkBitmap& imageBuffer) { // NOTE: this assumes the image mask contains opaque black for the portions that are to be shown, as such we diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h index 53590bf6af1..e44526212ff 100644 --- a/WebCore/platform/graphics/skia/PlatformContextSkia.h +++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h @@ -71,7 +71,7 @@ public: // to the constructor. void setCanvas(skia::PlatformCanvas*); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) // If false we're rendering to a GraphicsContext for a web page, if false // we're not (as is the case when rendering to a canvas object). // If this is true the contents have not been marked up with the magic @@ -88,7 +88,7 @@ public: // |rect|. This layer is implicitly restored when the next restore is // invoked. // NOTE: |imageBuffer| may be deleted before the |restore| is invoked. -#if defined(__linux__) || PLATFORM(WIN_OS) +#if OS(LINUX) || OS(WINDOWS) void beginLayerClippedToImage(const WebCore::FloatRect&, const WebCore::ImageBuffer*); #endif @@ -168,7 +168,7 @@ public: bool isPrinting(); private: -#if defined(__linux__) || PLATFORM(WIN_OS) +#if OS(LINUX) || OS(WINDOWS) // Used when restoring and the state has an image clip. Only shows the pixels in // m_canvas that are also in imageBuffer. void applyClipFromImage(const WebCore::FloatRect&, const SkBitmap&); @@ -191,7 +191,7 @@ private: // Current path in global coordinates. SkPath m_path; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) bool m_drawingToImageBuffer; #endif }; diff --git a/WebCore/platform/graphics/win/IconWin.cpp b/WebCore/platform/graphics/win/IconWin.cpp index d71ca001f24..56b46de42f2 100644 --- a/WebCore/platform/graphics/win/IconWin.cpp +++ b/WebCore/platform/graphics/win/IconWin.cpp @@ -27,7 +27,7 @@ #include #include -#if PLATFORM(WINCE) +#if OS(WINCE) // SHGFI_SHELLICONSIZE is not available on WINCE #define SHGFI_SHELLICONSIZE 0 #endif @@ -63,7 +63,7 @@ PassRefPtr Icon::createIconForFiles(const Vector& filenames) return adoptRef(new Icon(sfi.hIcon)); } -#if PLATFORM(WINCE) +#if OS(WINCE) return 0; #else TCHAR buffer[MAX_PATH]; @@ -86,7 +86,7 @@ void Icon::paint(GraphicsContext* context, const IntRect& r) if (context->paintingDisabled()) return; -#if PLATFORM(WINCE) +#if OS(WINCE) context->drawIcon(m_hIcon, r, DI_NORMAL); #else HDC hdc = context->getWindowsContext(r); diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp index 6e67e68e1ba..f5dfe00194d 100644 --- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp +++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp @@ -566,7 +566,7 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness notImplemented(); } -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap) { if (dstRect.isEmpty()) diff --git a/WebCore/platform/gtk/FileSystemGtk.cpp b/WebCore/platform/gtk/FileSystemGtk.cpp index fcdc8634d23..b8bbd6088bc 100644 --- a/WebCore/platform/gtk/FileSystemGtk.cpp +++ b/WebCore/platform/gtk/FileSystemGtk.cpp @@ -42,7 +42,7 @@ String filenameToString(const char* filename) if (!filename) return String(); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) return String::fromUTF8(filename); #else gchar* escapedString = g_uri_escape_string(filename, "/:", false); @@ -54,7 +54,7 @@ String filenameToString(const char* filename) char* filenameFromString(const String& string) { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) return g_strdup(string.utf8().data()); #else return g_uri_unescape_string(string.utf8().data(), 0); @@ -64,7 +64,7 @@ char* filenameFromString(const String& string) // Converts a string to something suitable to be displayed to the user. String filenameForDisplay(const String& string) { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) return string; #else gchar* filename = filenameFromString(string); diff --git a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp index 9ae03fc5ff1..9691c381f41 100644 --- a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp +++ b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp @@ -41,7 +41,7 @@ #include "JPEGImageDecoder.h" #include // Needed by jpeglib.h for FILE. -#if PLATFORM(WINCE) +#if OS(WINCE) // Remove warning: 'FAR' macro redefinition #undef FAR diff --git a/WebCore/platform/network/curl/ResourceHandleManager.cpp b/WebCore/platform/network/curl/ResourceHandleManager.cpp index 74edfeffbf2..bcae67ff531 100644 --- a/WebCore/platform/network/curl/ResourceHandleManager.cpp +++ b/WebCore/platform/network/curl/ResourceHandleManager.cpp @@ -49,7 +49,7 @@ #include #include -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) #include #define MAX_PATH MAXPATHLEN #endif diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp index 5a229b84ce5..da16f4a7e18 100644 --- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp +++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp @@ -876,7 +876,7 @@ static bool startGio(ResourceHandle* handle, KURL url) url.setQuery(String()); url.removePort(); -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) // we avoid the escaping for local files, because // g_filename_from_uri (used internally by GFile) has problems // decoding strings with arbitrary percent signs diff --git a/WebCore/platform/text/String.cpp b/WebCore/platform/text/String.cpp index 8342b0bdfb9..04b04ab60a7 100644 --- a/WebCore/platform/text/String.cpp +++ b/WebCore/platform/text/String.cpp @@ -354,7 +354,7 @@ String String::format(const char *format, ...) return buffer; -#elif PLATFORM(WINCE) +#elif OS(WINCE) va_list args; va_start(args, format); @@ -446,7 +446,7 @@ String String::number(unsigned long n) String String::number(long long n) { -#if PLATFORM(WIN_OS) && !PLATFORM(QT) +#if OS(WINDOWS) && !PLATFORM(QT) return String::format("%I64i", n); #else return String::format("%lli", n); @@ -455,7 +455,7 @@ String String::number(long long n) String String::number(unsigned long long n) { -#if PLATFORM(WIN_OS) && !PLATFORM(QT) +#if OS(WINDOWS) && !PLATFORM(QT) return String::format("%I64u", n); #else return String::format("%llu", n); diff --git a/WebCore/platform/text/TextEncoding.cpp b/WebCore/platform/text/TextEncoding.cpp index ec9a8b04623..4a30d621fe8 100644 --- a/WebCore/platform/text/TextEncoding.cpp +++ b/WebCore/platform/text/TextEncoding.cpp @@ -129,7 +129,7 @@ CString TextEncoding::encode(const UChar* characters, size_t length, Unencodable UTF16Normalized.set(g_utf8_to_utf16(UTF8Normalized.get(), -1, 0, &UTF16Length, 0)); return newTextCodec(*this)->encode(UTF16Normalized.get(), UTF16Length, handling); -#elif PLATFORM(WINCE) +#elif OS(WINCE) // normalization will be done by Windows CE API OwnPtr textCodec = newTextCodec(*this); return textCodec.get() ? textCodec->encode(characters, length, handling) : CString(); diff --git a/WebCore/platform/text/TextEncodingRegistry.cpp b/WebCore/platform/text/TextEncodingRegistry.cpp index a4be5202227..00ad2c9853e 100644 --- a/WebCore/platform/text/TextEncodingRegistry.cpp +++ b/WebCore/platform/text/TextEncodingRegistry.cpp @@ -51,7 +51,7 @@ #if USE(GLIB_UNICODE) #include "gtk/TextCodecGtk.h" #endif -#if PLATFORM(WINCE) && !PLATFORM(QT) +#if OS(WINCE) && !PLATFORM(QT) #include "TextCodecWince.h" #endif @@ -230,7 +230,7 @@ static void buildBaseTextCodecMaps() TextCodecGtk::registerBaseCodecs(addToTextCodecMap); #endif -#if PLATFORM(WINCE) && !PLATFORM(QT) +#if OS(WINCE) && !PLATFORM(QT) TextCodecWince::registerBaseEncodingNames(addToTextEncodingNameMap); TextCodecWince::registerBaseCodecs(addToTextCodecMap); #endif @@ -258,7 +258,7 @@ static void extendTextCodecMaps() TextCodecGtk::registerExtendedCodecs(addToTextCodecMap); #endif -#if PLATFORM(WINCE) && !PLATFORM(QT) +#if OS(WINCE) && !PLATFORM(QT) TextCodecWince::registerExtendedEncodingNames(addToTextEncodingNameMap); TextCodecWince::registerExtendedCodecs(addToTextCodecMap); #endif diff --git a/WebCore/platform/text/TextStream.cpp b/WebCore/platform/text/TextStream.cpp index eb4bae7b689..57c132859af 100644 --- a/WebCore/platform/text/TextStream.cpp +++ b/WebCore/platform/text/TextStream.cpp @@ -101,7 +101,7 @@ String TextStream::release() return String::adopt(m_text); } -#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) TextStream& TextStream::operator<<(__int64 i) { char buffer[printBufferSize]; diff --git a/WebCore/platform/text/TextStream.h b/WebCore/platform/text/TextStream.h index 71034f3b9de..b6bcea8fd9e 100644 --- a/WebCore/platform/text/TextStream.h +++ b/WebCore/platform/text/TextStream.h @@ -44,7 +44,7 @@ public: TextStream& operator<<(double); TextStream& operator<<(const char*); TextStream& operator<<(const String&); -#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) TextStream& operator<<(unsigned __int64); TextStream& operator<<(__int64); #endif diff --git a/WebCore/platform/text/qt/TextCodecQt.cpp b/WebCore/platform/text/qt/TextCodecQt.cpp index b3f75ccd209..21e6e12b692 100644 --- a/WebCore/platform/text/qt/TextCodecQt.cpp +++ b/WebCore/platform/text/qt/TextCodecQt.cpp @@ -97,7 +97,7 @@ String TextCodecQt::decode(const char* bytes, size_t length, bool flush, bool /* // We chop input buffer to smaller buffers to avoid excessive memory consumption // when the input buffer is big. This helps reduce peak memory consumption in // mobile devices where system RAM is limited. -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) static const int MaxInputChunkSize = 32 * 1024; #else static const int MaxInputChunkSize = 1024 * 1024; diff --git a/WebCore/platform/win/PlatformMouseEventWin.cpp b/WebCore/platform/win/PlatformMouseEventWin.cpp index dc4dd2fcec4..8b542f90ca4 100644 --- a/WebCore/platform/win/PlatformMouseEventWin.cpp +++ b/WebCore/platform/win/PlatformMouseEventWin.cpp @@ -65,7 +65,7 @@ static MouseEventType messageToEventType(UINT message) case WM_MBUTTONUP: return MouseEventReleased; -#if !PLATFORM(WINCE) +#if !OS(WINCE) case WM_MOUSELEAVE: #endif case WM_MOUSEMOVE: @@ -108,7 +108,7 @@ PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, UINT message, WPARAM wParam, L m_button = MiddleButton; break; case WM_MOUSEMOVE: -#if !PLATFORM(WINCE) +#if !OS(WINCE) case WM_MOUSELEAVE: #endif if (wParam & MK_LBUTTON) diff --git a/WebCore/platform/win/PlatformScreenWin.cpp b/WebCore/platform/win/PlatformScreenWin.cpp index 8a0d7795516..4af9e17f50d 100644 --- a/WebCore/platform/win/PlatformScreenWin.cpp +++ b/WebCore/platform/win/PlatformScreenWin.cpp @@ -54,7 +54,7 @@ static DEVMODE deviceInfoForWidget(Widget* widget) DEVMODE deviceInfo; deviceInfo.dmSize = sizeof(DEVMODE); deviceInfo.dmDriverExtra = 0; -#if PLATFORM(WINCE) +#if OS(WINCE) if (!EnumDisplaySettings(0, ENUM_CURRENT_SETTINGS, &deviceInfo)) deviceInfo.dmBitsPerPel = 16; #else @@ -80,7 +80,7 @@ int screenDepthPerComponent(Widget* widget) bool screenIsMonochrome(Widget* widget) { -#if PLATFORM(WINCE) +#if OS(WINCE) // EnumDisplaySettings doesn't set dmColor in DEVMODE. return false; #else diff --git a/WebCore/platform/win/PopupMenuWin.cpp b/WebCore/platform/win/PopupMenuWin.cpp index f3b0ba8f57b..0a8e8e82cfa 100644 --- a/WebCore/platform/win/PopupMenuWin.cpp +++ b/WebCore/platform/win/PopupMenuWin.cpp @@ -42,7 +42,7 @@ #include #include #include -#if PLATFORM(WINCE) +#if OS(WINCE) #include #define MAKEPOINTS(l) (*((POINTS FAR *)&(l))) #endif @@ -152,7 +152,7 @@ void PopupMenu::show(const IntRect& r, FrameView* view, int index) // Determine whether we should animate our popups // Note: Must use 'BOOL' and 'FALSE' instead of 'bool' and 'false' to avoid stack corruption with SystemParametersInfo BOOL shouldAnimate = FALSE; -#if !PLATFORM(WINCE) +#if !OS(WINCE) ::SystemParametersInfo(SPI_GETCOMBOBOXANIMATION, 0, &shouldAnimate, 0); if (shouldAnimate) { @@ -579,7 +579,7 @@ void PopupMenu::paint(const IntRect& damageRect, HDC hdc) } } if (!m_bmp) { -#if PLATFORM(WINCE) +#if OS(WINCE) BitmapInfo bitmapInfo(true, clientRect().width(), clientRect().height()); #else BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(clientRect().size()); @@ -714,7 +714,7 @@ void PopupMenu::registerClass() if (haveRegisteredWindowClass) return; -#if PLATFORM(WINCE) +#if OS(WINCE) WNDCLASS wcex; #else WNDCLASSEX wcex; @@ -735,7 +735,7 @@ void PopupMenu::registerClass() haveRegisteredWindowClass = true; -#if PLATFORM(WINCE) +#if OS(WINCE) RegisterClass(&wcex); #else RegisterClassEx(&wcex); @@ -745,7 +745,7 @@ void PopupMenu::registerClass() LRESULT CALLBACK PopupMenu::PopupMenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { -#if PLATFORM(WINCE) +#if OS(WINCE) LONG longPtr = GetWindowLong(hWnd, 0); #else LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0); @@ -758,7 +758,7 @@ LRESULT CALLBACK PopupMenu::PopupMenuWndProc(HWND hWnd, UINT message, WPARAM wPa LPCREATESTRUCT createStruct = reinterpret_cast(lParam); // Associate the PopupMenu with the window. -#if PLATFORM(WINCE) +#if OS(WINCE) ::SetWindowLong(hWnd, 0, (LONG)createStruct->lpCreateParams); #else ::SetWindowLongPtr(hWnd, 0, (LONG_PTR)createStruct->lpCreateParams); @@ -892,7 +892,7 @@ LRESULT PopupMenu::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam } BOOL shouldHotTrack = FALSE; -#if !PLATFORM(WINCE) +#if !OS(WINCE) ::SystemParametersInfo(SPI_GETHOTTRACKING, 0, &shouldHotTrack, 0); #endif @@ -989,7 +989,7 @@ LRESULT PopupMenu::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam lResult = 0; break; } -#if !PLATFORM(WINCE) +#if !OS(WINCE) case WM_PRINTCLIENT: paint(clientRect(), (HDC)wParam); break; diff --git a/WebCore/platform/win/SystemTimeWin.cpp b/WebCore/platform/win/SystemTimeWin.cpp index 6ab4c27cfd2..8c25c3291ad 100644 --- a/WebCore/platform/win/SystemTimeWin.cpp +++ b/WebCore/platform/win/SystemTimeWin.cpp @@ -37,7 +37,7 @@ namespace WebCore { float userIdleTime() { -#if !PLATFORM(WINCE) +#if !OS(WINCE) LASTINPUTINFO lastInputInfo = {0}; lastInputInfo.cbSize = sizeof(LASTINPUTINFO); if (::GetLastInputInfo(&lastInputInfo)) diff --git a/WebCore/platform/wx/FileSystemWx.cpp b/WebCore/platform/wx/FileSystemWx.cpp index 1ee87ae4266..50ac2ec5c92 100644 --- a/WebCore/platform/wx/FileSystemWx.cpp +++ b/WebCore/platform/wx/FileSystemWx.cpp @@ -42,7 +42,7 @@ #include #include -#if PLATFORM(DARWIN) +#if OS(DARWIN) #include #endif @@ -127,9 +127,9 @@ int writeToFile(PlatformFileHandle, const char* data, int length) bool unloadModule(PlatformModule mod) { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) return ::FreeLibrary(mod); -#elif PLATFORM(DARWIN) +#elif OS(DARWIN) CFRelease(mod); return true; #else diff --git a/WebCore/plugins/PluginDatabase.cpp b/WebCore/plugins/PluginDatabase.cpp index fc8cef2c245..5385b79eb76 100644 --- a/WebCore/plugins/PluginDatabase.cpp +++ b/WebCore/plugins/PluginDatabase.cpp @@ -320,7 +320,7 @@ void PluginDatabase::clear() m_preferredPlugins.clear(); } -#if (!PLATFORM(WINCE)) && (!PLATFORM(SYMBIAN)) && (!PLATFORM(WIN_OS) || !ENABLE(NETSCAPE_PLUGIN_API)) +#if (!OS(WINCE)) && (!OS(SYMBIAN)) && (!OS(WINDOWS) || !ENABLE(NETSCAPE_PLUGIN_API)) // For Safari/Win the following three methods are implemented // in PluginDatabaseWin.cpp, but if we can use WebCore constructs // for the logic we should perhaps move it here under XP_WIN? @@ -428,6 +428,6 @@ void PluginDatabase::getPluginPathsInDirectories(HashSet& paths) const } } -#endif // !PLATFORM(SYMBIAN) && !PLATFORM(WIN_OS) +#endif // !OS(SYMBIAN) && !OS(WINDOWS) } diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp index 8f2dfa990b3..250f025576a 100644 --- a/WebCore/plugins/PluginPackage.cpp +++ b/WebCore/plugins/PluginPackage.cpp @@ -113,7 +113,7 @@ PluginPackage::PluginPackage(const String& path, const time_t& lastModified) m_parentDirectory = m_path.left(m_path.length() - m_fileName.length() - 1); } -#if !PLATFORM(SYMBIAN) +#if !OS(SYMBIAN) void PluginPackage::unload() { if (!m_isLoaded) @@ -126,7 +126,7 @@ void PluginPackage::unload() unloadWithoutShutdown(); } -#endif //!PLATFORM(SYMBIAN) +#endif //!OS(SYMBIAN) void PluginPackage::unloadWithoutShutdown() { @@ -198,7 +198,7 @@ void PluginPackage::determineQuirks(const String& mimeType) } #endif -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) void PluginPackage::determineModuleVersionFromDescription() { // It's a bit lame to detect the plugin version by parsing it @@ -326,7 +326,7 @@ int PluginPackage::compareFileVersion(const PlatformModuleVersion& compareVersio // return -1, 0, or 1 if plug-in version is less than, equal to, or greater than // the passed version -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) if (m_moduleVersion.mostSig != compareVersion.mostSig) return m_moduleVersion.mostSig > compareVersion.mostSig ? 1 : -1; if (m_moduleVersion.leastSig != compareVersion.leastSig) diff --git a/WebCore/plugins/PluginPackage.h b/WebCore/plugins/PluginPackage.h index d409ab60b88..a3937f16090 100644 --- a/WebCore/plugins/PluginPackage.h +++ b/WebCore/plugins/PluginPackage.h @@ -36,7 +36,7 @@ #include #include -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) class QPluginLoader; class NPInterface; #endif @@ -75,17 +75,17 @@ namespace WebCore { int compare(const PluginPackage&) const; PluginQuirkSet quirks() const { return m_quirks; } const PlatformModuleVersion& version() const { return m_moduleVersion; } -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) NPInterface* npInterface() const { return m_npInterface; } -#endif // PLATFORM(SYMBIAN) +#endif // OS(SYMBIAN) private: PluginPackage(const String& path, const time_t& lastModified); -#if PLATFORM(SYMBIAN) +#if OS(SYMBIAN) NPInterface* m_npInterface; QPluginLoader* m_pluginLoader; -#endif // PLATFORM(SYMBIAN) +#endif // OS(SYMBIAN) bool fetchInfo(); bool isPluginBlacklisted(); void determineQuirks(const String& mimeType); diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp index 6b67ceee92c..e79eb8801f1 100644 --- a/WebCore/plugins/PluginView.cpp +++ b/WebCore/plugins/PluginView.cpp @@ -47,7 +47,7 @@ #include "Page.h" #include "FocusController.h" #include "PlatformMouseEvent.h" -#if PLATFORM(WIN_OS) && ENABLE(NETSCAPE_PLUGIN_API) +#if OS(WINDOWS) && ENABLE(NETSCAPE_PLUGIN_API) #include "PluginMessageThrottlerWin.h" #endif #include "PluginPackage.h" @@ -125,7 +125,7 @@ void PluginView::setFrameRect(const IntRect& rect) updatePluginWidget(); -#if PLATFORM(WIN_OS) || PLATFORM(SYMBIAN) +#if OS(WINDOWS) || OS(SYMBIAN) // On Windows and Symbian, always call plugin to change geometry. setNPWindowRect(rect); #elif defined(XP_UNIX) @@ -310,7 +310,7 @@ void PluginView::stop() #ifdef XP_WIN // Unsubclass the window if (m_isWindowed) { -#if PLATFORM(WINCE) +#if OS(WINCE) WNDPROC currentWndProc = (WNDPROC)GetWindowLong(platformPluginWidget(), GWL_WNDPROC); if (currentWndProc == PluginViewWndProc) @@ -803,14 +803,14 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p #if defined(XP_UNIX) || defined(Q_WS_X11) , m_needsXEmbed(false) #endif -#if PLATFORM(WIN_OS) && ENABLE(NETSCAPE_PLUGIN_API) +#if OS(WINDOWS) && ENABLE(NETSCAPE_PLUGIN_API) , m_pluginWndProc(0) , m_lastMessage(0) , m_isCallingPluginWndProc(false) , m_wmPrintHDC(0) , m_haveUpdatedPluginWidget(false) #endif -#if (PLATFORM(QT) && PLATFORM(WIN_OS)) || defined(XP_MACOSX) +#if (PLATFORM(QT) && OS(WINDOWS)) || defined(XP_MACOSX) , m_window(0) #endif #if defined(XP_MACOSX) @@ -1210,7 +1210,7 @@ static const char* MozillaUserAgent = "Mozilla/5.0 (" "Windows; U; Windows NT 5.1;" #elif defined(XP_UNIX) // The Gtk port uses X11 plugins in Mac. -#if PLATFORM(DARWIN) && PLATFORM(GTK) +#if OS(DARWIN) && PLATFORM(GTK) "X11; U; Intel Mac OS X;" #else "X11; U; Linux i686;" diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h index 5b4461d8be5..dbbb94df83a 100644 --- a/WebCore/plugins/PluginView.h +++ b/WebCore/plugins/PluginView.h @@ -46,7 +46,7 @@ #include #include -#if PLATFORM(WIN_OS) && (PLATFORM(QT) || PLATFORM(WX)) +#if OS(WINDOWS) && (PLATFORM(QT) || PLATFORM(WX)) typedef struct HWND__* HWND; typedef HWND PlatformPluginWidget; #else @@ -69,7 +69,7 @@ namespace WebCore { class KeyboardEvent; class MouseEvent; class KURL; -#if PLATFORM(WIN_OS) && ENABLE(NETSCAPE_PLUGIN_API) +#if OS(WINDOWS) && ENABLE(NETSCAPE_PLUGIN_API) class PluginMessageThrottlerWin; #endif class PluginPackage; @@ -187,7 +187,7 @@ namespace WebCore { const String& mimeType() const { return m_mimeType; } const KURL& url() const { return m_url; } -#if PLATFORM(WIN_OS) && ENABLE(NETSCAPE_PLUGIN_API) +#if OS(WINDOWS) && ENABLE(NETSCAPE_PLUGIN_API) static LRESULT CALLBACK PluginViewWndProc(HWND, UINT, WPARAM, LPARAM); LRESULT wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); WNDPROC pluginWndProc() const { return m_pluginWndProc; } @@ -232,7 +232,7 @@ namespace WebCore { void invalidateWindowlessPluginRect(const IntRect&); -#if PLATFORM(WIN_OS) && ENABLE(NETSCAPE_PLUGIN_API) +#if OS(WINDOWS) && ENABLE(NETSCAPE_PLUGIN_API) void paintWindowedPluginIntoContext(GraphicsContext*, const IntRect&); static HDC WINAPI hookedBeginPaint(HWND, PAINTSTRUCT*); static BOOL WINAPI hookedEndPaint(HWND, const PAINTSTRUCT*); @@ -270,7 +270,7 @@ namespace WebCore { void handleFocusOutEvent(); #endif -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) void paintIntoTransformedContext(HDC); PassRefPtr snapshot(); #endif @@ -302,7 +302,7 @@ namespace WebCore { bool m_needsXEmbed; #endif -#if PLATFORM(WIN_OS) && ENABLE(NETSCAPE_PLUGIN_API) +#if OS(WINDOWS) && ENABLE(NETSCAPE_PLUGIN_API) OwnPtr m_messageThrottler; WNDPROC m_pluginWndProc; unsigned m_lastMessage; @@ -311,7 +311,7 @@ namespace WebCore { bool m_haveUpdatedPluginWidget; #endif -#if ((PLATFORM(QT) || PLATFORM(WX)) && PLATFORM(WIN_OS)) || defined(XP_MACOSX) +#if ((PLATFORM(QT) || PLATFORM(WX)) && OS(WINDOWS)) || defined(XP_MACOSX) // On Mac OSX and Qt/Windows the plugin does not have its own native widget, // but is using the containing window as its reference for positioning/painting. PlatformPluginWidget m_window; @@ -326,7 +326,7 @@ public: private: -#if defined(XP_UNIX) || defined(Q_WS_X11) || PLATFORM(SYMBIAN) +#if defined(XP_UNIX) || defined(Q_WS_X11) || OS(SYMBIAN) void setNPWindowIfNeeded(); #elif defined(XP_MACOSX) NP_CGContext m_npCgContext; diff --git a/WebCore/plugins/win/PluginDatabaseWin.cpp b/WebCore/plugins/win/PluginDatabaseWin.cpp index 634b2a11361..71bcdb545cc 100644 --- a/WebCore/plugins/win/PluginDatabaseWin.cpp +++ b/WebCore/plugins/win/PluginDatabaseWin.cpp @@ -38,7 +38,7 @@ #define _countof(x) (sizeof(x)/sizeof(x[0])) #endif -#if PLATFORM(WINCE) +#if OS(WINCE) // WINCE doesn't support Registry Key Access Rights. The parameter should always be 0 #define KEY_ENUMERATE_SUB_KEYS 0 @@ -252,7 +252,7 @@ static inline void addMozillaPluginDirectories(Vector& directories) static inline void addWindowsMediaPlayerPluginDirectory(Vector& directories) { -#if !PLATFORM(WINCE) +#if !OS(WINCE) // The new WMP Firefox plugin is installed in \PFiles\Plugins if it can't find any Firefox installs WCHAR pluginDirectoryStr[_MAX_PATH + 1]; DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(TEXT("%SYSTEMDRIVE%\\PFiles\\Plugins"), pluginDirectoryStr, _countof(pluginDirectoryStr)); @@ -355,7 +355,7 @@ exit: static inline void addMacromediaPluginDirectories(Vector& directories) { -#if !PLATFORM(WINCE) +#if !OS(WINCE) WCHAR systemDirectoryStr[MAX_PATH]; if (GetSystemDirectory(systemDirectoryStr, _countof(systemDirectoryStr)) == 0) diff --git a/WebCore/plugins/win/PluginPackageWin.cpp b/WebCore/plugins/win/PluginPackageWin.cpp index dc9ec17bd9c..233b10c7656 100644 --- a/WebCore/plugins/win/PluginPackageWin.cpp +++ b/WebCore/plugins/win/PluginPackageWin.cpp @@ -234,7 +234,7 @@ bool PluginPackage::load() m_loadCount++; return true; } else { -#if PLATFORM(WINCE) +#if OS(WINCE) m_module = ::LoadLibraryW(m_path.charactersWithNullTermination()); #else WCHAR currentPath[MAX_PATH]; @@ -267,7 +267,7 @@ bool PluginPackage::load() NP_InitializeFuncPtr NP_Initialize = 0; NPError npErr; -#if PLATFORM(WINCE) +#if OS(WINCE) NP_Initialize = (NP_InitializeFuncPtr)GetProcAddress(m_module, L"NP_Initialize"); NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)GetProcAddress(m_module, L"NP_GetEntryPoints"); m_NPP_Shutdown = (NPP_ShutdownProcPtr)GetProcAddress(m_module, L"NP_Shutdown"); diff --git a/WebCore/plugins/win/PluginViewWin.cpp b/WebCore/plugins/win/PluginViewWin.cpp index 763536cf780..9ab68b5e972 100644 --- a/WebCore/plugins/win/PluginViewWin.cpp +++ b/WebCore/plugins/win/PluginViewWin.cpp @@ -72,7 +72,7 @@ #include #include -#if PLATFORM(WINCE) +#if OS(WINCE) #undef LOG_NPERROR #define LOG_NPERROR(x) #undef LOG_PLUGIN_NET_ERROR @@ -120,7 +120,7 @@ using namespace HTMLNames; const LPCWSTR kWebPluginViewdowClassName = L"WebPluginView"; const LPCWSTR kWebPluginViewProperty = L"WebPluginViewProperty"; -#if !PLATFORM(WINCE) +#if !OS(WINCE) // The code used to hook BeginPaint/EndPaint originally came from // . // Copyright (C) 2000 by Feng Yuan (www.fengyuan.com). @@ -134,7 +134,7 @@ static BYTE* endPaint; typedef HDC (WINAPI *PtrBeginPaint)(HWND, PAINTSTRUCT*); typedef BOOL (WINAPI *PtrEndPaint)(HWND, const PAINTSTRUCT*); -#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) extern "C" HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint); extern "C" BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint); #endif @@ -288,7 +288,7 @@ static bool registerPluginView() ASSERT(Page::instanceHandle()); -#if PLATFORM(WINCE) +#if OS(WINCE) WNDCLASS wcex = { 0 }; #else WNDCLASSEX wcex; @@ -297,7 +297,7 @@ static bool registerPluginView() #endif wcex.style = CS_DBLCLKS; -#if PLATFORM(WINCE) +#if OS(WINCE) wcex.style |= CS_PARENTDC; #endif wcex.lpfnWndProc = DefWindowProc; @@ -310,7 +310,7 @@ static bool registerPluginView() wcex.lpszMenuName = 0; wcex.lpszClassName = kWebPluginViewdowClassName; -#if PLATFORM(WINCE) +#if OS(WINCE) return !!RegisterClass(&wcex); #else return !!RegisterClassEx(&wcex); @@ -386,7 +386,7 @@ PluginView::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) m_popPopupsStateTimer.startOneShot(0); } -#if !PLATFORM(WINCE) +#if !OS(WINCE) if (message == WM_PRINTCLIENT) { // Most (all?) windowed plugins don't respond to WM_PRINTCLIENT, so we // change the message to WM_PAINT and rely on our hooked versions of @@ -417,7 +417,7 @@ void PluginView::updatePluginWidget() IntRect oldWindowRect = m_windowRect; IntRect oldClipRect = m_clipRect; -#if PLATFORM(WINCE) +#if OS(WINCE) m_windowRect = frameView->contentsToWindow(frameRect()); #else m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size()); @@ -520,7 +520,7 @@ void PluginView::paintIntoTransformedContext(HDC hdc) WINDOWPOS windowpos = { 0 }; -#if PLATFORM(WINCE) +#if OS(WINCE) IntRect r = static_cast(parent())->contentsToWindow(frameRect()); windowpos.x = r.x(); @@ -557,7 +557,7 @@ void PluginView::paintIntoTransformedContext(HDC hdc) void PluginView::paintWindowedPluginIntoContext(GraphicsContext* context, const IntRect& rect) { -#if !PLATFORM(WINCE) +#if !OS(WINCE) ASSERT(m_isWindowed); ASSERT(context->shouldIncludeChildWindows()); @@ -597,7 +597,7 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect) return; if (m_isWindowed) { -#if !PLATFORM(WINCE) +#if !OS(WINCE) if (context->shouldIncludeChildWindows()) paintWindowedPluginIntoContext(context, rect); #endif @@ -612,7 +612,7 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect) // of the window and the plugin expects that the passed in DC has window coordinates. // In the Qt port we always draw in an offscreen buffer and therefore need to preserve // the translation set in getWindowsContext. -#if !PLATFORM(QT) && !PLATFORM(WINCE) +#if !PLATFORM(QT) && !OS(WINCE) if (!context->inTransparencyLayer()) { XFORM transform; GetWorldTransform(hdc, &transform); @@ -646,7 +646,7 @@ void PluginView::handleKeyboardEvent(KeyboardEvent* event) event->setDefaultHandled(); } -#if !PLATFORM(WINCE) +#if !OS(WINCE) extern HCURSOR lastSetCursor; extern bool ignoreNextSetCursor; #endif @@ -714,7 +714,7 @@ void PluginView::handleMouseEvent(MouseEvent* event) if (!dispatchNPEvent(npEvent)) event->setDefaultHandled(); -#if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(WINCE) +#if !PLATFORM(QT) && !PLATFORM(WX) && !OS(WINCE) // Currently, Widget::setCursor is always called after this function in EventHandler.cpp // and since we don't want that we set ignoreNextSetCursor to true here to prevent that. ignoreNextSetCursor = true; @@ -726,7 +726,7 @@ void PluginView::setParent(ScrollView* parent) { Widget::setParent(parent); -#if PLATFORM(WINCE) +#if OS(WINCE) if (parent) { init(); if (parent->isVisible()) @@ -771,7 +771,7 @@ void PluginView::setNPWindowRect(const IntRect& rect) if (!m_isStarted) return; -#if PLATFORM(WINCE) +#if OS(WINCE) IntRect r = static_cast(parent())->contentsToWindow(rect); m_npWindow.x = r.x(); m_npWindow.y = r.y(); @@ -806,7 +806,7 @@ void PluginView::setNPWindowRect(const IntRect& rect) ASSERT(platformPluginWidget()); -#if PLATFORM(WINCE) +#if OS(WINCE) if (!m_pluginWndProc) { WNDPROC currentWndProc = (WNDPROC)GetWindowLong(platformPluginWidget(), GWL_WNDPROC); if (currentWndProc != PluginViewWndProc) @@ -987,7 +987,7 @@ bool PluginView::platformStart() if (m_isWindowed) { registerPluginView(); -#if !PLATFORM(WINCE) +#if !OS(WINCE) setUpOffscreenPaintingHooks(hookedBeginPaint, hookedEndPaint); #endif @@ -999,7 +999,7 @@ bool PluginView::platformStart() HWND window = ::CreateWindowEx(0, kWebPluginViewdowClassName, 0, flags, 0, 0, 0, 0, parentWindowHandle, 0, Page::instanceHandle(), 0); -#if PLATFORM(WIN_OS) && (PLATFORM(QT) || PLATFORM(WX)) +#if OS(WINDOWS) && (PLATFORM(QT) || PLATFORM(WX)) m_window = window; #else setPlatformWidget(window); @@ -1007,9 +1007,9 @@ bool PluginView::platformStart() // Calling SetWindowLongPtrA here makes the window proc ASCII, which is required by at least // the Shockwave Director plug-in. -#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) +#if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC) ::SetWindowLongPtrA(platformPluginWidget(), GWLP_WNDPROC, (LONG_PTR)DefWindowProcA); -#elif PLATFORM(WINCE) +#elif OS(WINCE) ::SetWindowLong(platformPluginWidget(), GWL_WNDPROC, (LONG)DefWindowProc); #else ::SetWindowLongPtrA(platformPluginWidget(), GWL_WNDPROC, (LONG)DefWindowProcA); diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 6784b122f7b..c03c5598a69 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,38 @@ +2010-01-04 Maciej Stachowiak + + Reviewed by Darin Fisher. + + Reorganize, document and rename OS() platform macros. + https://bugs.webkit.org/show_bug.cgi?id=33198 + + Adapt to name changes. + + * src/ChromiumBridge.cpp: + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::isSelectTrailingWhitespaceEnabled): + (WebKit::): + (WebKit::EditorClientImpl::handleEditingKeyboardEvent): + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::createPlugin): + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal): + (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal): + (WebCore::GraphicsContext3DInternal::makeContextCurrent): + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::selectionAsText): + (WebKit::WebFrameImpl::printPage): + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::handleMouseEvent): + (WebKit::WebPluginContainerImpl::handleKeyboardEvent): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::mouseDown): + (WebKit::WebViewImpl::mouseContextMenu): + (WebKit::WebViewImpl::mouseUp): + (WebKit::WebViewImpl::keyEvent): + (WebKit::WebViewImpl::sendContextMenuEvent): + (WebKit::WebViewImpl::setScrollbarColors): + (WebKit::WebViewImpl::navigationPolicyFromMouseEvent): + 2010-01-04 Darin Fisher Reviewed by Eric Seidel. diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index 9700e1a9435..0fd08253f01 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -55,13 +55,13 @@ #include "WebViewImpl.h" #include "WebWorkerClientImpl.h" -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include "WebRect.h" #include "WebSandboxSupport.h" #include "WebThemeEngine.h" #endif -#if PLATFORM(LINUX) +#if OS(LINUX) #include "WebSandboxSupport.h" #include "WebFontInfo.h" #endif @@ -285,7 +285,7 @@ KURL ChromiumBridge::filePathToURL(const String& path) // Font ----------------------------------------------------------------------- -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) bool ChromiumBridge::ensureFontLoaded(HFONT font) { WebSandboxSupport* ss = webKitClient()->sandboxSupport(); @@ -296,7 +296,7 @@ bool ChromiumBridge::ensureFontLoaded(HFONT font) } #endif -#if PLATFORM(LINUX) +#if OS(LINUX) String ChromiumBridge::getFontFamilyForCharacters(const UChar* characters, size_t numCharacters) { if (webKitClient()->sandboxSupport()) @@ -480,7 +480,7 @@ double ChromiumBridge::currentTime() // Theming -------------------------------------------------------------------- -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) void ChromiumBridge::paintButton( GraphicsContext* gc, int part, int state, int classicState, diff --git a/WebKit/chromium/src/EditorClientImpl.cpp b/WebKit/chromium/src/EditorClientImpl.cpp index 5db8ff7b133..e035e6a576f 100644 --- a/WebKit/chromium/src/EditorClientImpl.cpp +++ b/WebKit/chromium/src/EditorClientImpl.cpp @@ -105,7 +105,7 @@ bool EditorClientImpl::isSelectTrailingWhitespaceEnabled() { if (m_webView->client()) return m_webView->client()->isSelectTrailingWhitespaceEnabled(); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) return true; #else return false; @@ -357,7 +357,7 @@ static const unsigned CtrlKey = 1 << 0; static const unsigned AltKey = 1 << 1; static const unsigned ShiftKey = 1 << 2; static const unsigned MetaKey = 1 << 3; -#if PLATFORM(DARWIN) +#if OS(DARWIN) // Aliases for the generic key defintions to make kbd shortcuts definitions more // readable on OS X. static const unsigned OptionKey = AltKey; @@ -387,7 +387,7 @@ struct KeyPressEntry { static const KeyDownEntry keyDownEntries[] = { { VKEY_LEFT, 0, "MoveLeft" }, { VKEY_LEFT, ShiftKey, "MoveLeftAndModifySelection" }, -#if PLATFORM(DARWIN) +#if OS(DARWIN) { VKEY_LEFT, OptionKey, "MoveWordLeft" }, { VKEY_LEFT, OptionKey | ShiftKey, "MoveWordLeftAndModifySelection" }, @@ -398,7 +398,7 @@ static const KeyDownEntry keyDownEntries[] = { #endif { VKEY_RIGHT, 0, "MoveRight" }, { VKEY_RIGHT, ShiftKey, "MoveRightAndModifySelection" }, -#if PLATFORM(DARWIN) +#if OS(DARWIN) { VKEY_RIGHT, OptionKey, "MoveWordRight" }, { VKEY_RIGHT, OptionKey | ShiftKey, "MoveWordRightAndModifySelection" }, @@ -418,12 +418,12 @@ static const KeyDownEntry keyDownEntries[] = { { VKEY_HOME, 0, "MoveToBeginningOfLine" }, { VKEY_HOME, ShiftKey, "MoveToBeginningOfLineAndModifySelection" }, -#if PLATFORM(DARWIN) +#if OS(DARWIN) { VKEY_LEFT, CommandKey, "MoveToBeginningOfLine" }, { VKEY_LEFT, CommandKey | ShiftKey, "MoveToBeginningOfLineAndModifySelection" }, #endif -#if PLATFORM(DARWIN) +#if OS(DARWIN) { VKEY_UP, CommandKey, "MoveToBeginningOfDocument" }, { VKEY_UP, CommandKey | ShiftKey, "MoveToBeginningOfDocumentAndModifySelection" }, @@ -434,7 +434,7 @@ static const KeyDownEntry keyDownEntries[] = { #endif { VKEY_END, 0, "MoveToEndOfLine" }, { VKEY_END, ShiftKey, "MoveToEndOfLineAndModifySelection" }, -#if PLATFORM(DARWIN) +#if OS(DARWIN) { VKEY_DOWN, CommandKey, "MoveToEndOfDocument" }, { VKEY_DOWN, CommandKey | ShiftKey, "MoveToEndOfDocumentAndModifySelection" }, @@ -443,7 +443,7 @@ static const KeyDownEntry keyDownEntries[] = { { VKEY_END, CtrlKey | ShiftKey, "MoveToEndOfDocumentAndModifySelection" }, #endif -#if PLATFORM(DARWIN) +#if OS(DARWIN) { VKEY_RIGHT, CommandKey, "MoveToEndOfLine" }, { VKEY_RIGHT, CommandKey | ShiftKey, "MoveToEndOfLineAndModifySelection" }, @@ -451,7 +451,7 @@ static const KeyDownEntry keyDownEntries[] = { { VKEY_BACK, 0, "DeleteBackward" }, { VKEY_BACK, ShiftKey, "DeleteBackward" }, { VKEY_DELETE, 0, "DeleteForward" }, -#if PLATFORM(DARWIN) +#if OS(DARWIN) { VKEY_BACK, OptionKey, "DeleteWordBackward" }, { VKEY_DELETE, OptionKey, "DeleteWordForward" }, #else @@ -473,7 +473,7 @@ static const KeyDownEntry keyDownEntries[] = { { VKEY_INSERT, CtrlKey, "Copy" }, { VKEY_INSERT, ShiftKey, "Paste" }, { VKEY_DELETE, ShiftKey, "Cut" }, -#if !PLATFORM(DARWIN) +#if !OS(DARWIN) // On OS X, we pipe these back to the browser, so that it can do menu item // blinking. { 'C', CtrlKey, "Copy" }, @@ -600,13 +600,13 @@ bool EditorClientImpl::handleEditingKeyboardEvent(KeyboardEvent* evt) // unexpected behaviour if (ch < ' ') return false; -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) // Don't insert ASCII character if ctrl w/o alt or meta is on. // On Mac, we should ignore events when meta is on (Command-). if (ch < 0x80) { if (evt->keyEvent()->ctrlKey() && !evt->keyEvent()->altKey()) return false; -#if PLATFORM(DARWIN) +#if OS(DARWIN) if (evt->keyEvent()->metaKey()) return false; #endif diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp index 3ca8e8deaa2..cdeebed0531 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -1325,7 +1325,7 @@ PassRefPtr FrameLoaderClientImpl::createPlugin( const String& mimeType, bool loadManually) { -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) // WebCore asks us to make a plugin even if we don't have a // registered handler, with a comment saying it's so we can display // the broken plugin icon. In Chromium, we normally register a diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp index 020dc05e9fe..2130b491290 100644 --- a/WebKit/chromium/src/GraphicsContext3D.cpp +++ b/WebKit/chromium/src/GraphicsContext3D.cpp @@ -56,7 +56,7 @@ #include #include -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include #endif @@ -76,11 +76,11 @@ #include "NativeImageSkia.h" #endif -#if PLATFORM(DARWIN) +#if OS(DARWIN) #define USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER #endif -#if PLATFORM(LINUX) +#if OS(LINUX) #include #include "GL/glxew.h" #endif @@ -182,7 +182,7 @@ private: #endif static bool s_initializedGLEW; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) HWND m_canvasWindow; HDC m_canvasDC; HGLRC m_contextObj; @@ -190,7 +190,7 @@ private: CGLPBufferObj m_pbuffer; CGLContextObj m_contextObj; unsigned char* m_renderOutput; -#elif PLATFORM(LINUX) +#elif OS(LINUX) GLXContext m_contextObj; GLXPbuffer m_pbuffer; @@ -290,7 +290,7 @@ private: bool GraphicsContext3DInternal::s_initializedGLEW = false; -#if PLATFORM(LINUX) +#if OS(LINUX) GraphicsContext3DInternal::GLConnection* GraphicsContext3DInternal::s_gl = 0; GraphicsContext3DInternal::GLConnection* GraphicsContext3DInternal::GLConnection::create() @@ -352,7 +352,7 @@ GraphicsContext3DInternal::GLConnection::~GLConnection() dlclose(m_libGL); } -#endif // PLATFORM(LINUX) +#endif // OS(LINUX) GraphicsContext3DInternal::VertexAttribPointerState::VertexAttribPointerState() : enabled(false) @@ -378,7 +378,7 @@ GraphicsContext3DInternal::GraphicsContext3DInternal() #if PLATFORM(SKIA) , m_resizingBitmap(0) #endif -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) , m_canvasWindow(0) , m_canvasDC(0) , m_contextObj(0) @@ -386,14 +386,14 @@ GraphicsContext3DInternal::GraphicsContext3DInternal() , m_pbuffer(0) , m_contextObj(0) , m_renderOutput(0) -#elif PLATFORM(LINUX) +#elif OS(LINUX) , m_contextObj(0) , m_pbuffer(0) #else #error Must port to your platform #endif { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) WNDCLASS wc; if (!GetClassInfo(GetModuleHandle(0), L"CANVASGL", &wc)) { ZeroMemory(&wc, sizeof(WNDCLASS)); @@ -505,7 +505,7 @@ GraphicsContext3DInternal::GraphicsContext3DInternal() } m_pbuffer = pbuffer; m_contextObj = context; -#elif PLATFORM(LINUX) +#elif OS(LINUX) if (!s_gl) { s_gl = GLConnection::create(); if (!s_gl) @@ -592,7 +592,7 @@ GraphicsContext3DInternal::~GraphicsContext3DInternal() if (m_resizingBitmap) delete m_resizingBitmap; #endif -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) wglMakeCurrent(0, 0); wglDeleteContext(m_contextObj); ReleaseDC(m_canvasWindow, m_canvasDC); @@ -603,7 +603,7 @@ GraphicsContext3DInternal::~GraphicsContext3DInternal() CGLDestroyPBuffer(m_pbuffer); if (m_renderOutput) delete[] m_renderOutput; -#elif PLATFORM(LINUX) +#elif OS(LINUX) s_gl->makeCurrent(0, 0); s_gl->destroyContext(m_contextObj); s_gl->destroyPbuffer(m_pbuffer); @@ -615,7 +615,7 @@ GraphicsContext3DInternal::~GraphicsContext3DInternal() bool GraphicsContext3DInternal::makeContextCurrent() { -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) if (wglGetCurrentContext() != m_contextObj) if (wglMakeCurrent(m_canvasDC, m_contextObj)) return true; @@ -623,7 +623,7 @@ bool GraphicsContext3DInternal::makeContextCurrent() if (CGLGetCurrentContext() != m_contextObj) if (CGLSetCurrentContext(m_contextObj) == kCGLNoError) return true; -#elif PLATFORM(LINUX) +#elif OS(LINUX) if (s_gl->getCurrentContext() != m_contextObj) if (s_gl->makeCurrent(m_pbuffer, m_contextObj)) return true; diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index 526c8f5ace7..e76825e2e45 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -145,11 +145,11 @@ #include -#if PLATFORM(DARWIN) +#if OS(DARWIN) #include "LocalCurrentGraphicsContext.h" #endif -#if PLATFORM(LINUX) +#if OS(LINUX) #include #endif @@ -1055,7 +1055,7 @@ WebString WebFrameImpl::selectionAsText() const return WebString(); String text = range->text(); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) replaceNewlinesWithWindowsStyleNewlines(text); #endif replaceNBSPWithSpace(text); @@ -1105,10 +1105,10 @@ float WebFrameImpl::printPage(int page, WebCanvas* canvas) return 0; } -#if PLATFORM(WIN_OS) || PLATFORM(LINUX) || PLATFORM(FREEBSD) +#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) PlatformContextSkia context(canvas); GraphicsContext spool(&context); -#elif PLATFORM(DARWIN) +#elif OS(DARWIN) GraphicsContext spool(canvas); LocalCurrentGraphicsContext localContext(&spool); #endif diff --git a/WebKit/chromium/src/WebPluginContainerImpl.cpp b/WebKit/chromium/src/WebPluginContainerImpl.cpp index d668dd722ce..86cac26cabe 100644 --- a/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -354,7 +354,7 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) WebCursorInfo cursorInfo; bool handled = m_webPlugin->handleInputEvent(webEvent, cursorInfo); -#if !PLATFORM(DARWIN) +#if !OS(DARWIN) // TODO(pkasting): http://b/1119691 This conditional seems exactly // backwards, but if I reverse it, giving focus to a transparent // (windowless) plugin fails. @@ -390,7 +390,7 @@ void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event) WebCursorInfo cursor_info; bool handled = m_webPlugin->handleInputEvent(webEvent, cursor_info); -#if !PLATFORM(DARWIN) +#if !OS(DARWIN) // TODO(pkasting): http://b/1119691 See above. handled = !handled; #endif diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 34866b5cbea..c64afa733ce 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -97,11 +97,11 @@ #include "WebVector.h" #include "WebViewClient.h" -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) #include "KeyboardCodesWin.h" #include "RenderThemeChromiumWin.h" #else -#if PLATFORM(LINUX) +#if OS(LINUX) #include "RenderThemeChromiumLinux.h" #endif #include "KeyboardCodesPosix.h" @@ -328,12 +328,12 @@ void WebViewImpl::mouseDown(const WebMouseEvent& event) // Dispatch the contextmenu event regardless of if the click was swallowed. // On Windows, we handle it on mouse up, not down. -#if PLATFORM(DARWIN) +#if OS(DARWIN) if (event.button == WebMouseEvent::ButtonRight || (event.button == WebMouseEvent::ButtonLeft && event.modifiers & WebMouseEvent::ControlKey)) mouseContextMenu(event); -#elif PLATFORM(LINUX) +#elif OS(LINUX) if (event.button == WebMouseEvent::ButtonRight) mouseContextMenu(event); #endif @@ -356,7 +356,7 @@ void WebViewImpl::mouseContextMenu(const WebMouseEvent& event) else targetFrame = m_page->focusController()->focusedOrMainFrame(); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) targetFrame->view()->setCursor(pointerCursor()); #endif @@ -372,7 +372,7 @@ void WebViewImpl::mouseUp(const WebMouseEvent& event) if (!mainFrameImpl() || !mainFrameImpl()->frameView()) return; -#if PLATFORM(LINUX) +#if OS(LINUX) // If the event was a middle click, attempt to copy text into the focused // frame. We execute this before we let the page have a go at the event // because the page may change what is focused during in its event handler. @@ -413,7 +413,7 @@ void WebViewImpl::mouseUp(const WebMouseEvent& event) mainFrameImpl()->frame()->eventHandler()->handleMouseReleaseEvent( PlatformMouseEventBuilder(mainFrameImpl()->frameView(), event)); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) // Dispatch the contextmenu event regardless of if the click was swallowed. // On Mac/Linux, we handle it on mouse down, not up. if (event.button == WebMouseEvent::ButtonRight) @@ -453,11 +453,11 @@ bool WebViewImpl::keyEvent(const WebKeyboardEvent& event) if (!handler) return keyEventDefault(event); -#if PLATFORM(WIN_OS) || PLATFORM(LINUX) +#if OS(WINDOWS) || OS(LINUX) const WebInputEvent::Type contextMenuTriggeringEventType = -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) WebInputEvent::KeyUp; -#elif PLATFORM(LINUX) +#elif OS(LINUX) WebInputEvent::RawKeyDown; #endif @@ -583,7 +583,7 @@ bool WebViewImpl::charEvent(const WebKeyboardEvent& event) // // This function is an ugly copy/paste and should be cleaned up when the // WebKitWin version is cleaned: https://bugs.webkit.org/show_bug.cgi?id=20438 -#if PLATFORM(WIN_OS) || PLATFORM(LINUX) +#if OS(WINDOWS) || OS(LINUX) // FIXME: implement on Mac bool WebViewImpl::sendContextMenuEvent(const WebKeyboardEvent& event) { @@ -594,7 +594,7 @@ bool WebViewImpl::sendContextMenuEvent(const WebKeyboardEvent& event) return false; IntPoint coords(-1, -1); -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) int rightAligned = ::GetSystemMetrics(SM_MENUDROPALIGNMENT); #else int rightAligned = 0; @@ -1647,7 +1647,7 @@ bool WebViewImpl::isActive() const void WebViewImpl::setScrollbarColors(unsigned inactiveColor, unsigned activeColor, unsigned trackColor) { -#if PLATFORM(LINUX) +#if OS(LINUX) RenderThemeChromiumLinux::setScrollbarColors(inactiveColor, activeColor, trackColor); @@ -1672,9 +1672,9 @@ bool WebViewImpl::navigationPolicyFromMouseEvent(unsigned short button, bool alt, bool meta, WebNavigationPolicy* policy) { -#if PLATFORM(WIN_OS) || PLATFORM(LINUX) || PLATFORM(FREEBSD) +#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) const bool newTabModifier = (button == 1) || ctrl; -#elif PLATFORM(DARWIN) +#elif OS(DARWIN) const bool newTabModifier = (button == 1) || meta; #endif if (!newTabModifier && !shift && !alt) diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog index d5714480cde..796ba8f5f43 100644 --- a/WebKit/gtk/ChangeLog +++ b/WebKit/gtk/ChangeLog @@ -1,3 +1,15 @@ +2010-01-04 Maciej Stachowiak + + Reviewed by Darin Fisher. + + Reorganize, document and rename OS() platform macros. + https://bugs.webkit.org/show_bug.cgi?id=33198 + + Adapt to name changes. + + * webkit/webkitwebsettings.cpp: + (webkit_get_user_agent): + 2010-01-04 Maciej Stachowiak Reviewed by Adam Barth. diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp index b72198a6414..1e2f8cc7551 100644 --- a/WebKit/gtk/webkit/webkitwebsettings.cpp +++ b/WebKit/gtk/webkit/webkitwebsettings.cpp @@ -37,7 +37,7 @@ #include "PlatformString.h" #include -#if PLATFORM(UNIX) +#if OS(UNIX) #include #endif @@ -160,7 +160,7 @@ static String webkit_get_user_agent() #if PLATFORM(X11) platform = g_strdup("X11"); -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) platform = g_strdup("Windows"); #elif PLATFORM(MAC) platform = g_strdup("Macintosh"); @@ -171,7 +171,7 @@ static String webkit_get_user_agent() #endif // FIXME: platform/version detection can be shared. -#if PLATFORM(DARWIN) +#if OS(DARWIN) #if CPU(X86) osVersion = g_strdup("Intel Mac OS X"); @@ -179,14 +179,14 @@ static String webkit_get_user_agent() osVersion = g_strdup("PPC Mac OS X"); #endif -#elif PLATFORM(UNIX) +#elif OS(UNIX) struct utsname name; if (uname(&name) != -1) osVersion = g_strdup_printf("%s %s", name.sysname, name.machine); else osVersion = g_strdup("Unknown"); -#elif PLATFORM(WIN_OS) +#elif OS(WINDOWS) // FIXME: Compute the Windows version osVersion = g_strdup("Windows"); diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog index 98afbf70191..493297e3290 100644 --- a/WebKitTools/ChangeLog +++ b/WebKitTools/ChangeLog @@ -1,3 +1,15 @@ +2010-01-04 Maciej Stachowiak + + Reviewed by Darin Fisher. + + Reorganize, document and rename OS() platform macros. + https://bugs.webkit.org/show_bug.cgi?id=33198 + + Adapt to name changes. + + * DumpRenderTree/DumpRenderTree.h: + * DumpRenderTree/config.h: + 2010-01-05 Chris Jerdonek Reviewed by Eric Seidel. diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.h b/WebKitTools/DumpRenderTree/DumpRenderTree.h index c11c5f6d551..8366e89d8e2 100644 --- a/WebKitTools/DumpRenderTree/DumpRenderTree.h +++ b/WebKitTools/DumpRenderTree/DumpRenderTree.h @@ -46,7 +46,7 @@ #include -#if !PLATFORM(OPENBSD) +#if !OS(OPENBSD) std::wstring urlSuitableForTestResult(const std::wstring& url); #endif diff --git a/WebKitTools/DumpRenderTree/config.h b/WebKitTools/DumpRenderTree/config.h index 063eeea564b..33dee6d8ebd 100644 --- a/WebKitTools/DumpRenderTree/config.h +++ b/WebKitTools/DumpRenderTree/config.h @@ -32,7 +32,7 @@ #include #endif -#if PLATFORM(WIN_OS) && !COMPILER(GCC) +#if OS(WINDOWS) && !COMPILER(GCC) #define JS_EXPORTDATA __declspec(dllimport) #define WEBKIT_EXPORTDATA __declspec(dllimport) #else -- GitLab