2010-01-04 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jan 2010 08:58:28 +0000 (08:58 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jan 2010 08:58:28 +0000 (08:58 +0000)
        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  <mjs@apple.com>

        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  <mjs@apple.com>

        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  <mjs@apple.com>

        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  <mjs@apple.com>

        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

147 files changed:
JavaScriptCore/API/JSContextRef.cpp
JavaScriptCore/ChangeLog
JavaScriptCore/assembler/MacroAssemblerARM.cpp
JavaScriptCore/assembler/MacroAssemblerX86Common.h
JavaScriptCore/bytecode/SamplingTool.cpp
JavaScriptCore/config.h
JavaScriptCore/interpreter/RegisterFile.cpp
JavaScriptCore/interpreter/RegisterFile.h
JavaScriptCore/jit/ExecutableAllocator.h
JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
JavaScriptCore/jit/ExecutableAllocatorPosix.cpp
JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp
JavaScriptCore/jit/ExecutableAllocatorWin.cpp
JavaScriptCore/jit/JITOpcodes.cpp
JavaScriptCore/jit/JITStubs.cpp
JavaScriptCore/jsc.cpp
JavaScriptCore/parser/Grammar.y
JavaScriptCore/profiler/ProfileNode.cpp
JavaScriptCore/runtime/Collector.cpp
JavaScriptCore/runtime/Collector.h
JavaScriptCore/runtime/DateConstructor.cpp
JavaScriptCore/runtime/DatePrototype.cpp
JavaScriptCore/runtime/InitializeThreading.cpp
JavaScriptCore/runtime/MarkStack.h
JavaScriptCore/runtime/MarkStackPosix.cpp
JavaScriptCore/runtime/MarkStackSymbian.cpp
JavaScriptCore/runtime/MarkStackWin.cpp
JavaScriptCore/runtime/StringPrototype.cpp
JavaScriptCore/runtime/TimeoutChecker.cpp
JavaScriptCore/runtime/UString.cpp
JavaScriptCore/wtf/Assertions.cpp
JavaScriptCore/wtf/Assertions.h
JavaScriptCore/wtf/CurrentTime.cpp
JavaScriptCore/wtf/CurrentTime.h
JavaScriptCore/wtf/DateMath.cpp
JavaScriptCore/wtf/FastMalloc.cpp
JavaScriptCore/wtf/FastMalloc.h
JavaScriptCore/wtf/MathExtras.h
JavaScriptCore/wtf/Platform.h
JavaScriptCore/wtf/RandomNumber.cpp
JavaScriptCore/wtf/RandomNumberSeed.h
JavaScriptCore/wtf/StringExtras.h
JavaScriptCore/wtf/TCSpinLock.h
JavaScriptCore/wtf/TCSystemAlloc.cpp
JavaScriptCore/wtf/ThreadSpecific.h
JavaScriptCore/wtf/Threading.h
JavaScriptCore/wtf/ThreadingPthreads.cpp
JavaScriptCore/wtf/ThreadingWin.cpp
JavaScriptCore/wtf/VMTags.h
JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp
JavaScriptCore/wtf/win/MainThreadWin.cpp
WebCore/ChangeLog
WebCore/accessibility/AccessibilityObject.h
WebCore/config.h
WebCore/dom/SelectElement.cpp
WebCore/inspector/InspectorFrontendHost.cpp
WebCore/loader/CachedFont.cpp
WebCore/loader/FTPDirectoryDocument.cpp
WebCore/loader/FTPDirectoryParser.cpp
WebCore/page/EventHandler.cpp
WebCore/page/Frame.cpp
WebCore/page/NavigatorBase.cpp
WebCore/page/Page.h
WebCore/page/Settings.cpp
WebCore/page/Settings.h
WebCore/page/chromium/DragControllerChromium.cpp
WebCore/page/chromium/EventHandlerChromium.cpp
WebCore/page/win/EventHandlerWin.cpp
WebCore/platform/FileSystem.h
WebCore/platform/KeyboardCodes.h
WebCore/platform/PurgeableBuffer.h
WebCore/platform/chromium/ChromiumBridge.h
WebCore/platform/chromium/ClipboardChromium.cpp
WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp
WebCore/platform/chromium/ClipboardUtilitiesChromium.h
WebCore/platform/chromium/PasteboardChromium.cpp
WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp
WebCore/platform/chromium/PopupMenuChromium.cpp
WebCore/platform/graphics/BitmapImage.h
WebCore/platform/graphics/FloatPoint.h
WebCore/platform/graphics/FloatRect.h
WebCore/platform/graphics/FloatSize.h
WebCore/platform/graphics/FontCache.cpp
WebCore/platform/graphics/FontCache.h
WebCore/platform/graphics/FontFastPath.cpp
WebCore/platform/graphics/GlyphBuffer.h
WebCore/platform/graphics/Gradient.h
WebCore/platform/graphics/GraphicsContext.cpp
WebCore/platform/graphics/GraphicsContext.h
WebCore/platform/graphics/GraphicsContext3D.h
WebCore/platform/graphics/ImageSource.h
WebCore/platform/graphics/IntRect.h
WebCore/platform/graphics/MediaPlayer.cpp
WebCore/platform/graphics/Path.h
WebCore/platform/graphics/Pattern.h
WebCore/platform/graphics/SimpleFontData.h
WebCore/platform/graphics/cg/ColorCG.cpp
WebCore/platform/graphics/cg/GraphicsContextCG.cpp
WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp
WebCore/platform/graphics/chromium/FontCustomPlatformData.h
WebCore/platform/graphics/chromium/FontPlatformData.h
WebCore/platform/graphics/opentype/OpenTypeUtilities.cpp
WebCore/platform/graphics/opentype/OpenTypeUtilities.h
WebCore/platform/graphics/qt/GraphicsContextQt.cpp
WebCore/platform/graphics/qt/ImageQt.cpp
WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
WebCore/platform/graphics/skia/ImageBufferSkia.cpp
WebCore/platform/graphics/skia/PlatformContextSkia.cpp
WebCore/platform/graphics/skia/PlatformContextSkia.h
WebCore/platform/graphics/win/IconWin.cpp
WebCore/platform/graphics/wx/GraphicsContextWx.cpp
WebCore/platform/gtk/FileSystemGtk.cpp
WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
WebCore/platform/network/curl/ResourceHandleManager.cpp
WebCore/platform/network/soup/ResourceHandleSoup.cpp
WebCore/platform/text/String.cpp
WebCore/platform/text/TextEncoding.cpp
WebCore/platform/text/TextEncodingRegistry.cpp
WebCore/platform/text/TextStream.cpp
WebCore/platform/text/TextStream.h
WebCore/platform/text/qt/TextCodecQt.cpp
WebCore/platform/win/PlatformMouseEventWin.cpp
WebCore/platform/win/PlatformScreenWin.cpp
WebCore/platform/win/PopupMenuWin.cpp
WebCore/platform/win/SystemTimeWin.cpp
WebCore/platform/wx/FileSystemWx.cpp
WebCore/plugins/PluginDatabase.cpp
WebCore/plugins/PluginPackage.cpp
WebCore/plugins/PluginPackage.h
WebCore/plugins/PluginView.cpp
WebCore/plugins/PluginView.h
WebCore/plugins/win/PluginDatabaseWin.cpp
WebCore/plugins/win/PluginPackageWin.cpp
WebCore/plugins/win/PluginViewWin.cpp
WebKit/chromium/ChangeLog
WebKit/chromium/src/ChromiumBridge.cpp
WebKit/chromium/src/EditorClientImpl.cpp
WebKit/chromium/src/FrameLoaderClientImpl.cpp
WebKit/chromium/src/GraphicsContext3D.cpp
WebKit/chromium/src/WebFrameImpl.cpp
WebKit/chromium/src/WebPluginContainerImpl.cpp
WebKit/chromium/src/WebViewImpl.cpp
WebKit/gtk/ChangeLog
WebKit/gtk/webkit/webkitwebsettings.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.h
WebKitTools/DumpRenderTree/config.h

index e1f465de204502029f31c8d88d6c503fc8d616fb..c821bb3e4325c8a005dc4c1468343e7ccc4f182f 100644 (file)
@@ -35,7 +35,7 @@
 #include "JSObject.h"
 #include <wtf/Platform.h>
 
-#if PLATFORM(DARWIN)
+#if OS(DARWIN)
 #include <mach-o/dyld.h>
 
 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);
 }
index cfb97d1c6a353777cbf437bf644e7652654dc95d..10aa66a3b3fb790682b5778f15f03e7e98106f5b 100644 (file)
@@ -1,3 +1,101 @@
+2010-01-04  Maciej Stachowiak  <mjs@apple.com>
+
+        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  <gns@gnome.org>
 
         Add missing files to the build system - make distcheck build fix.
index e636072a3ef9a27c9d9718e2aa8f4caeec252149..b5b20fa07d220f630746b93f396ea18d559e3d28 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "MacroAssemblerARM.h"
 
-#if PLATFORM(LINUX)
+#if OS(LINUX)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -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;
index dd0b82b9d109a9cbd70fd14a9224d32ab73be1b4..449df86c6673790f8a7f6e0b17a699c0ab646c9c 100644 (file)
@@ -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,
index 865c919335eaa9579e007d90388933b4848eb748..3f0babc5491cc1d72cb3cf54679ffc3d1a163d8b 100644 (file)
@@ -33,7 +33,7 @@
 #include "Interpreter.h"
 #include "Opcode.h"
 
-#if !PLATFORM(WIN_OS)
+#if !OS(WINDOWS)
 #include <unistd.h>
 #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)
 {
index 30757db2902266a8afba485f5c281c16f6588272..006ab3dce5154a301499f48a26b8d249fd4bd237 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <wtf/Platform.h>
 
-#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
 #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
 
index 5424199596835e1cd1dd260af8746651d0862294..510effe0dd6c09a83584dc748969412823c52a17 100644 (file)
@@ -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);
index 953c70f7bcae134dd96515c6e0436f19b935e3c0..1fc4f828b48acc1b1a4772b00729882006ad23e3 100644 (file)
@@ -176,7 +176,7 @@ namespace JSC {
     #if HAVE(MMAP)
         m_buffer = static_cast<Register*>(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<Register*>(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<char*>(newEnd) - reinterpret_cast<char*>(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);
index c73bd1b443126e7d3980ea83c89e83b601058172..8d4b36d571fa1472f6e38dc5b0e748815a3ca07d 100644 (file)
 #include <wtf/UnusedParam.h>
 #include <wtf/Vector.h>
 
-#if PLATFORM(IPHONE)
+#if OS(IPHONE_OS)
 #include <libkern/OSCacheControl.h>
 #include <sys/mman.h>
 #endif
 
-#if PLATFORM(SYMBIAN)
+#if OS(SYMBIAN)
 #include <e32std.h>
 #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<char*>(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<char*>(code) + size);
     }
-#elif CPU(ARM_TRADITIONAL) && PLATFORM(LINUX)
+#elif CPU(ARM_TRADITIONAL) && OS(LINUX)
     static void cacheFlush(void* code, size_t size)
     {
         asm volatile (
index 9f6412df6127ca98522cc7b3e1e4413686d3f517..dd1db4e24ab85df7d8ff8e7c22d89489af8b4918 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <errno.h>
 
-#if ENABLE(ASSEMBLER) && PLATFORM(MAC) && CPU(X86_64)
+#if ENABLE(ASSEMBLER) && OS(DARWIN) && CPU(X86_64)
 
 #include "TCSpinLock.h"
 #include <mach/mach_init.h>
index 0cb9052d3bb243ea1bc5a16a8425090e684b4a94..06375adb537f2ed0713118e58dae761772de9676 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "ExecutableAllocator.h"
 
-#if ENABLE(ASSEMBLER) && PLATFORM(UNIX) && !PLATFORM(SYMBIAN)
+#if ENABLE(ASSEMBLER) && OS(UNIX) && !OS(SYMBIAN)
 
 #include <sys/mman.h>
 #include <unistd.h>
@@ -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)
index d8e812a836b62ff51d0f3ba6f51645b7e2a89375..e82975c9c25fabf50d00005a6677e47d1ba7249a 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "ExecutableAllocator.h"
 
-#if ENABLE(ASSEMBLER) && PLATFORM(SYMBIAN)
+#if ENABLE(ASSEMBLER) && OS(SYMBIAN)
 
 #include <e32hal.h>
 #include <e32std.h>
index bf6274a667f8f78ccccf2a8296104b2fb5cf09c8..e38323c5fddd394628cd0d8fe6842a6c53c479c5 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "ExecutableAllocator.h"
 
-#if ENABLE(ASSEMBLER) && PLATFORM(WIN_OS)
+#if ENABLE(ASSEMBLER) && OS(WINDOWS)
 
 #include "windows.h"
 
index 5f5623bc73f4b9f21635bf763b8e9c4f1f8d018f..d9a32d9ae39c6649067bb0909b14f749c3d49515 100644 (file)
@@ -160,7 +160,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* 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<ExecutablePool>* 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<ExecutablePool>* 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<ExecutablePool>* 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);
 
index 9a32a463727dd498e166b004a2a6d94306a396b0..5fa2f65b2875f3aeff824e197a218893389211b7 100644 (file)
@@ -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
index 6c618897fb565b2cb664a270a80b90cd2282461d..30c1e3842221fa0d19c59362abb70b620596867d 100644 (file)
@@ -37,7 +37,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#if !PLATFORM(WIN_OS)
+#if !OS(WINDOWS)
 #include <unistd.h>
 #endif
 
@@ -54,7 +54,7 @@
 #include <signal.h>
 #endif
 
-#if COMPILER(MSVC) && !PLATFORM(WINCE)
+#if COMPILER(MSVC) && !OS(WINCE)
 #include <crtdbg.h>
 #include <windows.h>
 #include <mmsystem.h>
@@ -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
 
index 6d953dfed124d23dae2d360af0eaf395d5fe8c4a..717a266819397a96ff7a84e45f7570e4834cbd9d 100644 (file)
@@ -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
index 02fb7c955033c910a4ffbc29fbae3685e8f495e5..fb126b3febd5e84a688a767b66843da6d0adef69 100644 (file)
@@ -33,7 +33,7 @@
 #include <stdio.h>
 #include <wtf/DateMath.h>
 
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
 #include <windows.h>
 #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);
index 37b2ca4f588061a947c2121c2834428e3f782e69..f15cb2ca565c66f2f1af2bccbce3f58be3615c01 100644 (file)
@@ -45,7 +45,7 @@
 #include <wtf/UnusedParam.h>
 #include <wtf/VMTags.h>
 
-#if PLATFORM(DARWIN)
+#if OS(DARWIN)
 
 #include <mach/mach_init.h>
 #include <mach/mach_port.h>
 #include <mach/thread_act.h>
 #include <mach/vm_map.h>
 
-#elif PLATFORM(SYMBIAN)
+#elif OS(SYMBIAN)
 #include <e32std.h>
 #include <e32cmn.h>
 #include <unistd.h>
 
-#elif PLATFORM(WIN_OS)
+#elif OS(WINDOWS)
 
 #include <windows.h>
 #include <malloc.h>
 
-#elif PLATFORM(HAIKU)
+#elif OS(HAIKU)
 
 #include <OS.h>
 
-#elif PLATFORM(UNIX)
+#elif OS(UNIX)
 
 #include <stdlib.h>
-#if !PLATFORM(HAIKU)
+#if !OS(HAIKU)
 #include <sys/mman.h>
 #endif
 #include <unistd.h>
 
-#if PLATFORM(SOLARIS)
+#if OS(SOLARIS)
 #include <thread.h>
 #else
 #include <pthread.h>
@@ -85,7 +85,7 @@
 #include <pthread_np.h>
 #endif
 
-#if PLATFORM(QNX)
+#if OS(QNX)
 #include <fcntl.h>
 #include <sys/procfs.h>
 #include <stdio.h>
@@ -109,16 +109,16 @@ const size_t ALLOCATIONS_PER_COLLECTION = 3600;
 // a PIC branch in Mach-O binaries, see <rdar://problem/5971391>.
 #define MIN_ARRAY_SIZE (static_cast<size_t>(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<unsigned char*>(userChunk->Alloc(BLOCK_SIZE));
     if (!mask)
         CRASH();
     uintptr_t address = reinterpret_cast<uintptr_t>(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<vm_address_t>(block), BLOCK_SIZE);
-#elif PLATFORM(SYMBIAN)
+#elif OS(SYMBIAN)
     userChunk->Free(reinterpret_cast<TAny*>(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<void*>(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<PNT_TIB64>(NtCurrentTeb());
     return reinterpret_cast<void*>(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<void*>(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<char*>(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, &regs);
     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<void*>((uintptr_t) regs.Esp);
 #else
 #error Need a way to get the stack pointer for another thread on this platform
index 8096f3dbee373ee0c4409b64b593587a2122d962..7f7a67916e1275ecdfd79c178e430109907e6829 100644 (file)
@@ -181,7 +181,7 @@ namespace JSC {
 #endif
     template<> struct CellSize<sizeof(uint64_t)> { 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
index e25765b7862778cf5d9c7ec0646a866da450ef4c..2e476b3b756be2515a43d613bf34a614997dbb86 100644 (file)
@@ -35,7 +35,7 @@
 #include <wtf/DateMath.h>
 #include <wtf/MathExtras.h>
 
-#if PLATFORM(WINCE) && !PLATFORM(QT)
+#if OS(WINCE) && !PLATFORM(QT)
 extern "C" time_t time(time_t* timer); // Provided by libce.
 #endif
 
index 2b5e0d003219986794b00cf5dc58ae5a627c732d..ca9d4ea43589c61dc66b5d4cf58220ae3a946750 100644 (file)
@@ -59,7 +59,7 @@
 #include <CoreFoundation/CoreFoundation.h>
 #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
index aad1af8121c9e05aa769708a3884d7cfe29419ea..5b1468f70ccc12a0f9f13503aff55b968e0bfd88 100644 (file)
@@ -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;
index a114ae08c4cc24dca74d80a069c2c8e6e830f079..b0707fe35f3467fc1659b301eba286c7f858a704 100644 (file)
@@ -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);
index 376c8da9af2bdd134883d28939394d784f23bf56..c28bc0de99cb99389a200ca92bdf0881413d75cc 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "MarkStack.h"
 
-#if PLATFORM(UNIX) && !PLATFORM(SYMBIAN)
+#if OS(UNIX) && !OS(SYMBIAN)
 
 #include <unistd.h>
 #include <sys/mman.h>
index 421e9b555e8c5de35754a21a5a398709b562fbc0..bda14ac3abe56e86729b50c38a976c094b2006d3 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "MarkStack.h"
 
-#if PLATFORM(SYMBIAN)
+#if OS(SYMBIAN)
 
 #include <e32hal.h>
 
index 63a51aecc0ad6d9e18b9a273ff470c5e0665a0a6..a171c788c58b73db1fafbf1b5ac6d393b1d90525 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "MarkStack.h"
 
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
 
 #include "windows.h"
 
index 205f4697634a9d7e308f2b5d5d24ebab72d7a71e..6498564dadfe4053a28f24380df2407b3873abaf 100644 (file)
@@ -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;
index 2a056c9d5cd19e048612487cf45cef414fcd46cc..6883888d89b66987d147cea166e73b1ecc89b123 100644 (file)
@@ -33,9 +33,9 @@
 #include "CallFrame.h"
 #include "JSGlobalObject.h"
 
-#if PLATFORM(DARWIN)
+#if OS(DARWIN)
 #include <mach/mach.h>
-#elif PLATFORM(WIN_OS)
+#elif OS(WINDOWS)
 #include <windows.h>
 #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;
index e04b798e2c0d3637d3c9871f439d2a91c6ab56f0..cb3803ffa2e5d464d2d19aed9395c03437ec21f6 100644 (file)
@@ -289,7 +289,7 @@ UString UString::from(long long i)
         *--p = '0';
     else if (i == std::numeric_limits<long long>::min()) {
         char minBuf[1 + sizeof(i) * 3];
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
         snprintf(minBuf, sizeof(minBuf) - 1, "%I64d", std::numeric_limits<long long>::min());
 #else
         snprintf(minBuf, sizeof(minBuf) - 1, "%lld", std::numeric_limits<long long>::min());
index 6c5e2e3069b0703b580ba79b8af119819ee91f7c..cadbc915dc3bbe297481f13354581d5edb43d7e8 100644 (file)
@@ -35,7 +35,7 @@
 #include <CoreFoundation/CFString.h>
 #endif
 
-#if COMPILER(MSVC) && !PLATFORM(WINCE)
+#if COMPILER(MSVC) && !OS(WINCE)
 #ifndef WINVER
 #define WINVER 0x0500
 #endif
@@ -46,7 +46,7 @@
 #include <crtdbg.h>
 #endif
 
-#if PLATFORM(WINCE)
+#if OS(WINCE)
 #include <winbase.h>
 #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);
index e8005786b983255e8c955e2ea6a0ef41b85137d6..9e2da7c006b63c91e1888640d0f05836cc631f9f 100644 (file)
@@ -50,7 +50,7 @@
 #include <inttypes.h>
 #endif
 
-#if PLATFORM(SYMBIAN)
+#if OS(SYMBIAN)
 #include <e32def.h>
 #include <e32debug.h>
 #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 <windows.h>
 #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
index b36cae5abb060d887dc6f5a4d7688d0a8c75e744..b2728747bbb51559f10b74a128e44065459d23c0 100644 (file)
@@ -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 <time.h>
 
 #if USE(QUERY_PERFORMANCE_COUNTER)
-#if PLATFORM(WINCE)
+#if OS(WINCE)
 extern "C" time_t mktime(struct tm *t);
 #else
 #include <sys/timeb.h>
@@ -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;
index 472770ead0ad0e7e39ad21171442c9df8bc6f030..334a6e98a5c46685e394ade369cc1f9d547ed5f5 100644 (file)
@@ -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);
index 1f9c0e49c2376749b84986f9d3faf3f7d9189c0d..202a5571c08dbe1fcbba850896d9acf64c076b15 100644 (file)
@@ -88,7 +88,7 @@
 #include <errno.h>
 #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];
index 21060a53298e58e75f2d3c7f191444ff13e5c614..a5633ea96739c35721e2f7a3cc0126a645ef585b 100644 (file)
@@ -192,7 +192,7 @@ TryMallocReturnValue tryFastZeroedMalloc(size_t n)
 #if FORCE_SYSTEM_MALLOC
 
 #include <stdlib.h>
-#if !PLATFORM(WIN_OS)
+#if !OS(WINDOWS)
     #include <pthread.h>
 #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 <stdarg.h>
 #include <stddef.h>
 #include <stdio.h>
-#if PLATFORM(UNIX)
+#if OS(UNIX)
 #include <unistd.h>
 #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 <wtf/HashSet.h>
 #include <wtf/Vector.h>
@@ -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 <class Recorder>
   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
 
index 9a35c75280d72721d98001d2af276238151bc9e0..d379291277391671ef66219c3eaf350b766eaffd 100644 (file)
@@ -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))
index ee2110eca4f84ae45afa81cf7fb75692f081d7cf..9ea57fd771b54585ba3ef98ca530559936e21c5b 100644 (file)
 #include <math.h>
 #include <stdlib.h>
 
-#if PLATFORM(SOLARIS)
+#if OS(SOLARIS)
 #include <ieeefp.h>
 #endif
 
-#if PLATFORM(OPENBSD)
+#if OS(OPENBSD)
 #include <sys/types.h>
 #include <machine/ieee.h>
 #endif
 
 #if COMPILER(MSVC)
-#if PLATFORM(WINCE)
+#if OS(WINCE)
 #include <stdlib.h>
 #endif
 #include <limits>
@@ -62,7 +62,7 @@ const double piOverFourDouble = M_PI_4;
 const float piOverFourFloat = static_cast<float>(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); }
index cff18dc92a7bb81a5a4e5c2f8a8e3ad70cfdd631..b9d97d88b55e2280b9daa13f06e41524602b111d 100644 (file)
@@ -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
 
 
 
-/* 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 <AvailabilityMacros.h>
 #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
 #define TARGETING_SNOW_LEOPARD 1
 #endif
 #include <TargetConditionals.h>
+
 #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) */
 #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
 #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
 
 /* 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
 #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 <QtGlobal>
 #   undef WTF_PLATFORM_BIG_ENDIAN
 #   undef WTF_PLATFORM_MIDDLE_ENDIAN
 #   include <ce_time.h>
 #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
 #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 */
 #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
 
 
 #if PLATFORM(WX)
 #define ENABLE_ASSEMBLER 1
-#if PLATFORM(DARWIN)
+#if OS(DARWIN)
 #define WTF_PLATFORM_CF 1
 #endif
 #endif
 #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
 #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
 #define HAVE_SYS_PARAM_H 1
 #endif
 
-#elif PLATFORM(QNX)
+#elif OS(QNX)
 
 #define HAVE_ERRNO_H 1
 #define HAVE_MMAP 1
 #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
 
 #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
 #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
 
index 52fb13084e310a69b25b31a6798ba9843cc5c473..74bb45c6928c47696e021bc926adbd1dd42cb9c9 100644 (file)
@@ -34,7 +34,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 
-#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<double>(bits) / (static_cast<double>(std::numeric_limits<uint32_t>::max()) + 1.0);
-#elif PLATFORM(DARWIN)
+#elif OS(DARWIN)
     uint32_t bits = arc4random();
     return static_cast<double>(bits) / (static_cast<double>(std::numeric_limits<uint32_t>::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<double>(fullRandom)/static_cast<double>(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);
index a66433e61dcbe5d7d92d7198189e961be49e8740..ae414c0e32a7f5f395138935fe26f496c9039613 100644 (file)
 #include <sys/time.h>
 #endif
 
-#if PLATFORM(UNIX)
+#if OS(UNIX)
 #include <sys/types.h>
 #include <unistd.h>
 #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<unsigned>(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);
index a24397da2f4c78511af747bdbdc05bbaf7c154db..b1ec09f095ce570de85cd5f1b40aa6d1b7334fef 100644 (file)
@@ -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)
 {
index cbec7de5dfbe8e48dcbed7c4accbe7b7211782cc..632f8e442850f711cbc2ec5625be34d5c904948c 100644 (file)
@@ -47,7 +47,7 @@
 #include <sys/types.h>
 #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;
index 659bb0e64d9f47c4ff108919b994e110fdfe34e4..4d029195ec1e5ad1e7687ab6eb0e1e2e71d657b5 100644 (file)
@@ -47,7 +47,7 @@
 #include <sys/types.h>
 #endif
 
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
 #include "windows.h"
 #else
 #include <errno.h>
index b6f5fd3c8b95512d15c18f06b4e9d4f74ddfb67e..fe2f8f3cf85181c2135d4895b68665ab8601aab6 100644 (file)
 #include <pthread.h>
 #elif PLATFORM(QT)
 #include <QThreadStorage>
-#elif PLATFORM(WIN_OS)
+#elif OS(WINDOWS)
 #include <windows.h>
 #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<T>* owner) : value(value), owner(owner) {}
 #if PLATFORM(QT)
@@ -95,7 +95,7 @@ private:
     pthread_key_t m_key;
 #elif PLATFORM(QT)
     QThreadStorage<Data*> m_key;
-#elif PLATFORM(WIN_OS)
+#elif OS(WINDOWS)
     int m_index;
 #endif
 };
@@ -157,7 +157,7 @@ inline void ThreadSpecific<T>::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<T>::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.
index d72a08e993dc7c378080634e666f8bb9fa97bec9..3a6ae59edf7fa35e413fc68038a5bb8bf53d87cc 100644 (file)
@@ -61,7 +61,7 @@
 
 #include "Platform.h"
 
-#if PLATFORM(WINCE)
+#if OS(WINCE)
 #include <windows.h>
 #endif
 
 #include <wtf/Locker.h>
 #include <wtf/Noncopyable.h>
 
-#if PLATFORM(WIN_OS) && !PLATFORM(WINCE)
+#if OS(WINDOWS) && !OS(WINCE)
 #include <windows.h>
-#elif PLATFORM(DARWIN)
+#elif OS(DARWIN)
 #include <libkern/OSAtomic.h>
-#elif PLATFORM(ANDROID)
+#elif OS(ANDROID)
 #include <cutils/atomic.h>
 #elif COMPILER(GCC)
 #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))
@@ -144,7 +144,7 @@ typedef GOwnPtr<GCond> 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<long*>(addend)); }
 inline int atomicDecrement(int* addend) { return InterlockedDecrement(reinterpret_cast<long*>(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<long volatile*>(addend)); }
 #endif
 
-#elif PLATFORM(DARWIN)
+#elif OS(DARWIN)
 #define WTF_USE_LOCKFREE_THREADSAFESHARED 1
 
 inline int atomicIncrement(int volatile* addend) { return OSAtomicIncrement32Barrier(const_cast<int*>(addend)); }
 inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Barrier(const_cast<int*>(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); }
index fbd7164600fcd0bc1143b1b780a4856256606b09..9f6ff7c45919aa167c5add3868129e3a2a289454 100644 (file)
@@ -45,7 +45,7 @@
 #include <sys/time.h>
 #endif
 
-#if PLATFORM(ANDROID)
+#if OS(ANDROID)
 #include "jni_utility.h"
 #endif
 
@@ -55,7 +55,7 @@ typedef HashMap<ThreadIdentifier, pthread_t> 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);
index cccbda14ef667542a60a67b7ebabe23e7a2ada63..1fd84d2bdecb6b959bc8ddc48da0df017438b18e 100644 (file)
 #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 <process.h>
 #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<HANDLE>(_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);
index 519f5189492bc64a5b976807ca915d33b66aa6a4..1ec79d9e1df749821c63b97aafc5130d13d994ec 100644 (file)
@@ -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 <mach/vm_statistics.h>
 
 #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
index 6376bb31fe07b8ba1a602ce3efa76800ee5ae898..a1753a4c096f0502aed3cc75c4c2290dffed6fc0 100644 (file)
@@ -36,7 +36,7 @@
 #include <unicode/ucol.h>
 #include <string.h>
 
-#if PLATFORM(DARWIN)
+#if OS(DARWIN)
 #include "RetainPtr.h"
 #include <CoreFoundation/CoreFoundation.h>
 #endif
@@ -59,9 +59,9 @@ Collator::Collator(const char* locale)
 
 std::auto_ptr<Collator> 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<CFLocaleRef> currentLocale(AdoptCF, CFLocaleCopyCurrent());
     CFStringRef collationOrder = (CFStringRef)CFLocaleGetValue(currentLocale.get(), kCFLocaleCollatorIdentifier);
 #else
index d583c12dc8f613db8fe61db8f6f2919e458bd08a..ee70b59b670aa1b4b3fe930161fc299f2acd7f97 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "Assertions.h"
 #include "Threading.h"
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
 #include <windows.h>
 #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);
index 096541dc0bec55fced8cd77fd93043ef02500492..768cf87a95715fbaf2504cbe07dcc3ea7a022b5c 100644 (file)
@@ -1,3 +1,166 @@
+2010-01-04  Maciej Stachowiak  <mjs@apple.com>
+
+        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  <cfleizach@apple.com>
 
         Reviewed by Darin Adler.
index 263b67829fbeb8a1b9325b4a1661abc8081d4ce2..d6b9c889915a2dc80b3b88597f00beb457645484 100644 (file)
@@ -40,7 +40,7 @@
 
 #if PLATFORM(MAC)
 #include <wtf/RetainPtr.h>
-#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<AccessibilityObjectWrapper> m_wrapper;
-#elif PLATFORM(WIN) && !PLATFORM(WINCE)
+#elif PLATFORM(WIN) && !OS(WINCE)
     COMPtr<AccessibilityObjectWrapper> m_wrapper;
 #elif PLATFORM(GTK)
     AtkObject* m_wrapper;
index a880427cdcff1447c6115ce161cb5fec00f3e83d..16f5a8f7657ff84f005acf5f531a0394b2648281 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <wtf/Platform.h>
 
-#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."
 #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
 
 #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,
index 54387fcdfdf1eb6c6bdb0e4c7dc1c4c2cbcbc826..0e84a09869ea99001d4bb97eec20414a7ba0688f 100644 (file)
 
 // 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();
index 5bc5ac1940f325860b8ebad9a6ed9dce24073ab6..42a20d796a6299b2fb0117a628d634ff8db07f31 100644 (file)
@@ -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"));
index 51b1e97b44a65caef9379f9b49df1d6c9c6b38e2..64ab24f5d7f5fcc156cde2fa4e4e79a4d8c16232 100644 (file)
@@ -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
 
index ee0f4ca38902ace1c188b0f598747573a9e722b9..7a71d02d5848479124ecd91f79b8596219cd71f8 100644 (file)
@@ -43,7 +43,7 @@
 #if PLATFORM(QT)
 #include <QDateTime>
 // 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 <pthread.h>
 #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 */ 
index 40bd714c0e6dd8157f141438bf2c5bb49ddbe3d6..8e83a7ecda1147defc7a5baafe9dcb0c6ee78ca1 100644 (file)
@@ -27,7 +27,7 @@
 #if PLATFORM(QT)
 #include <QDateTime>
 // 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 <pthread.h>
 #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 */ 
index 1481549a5a7259d8f56a7ece868714fbcf0e69d0..223a3f7652f55ff3bbe6d4b3ff88d802d098cce1 100644 (file)
@@ -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;
index 4c370a69e391542e9f3f7353165be69bfb3a69b6..54a7f067847323c430fa0443c144fdecd6f191b0 100644 (file)
@@ -83,7 +83,7 @@
 #include <wtf/RefCountedLeakCounter.h>
 #include <wtf/StdLibExtras.h>
 
-#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN))
+#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
 #import <Carbon/Carbon.h>
 #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) {
index ba4d33617e8df1ded934623acb7f5a7f81ec3f06..341db66cf6172710093f2c275b6b456ffda52c39 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "NetworkStateNotifier.h"
 #include "PlatformString.h"
-#if PLATFORM(LINUX)
+#if OS(LINUX)
 #include "sys/utsname.h"
 #include <wtf/StdLibExtras.h>
 #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;
index 95c6aa1c50d07f53a6095b39bf4a095de325deec..ad611d13b71f7b974c0a20c425132c9799a6d88e 100644 (file)
@@ -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; }
index 10f228c30a3b3d530652035566827b02809d574f..3873c89fb787712222c71eff0e572b83966233a0 100644 (file)
@@ -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;
index 673ba8f995e85ec2be25660bfbaae50ee2f3a2d4..9f00b0dc8d8232320b318a69f4498faeefa3e3e8 100644 (file)
@@ -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
     };
index 18688fd3c3a6dcfc04cd908d65525cb63c4a03d2..7b0958d25ecc0ca6702bec435550955af3c4f9e7 100644 (file)
@@ -31,7 +31,7 @@
 #include "SelectionController.h"
 #include <wtf/RefPtr.h>
 
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
 #include <windows.h>
 #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;
index ac76a292e6278735e065a49475587e535ab0092b..ff161af4b54547f43183bdd40faabc6a56910fc5 100644 (file)
@@ -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.
index 50e50fb13e910b095b0f05d30ef6b268cc7f2dd1..5511209609c6bfffeab211e3eb63a36c78fff1f4 100644 (file)
@@ -88,7 +88,7 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const
 
 PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
 {
-#if PLATFORM(WINCE)
+#if OS(WINCE)
     return 0;
 #else
     COMPtr<WCDataObject> dataObject;
index 3220d51456c4252d275d2945dbc4c489de0197a7..c5395a9cffbb6b1d418dd92421eb313d73e32f5f 100644 (file)
@@ -54,7 +54,7 @@
 
 typedef const struct __CFData* CFDataRef;
 
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
 // These are to avoid including <winbase.h> 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 <winbase.h>. Chromium tries to
 // avoid using Windows headers in headers.  We'd rather move this into the .cpp.
index 48582a87e085064d76ee6817fb24606898aeca40..04ee0716d090531ace9593e961660596523f8388 100644 (file)
@@ -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)
 
 }
 
index c487eb994bfcec84891a4870c972d896f87b1c74..94e58da9f961163673f53b45d05978dc71760716 100644 (file)
@@ -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; }
index d30b9a8dd04f134f2b5c3d69ffda1e9b43ad282a..92b4c13c200bc0c8a746e1932b68428de10158cf 100644 (file)
@@ -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(
index 6c1e050c554919d61c6e397f1cd7922061e4eee4..32f7d507fb5575548d12b9ebfecb48859648a451 100644 (file)
@@ -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("<meta charset='utf-8' id='webkit-interchange-charset'>") + 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);
index 7efcb3cf024f4163fff5bddd7ae19b334049567b..5d9ed0549c52d6434b16cb1a3c43bc68a07391b8 100644 (file)
@@ -36,7 +36,7 @@
 
 namespace WebCore {
 
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
 void replaceNewlinesWithWindowsStyleNewlines(String& str)
 {
     static const UChar Newline = '\n';
index c59708956118755f0e6bbcaf1736ca20b3cddea7..23fd29cf4cab695f8695116b00568139df45dad9 100644 (file)
@@ -33,7 +33,7 @@ namespace WebCore {
 class KURL;
 class String;
 
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
 void replaceNewlinesWithWindowsStyleNewlines(String&);
 #endif
 void replaceNBSPWithSpace(String&);
index ce06e55a06baed9a2cfd8b9631c50a96823ef798..9213718270febc1bb8b7477423ff79b061b5a4b1 100644 (file)
@@ -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("<meta charset='utf-8' id='webkit-interchange-charset'>") + 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<DocumentFragment> 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, ("<meta charset='utf-8' id='webkit-interchange-charset'>"));
         if (markup.startsWith(forceUtf8String))
             markup = markup.substring(forceUtf8String.length());
index ae55afee824626152220b71cc779de088341e7e9..74643f7764deea50e504a65bc727e51c28ce728f 100644 (file)
@@ -27,9 +27,9 @@
 #include "config.h"
 #include "PlatformKeyboardEvent.h"
 
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
 #include <windows.h>
-#elif PLATFORM(DARWIN)
+#elif OS(DARWIN)
 #import <Carbon/Carbon.h>
 #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();
index 7298b27446e89c47d56e29e23a354590bf57506a..b1f8f3bf65b6cbcba8a3585b846dda76b1f8f593 100644 (file)
@@ -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);
index 614ebaf9a2422ee24229806669e2f154fc84e8bf..a7436722a4cdb03703bc5d853c4cf950f553bfd8 100644 (file)
@@ -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<BitmapImage> 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
         }
index 45a1e832da9c39fe4cd5ee922f695e34f0b7f47d..6b037ff86aeea367e672de24ad417c8c428cfa76 100644 (file)
@@ -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
index 2dc854df88c196431f62b23cbb2ce196174e3900..b4772c7742c4211c391db78ad4dcadc1635330ee 100644 (file)
@@ -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
index 5a84fd1a15780422d26f4071ff652a00b5b59fe9..1bc3423a3393b4f77f1e577b98b353e3ef4519b9 100644 (file)
@@ -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
index bb833198da0e5c34988ecf0ca40cbe8c670bad7a..2aa68f12ee8b6ba0c5c12ec5c80bc83348a25601 100644 (file)
@@ -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"));
index 4a6222bf3384c8744f4326f0a2015da13110dd04..9b41e38cd9fde98704eb2fc1a09538194b691d64 100644 (file)
@@ -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
index dd945e5d316a7b10084d8b6bf0e9404374fe116f..0c9046c8b0732d4ac4cc1736da35079a4b7d3a4b 100644 (file)
@@ -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);
index 04491a7ce12a2b98d37b4d5cfb5441fe93aad845..edb804cd931a5fab1d6c7c71d539e7c256164022 100644 (file)
@@ -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);
index 0e39e73302dc5ec9daa84d44836910639647b3f1..821b4128a76e2b27f438bf4406b2db4578a45c94 100644 (file)
@@ -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; }
index d89bd28d95183db21131c89631825aa3346e1bd5..652c1cb56fd114e7f7d98b819ecb482bbd8f074e 100644 (file)
@@ -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())
index 8fdcaf72d234c7167c79d4fa94c7b00d5b180cdd..88e41e60788011dc9ee9f4a70282628ed0b414d3 100644 (file)
@@ -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<SharedBitmap>);
         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; }
index aad8dd4073561ec7238bd8c1ace65c6b3e9e88bd..94629b2a0119b5a1b197d674220eaa31b99798f2 100644 (file)
@@ -33,7 +33,7 @@
 #include <wtf/PassOwnPtr.h>
 
 // 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
 
index 3559abe95180500fe39ae552c50f9f77a04dfe5f..258fd0f695936902153baf685cc5c48312aa8812 100644 (file)
@@ -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<SharedBitmap> NativeImagePtr;
 #endif
 #endif
index 34f7fd857756f9f916f1632bfb6fd04ede943395..e3633dfefde98d46ee408efc4b1a63a6564fefbe 100644 (file)
@@ -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
 
index 78d766378d1b1bcebb3a8e9381616146c125b112..b37351dac91bd425f9f29d45189dccccf161b2fe 100644 (file)
@@ -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"
index 6618fb7a7d0cfe238d4d5d342aa539a3017d285c..bf4cd9d8381c77da47f1d450bbd2848a7ac7469b 100644 (file)
@@ -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;
 }
index aa0a3570276affae758d332ae29623a3f7e01901..f7f612abd03a6a258630f658bb3c441739af711e 100644 (file)
@@ -56,7 +56,7 @@ typedef wxBrush* PlatformPatternPtr;
 #elif PLATFORM(HAIKU)
 #include <interface/GraphicsDefs.h>
 typedef pattern* PlatformPatternPtr;
-#elif PLATFORM(WINCE)
+#elif OS(WINCE)
 typedef void* PlatformPatternPtr;
 #endif
 
index 7d787566ee1f47f575212a988339d5510244b5c5..1a388bed7f0103258cbcb004ce473412651e505e 100644 (file)
@@ -35,7 +35,7 @@
 typedef struct OpaqueATSUStyle* ATSUStyle;
 #endif
 
-#if PLATFORM(WIN) && !PLATFORM(WINCE)
+#if PLATFORM(WIN) && !OS(WINCE)
 #include <usp10.h>
 #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
index 40aacc5c3acc82f7fcf06b9df9d2ea0ee9385e8e..e514fa358a35e95a69d4cf7c03c3c7b57b82e64c 100644 (file)
@@ -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)
 
 }
 
index 39f06a623828a64a25232d96b0950868c4bd300d..19bc2c25644530188060621f9351dd386fcd6a64 100644 (file)
@@ -43,7 +43,7 @@
 #include <wtf/OwnArrayPtr.h>
 #include <wtf/RetainPtr.h>
 
-#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.
index a902057fe4398fe07d2770ab694d96016e069fd2..6432e171eb190d7f83c5987935ef89bc33b5d272 100644 (file)
 #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 <objbase.h>
-#elif PLATFORM(LINUX)
+#elif OS(LINUX)
 #include <cstring>
 #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<SharedBuffer> 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)
index a42f1ecad0ea8dc56fb91833692f4494be6cf9d5..e1fbd483176d2fe7e721c07fec46274d24df3bc2 100644 (file)
 #include "FontRenderingMode.h"
 #include <wtf/Noncopyable.h>
 
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
 #include "PlatformString.h"
 #include <windows.h>
-#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
 };
index c6f19126e116b9ace4fa5573d939245ae50b2a1e..871fec8e9e2b12d74e866950073c6c0f92d2d60c 100644 (file)
@@ -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
 
index 3a6016072b31ffba11d8c7649499e3284acf23ce..12ae09d931d4386478e3e0ea2093ed21ab7d535f 100644 (file)
@@ -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)
index 4c753142ce2ccca8640cd8b0da751b554e422122..0ef1b2b92b37f25f5d820b7126c3a168ccf1452b 100644 (file)
@@ -36,7 +36,7 @@ struct BigEndianUShort;
 struct EOTPrefix;
 class SharedBuffer;
 
-#if PLATFORM(WINCE)
+#if OS(WINCE)
 typedef unsigned __int8 UInt8;
 #endif
 
index 49d7a27b201e8ecff21cdca69fc296bf24bd3432..ae31d4c7c57a7ae2e2fa50c26aa8046424f0770e 100644 (file)
@@ -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);
 
index 9a82911ba748e9af04ae38387c242809f2a7d7ff..fea1448574811f9216bac49ff642bcb6a068dc31 100644 (file)
@@ -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> BitmapImage::create(HBITMAP hBitmap)
 {
     return BitmapImage::create(new QPixmap(QPixmap::fromWinHBITMAP(hBitmap)));
index 877da89a4af8dcf7c4e061c1312eeafdd7715004..81fad7b93f3576219afec44b99a5694ffad06db6 100644 (file)
@@ -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
 }
index c36f1ced67db756d4539b002343a42d2edd846ef..4ea3d7addd2fc8e39fc1b85613194c10b87cc788 100644 (file)
@@ -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
 
index 4900dfb10caccad1465c6e17764a2014ed884911..92a187097ffa8da2bae8647e81d2db877722b1bb 100644 (file)
@@ -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
index 53590bf6af16f7833545107cb3dc49f76de24b76..e44526212ff3c2cfe40aab863e1307ab95a47819 100644 (file)
@@ -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
 };
index d71ca001f243069747a47a87be4b93492b63635e..56b46de42f2956104a0ecb263e8669612f27039c 100644 (file)
@@ -27,7 +27,7 @@
 #include <tchar.h>
 #include <windows.h>
 
-#if PLATFORM(WINCE)
+#if OS(WINCE)
 // SHGFI_SHELLICONSIZE is not available on WINCE
 #define SHGFI_SHELLICONSIZE         0
 #endif
@@ -63,7 +63,7 @@ PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>& 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);
index 6e67e68e1ba75dae16980b91067730bce963c3c3..f5dfe00194d515a275e70dca090ddc2d569c3c6b 100644 (file)
@@ -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())
index fcdc8634d239facc6d077f17be13a340a474597e..b8bbd6088bc76752bc369f7a020791d5b07f2657 100644 (file)
@@ -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);
index 9ae03fc5ff16dc7e8f47845b9b12a64999624506..9691c381f41594f9af85584614c1bd2083a9063d 100644 (file)
@@ -41,7 +41,7 @@
 #include "JPEGImageDecoder.h"
 #include <stdio.h>  // Needed by jpeglib.h for FILE.
 
-#if PLATFORM(WINCE)
+#if OS(WINCE)
 // Remove warning: 'FAR' macro redefinition
 #undef FAR
 
index 74edfeffbf28e3c17092e8d71a238358349df25f..bcae67ff53149737bc1b6973932d0175c65cc078 100644 (file)
@@ -49,7 +49,7 @@
 #include <wtf/Threading.h>
 #include <wtf/Vector.h>
 
-#if !PLATFORM(WIN_OS)
+#if !OS(WINDOWS)
 #include <sys/param.h>
 #define MAX_PATH MAXPATHLEN
 #endif
index 5a229b84ce515c30f2fc743f6753762048bf75c0..da16f4a7e185236ea1e7200caa8b5e11c8999469 100644 (file)
@@ -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
index 8342b0bdfb9696eeab037df77fd2eb131a2b5be7..04b04ab60a743d1898baf0c35ab428ea9464bb72 100644 (file)
@@ -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);
index ec9a8b04623a120ede5c5b4e276e56b22618b671..4a30d621fe8365b87693f58cf901367ca63aa72f 100644 (file)
@@ -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> textCodec = newTextCodec(*this);
     return textCodec.get() ? textCodec->encode(characters, length, handling) : CString();
index a4be52022274f26c50735dffe2c3cb53932b50b5..00ad2c9853e2f33512161ab53e42cf4c424f1a5b 100644 (file)
@@ -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
index eb4bae7b689c7b98b02573b152002deb572f3aa1..57c132859af7109d45d03d9dc7a74d2a6bf288bc 100644 (file)
@@ -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];
index 71034f3b9de771e6839cc944152c15081ea47938..b6bcea8fd9e6f72c3ff61e14039a0ac95dd9f767 100644 (file)
@@ -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
index b3f75ccd2099afdb2584b43b02f65ec2766de9cb..21e6e12b692e1b636ff2bed82503a9511f840c48 100644 (file)
@@ -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;
index dc4dd2fcec4f77668634590027ee38de040eaba2..8b542f90ca44d7286bc0fb2738800c7eb467e8bc 100644 (file)
@@ -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)
index 8a0d7795516b20899a3918ca2717c1c323a32c0a..4af9e17f50d7d64e0b5e019e4973f0f92850d19b 100644 (file)
@@ -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
index f3b0ba8f57ba742073977f9d730b13d3640683af..0a8e8e82cfa72f8f8ed0ce073853248f5ad266ba 100644 (file)
@@ -42,7 +42,7 @@
 #include <tchar.h>
 #include <windows.h>
 #include <windowsx.h>
-#if PLATFORM(WINCE)
+#if OS(WINCE)
 #include <ResDefCE.h>
 #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<LPCREATESTRUCT>(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;
index 6ab4c27cfd259796d3dce229f2072399aa55b06a..8c25c3291ad90a39f676dc17c338a2aadff3332f 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 
 float userIdleTime()
 {
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
     LASTINPUTINFO lastInputInfo = {0};
     lastInputInfo.cbSize = sizeof(LASTINPUTINFO);
     if (::GetLastInputInfo(&lastInputInfo))
index 1ee87ae4266b23f281a9ca69d4c7223cdc67447c..50ac2ec5c922f8c8c95fdf76ec0ad10bd53b7475 100644 (file)
@@ -42,7 +42,7 @@
 #include <wx/filefn.h>
 #include <wx/filename.h>
 
-#if PLATFORM(DARWIN)
+#if OS(DARWIN)
 #include <CoreFoundation/CoreFoundation.h>
 #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
index fc8cef2c2451d71bc7f43bab5f2faf76e7a29ad3..5385b79eb767449eba4a0f15d4899e9a2168b256 100644 (file)
@@ -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<String>& paths) const
     }
 }
 
-#endif // !PLATFORM(SYMBIAN) && !PLATFORM(WIN_OS)
+#endif // !OS(SYMBIAN) && !OS(WINDOWS)
 
 }
index 8f2dfa990b312581290c58f2e9c4455766cd2d2d..250f025576aacfcf6924728926c015f2ddebb026 100644 (file)
@@ -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)
index d409ab60b88f03e0145e0703c7621ee3bce5dab8..a3937f16090c956c430e4f1c569605ffe2519c6c 100644 (file)
@@ -36,7 +36,7 @@
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
 
-#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);
index 6b67ceee92c7a52be544ed2b7a92338bedcd541a..e79eb8801f185303791442bcc679d2df02762c8b 100644 (file)
@@ -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;"
index 5b4461d8be590e0cf855b5fd3b3d40b0f9acf260..dbbb94df83a8400deb48996b63cf0bbc631ccb2a 100644 (file)
@@ -46,7 +46,7 @@
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 
-#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<Image> 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<PluginMessageThrottlerWin> 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;
index 634b2a11361cdfadca8bdce87f98934da1c04e49..71bcdb545cc74999a5de899568f76a0d6eff7402 100644 (file)
@@ -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<String>& directories)
 
 static inline void addWindowsMediaPlayerPluginDirectory(Vector<String>& 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<String>& directories)
 {
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
     WCHAR systemDirectoryStr[MAX_PATH];
 
     if (GetSystemDirectory(systemDirectoryStr, _countof(systemDirectoryStr)) == 0)
index dc9ec17bd9c8a6c056bf086ca76026dc9d61a0d6..233b10c7656875a71278e02e1329be05978665d2 100644 (file)
@@ -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");
index 763536cf7807989c77b48f7b6363aeb1ded429f9..9ab68b5e972d4ce9c3d7118fd011524821dc1bb9 100644 (file)
@@ -72,7 +72,7 @@
 #include <runtime/JSValue.h>
 #include <wtf/ASCIICType.h>
 
-#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
 // <http://www.fengyuan.com/article/wmprint.html>.
 // 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<FrameView*>(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<FrameView*>(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);
index 6784b122f7b227c5d02005b3340552577646464d..c03c5598a694ad3708e448ecb621d2ddbd041bac 100644 (file)
@@ -1,3 +1,38 @@
+2010-01-04  Maciej Stachowiak  <mjs@apple.com>
+
+        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  <darin@chromium.org>
 
         Reviewed by Eric Seidel.
index 9700e1a943505b02c036e1c7cd33d15e290d3743..0fd08253f01aaede25958db867f273e911558b06 100644 (file)
 #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,
index 5db8ff7b133ad04447ec172399c6fe1e738ca6eb..e035e6a576f514a4b1da33c72b849291b8664652 100644 (file)
@@ -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-<x>).
         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
index 3ca8e8deaa2179766e073973ec0f2b8556ac5f04..cdeebed053151be367c2bdf62ac18ed96abb3864 100644 (file)
@@ -1325,7 +1325,7 @@ PassRefPtr<Widget> 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
index 020dc05e9fe6a93ec1848f63febb116d2b56bffe..2130b4912907d3739d95e0ef9d7d48aa8f6042fb 100644 (file)
@@ -56,7 +56,7 @@
 #include <stdio.h>
 #include <wtf/FastMalloc.h>
 
-#if PLATFORM(WIN_OS)
+#if OS(WINDOWS)
 #include <windows.h>
 #endif
 
 #include "NativeImageSkia.h"
 #endif
 
-#if PLATFORM(DARWIN)
+#if OS(DARWIN)
 #define USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER
 #endif
 
-#if PLATFORM(LINUX)
+#if OS(LINUX)
 #include <dlfcn.h>
 #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;
index 526c8f5ace7b23171bb8751cfafa15c57e4ad532..e76825e2e459c3e829fe6d3729439b8064f3fd97 100644 (file)
 #include <wtf/CurrentTime.h>
 
 
-#if PLATFORM(DARWIN)
+#if OS(DARWIN)
 #include "LocalCurrentGraphicsContext.h"
 #endif
 
-#if PLATFORM(LINUX)
+#if OS(LINUX)
 #include <gdk/gdk.h>
 #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
index d668dd722ce860e66a2bf991e74918656ac06afd..86cac26cabe5515dc3cc93e4d1b50fa17af5da35 100644 (file)
@@ -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
index 34866b5cbea9a1bc016a31db1e0ea6515c4c3005..c64afa733ce5f015c6ce1acef7de6d09463e7a29 100644 (file)
 #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)
index d5714480cde5babfb1c810a67ecc2b790203ce29..796ba8f5f43f7c8df69727dcf3df634d6c68d667 100644 (file)
@@ -1,3 +1,15 @@
+2010-01-04  Maciej Stachowiak  <mjs@apple.com>
+
+        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  <mjs@apple.com>
 
         Reviewed by Adam Barth.
index b72198a6414584549e8fe555592e02ad14808b38..1e2f8cc7551e75bcdbffe0a230ee122e233896c0 100644 (file)
@@ -37,7 +37,7 @@
 #include "PlatformString.h"
 
 #include <glib/gi18n-lib.h>
-#if PLATFORM(UNIX)
+#if OS(UNIX)
 #include <sys/utsname.h>
 #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");
 
index 98afbf701918416fc978f081a4fbcc79ce8efc20..493297e3290e65b13503b9763bdc362d44b4b938 100644 (file)
@@ -1,3 +1,15 @@
+2010-01-04  Maciej Stachowiak  <mjs@apple.com>
+
+        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  <chris.jerdonek@gmail.com>
 
         Reviewed by Eric Seidel.
index c11c5f6d55172b1917b4611925956b649bbc0e3f..8366e89d8e2922a67714aa1b8ea7d168786a5b1a 100644 (file)
@@ -46,7 +46,7 @@
 
 #include <string>
 
-#if !PLATFORM(OPENBSD)
+#if !OS(OPENBSD)
 std::wstring urlSuitableForTestResult(const std::wstring& url);
 #endif
 
index 063eeea564bc096616e53861a7524db7c9993ffd..33dee6d8ebdbc215a9e5289b637bbbd91fc2927f 100644 (file)
@@ -32,7 +32,7 @@
 #include <wtf/FastMalloc.h>
 #endif
 
-#if PLATFORM(WIN_OS) && !COMPILER(GCC)
+#if OS(WINDOWS) && !COMPILER(GCC)
 #define JS_EXPORTDATA __declspec(dllimport)
 #define WEBKIT_EXPORTDATA __declspec(dllimport)
 #else