JavaScriptCore:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Aug 2006 21:55:57 +0000 (21:55 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Aug 2006 21:55:57 +0000 (21:55 +0000)
        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
          Make WebCore compile with -Wundef

          * Adds -Wundef flag to Xcode project
          * Converts #ifs to #ifdef and #ifndefs where needed.
          * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
            to fix a warning from within Bison.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * bindings/jni/jni_jsobject.cpp:
        (JavaJSObject::getSlot):
        (JavaJSObject::setSlot):
        * bindings/npapi.h:
        * bindings/objc/objc_class.mm:
        (KJS::Bindings::ObjcClass::methodsNamed):
        (KJS::Bindings::ObjcClass::fieldNamed):
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::invokeMethod):
        * bindings/objc/objc_runtime.mm:
        (ObjcMethod::getMethodSignature):
        (ObjcField::name):
        (ObjcField::type):
        * kjs/grammar.y:
        * kjs/identifier.h:

JavaScriptGlue:

        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
          Make WebCore compile with -Wundef

          * Adds -Wundef flag to Xcode project

        * JavaScriptGlue.xcodeproj/project.pbxproj:

WebCore:

        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
          Make WebCore compile with -Wundef

          * Adds -Wundef flag to Xcode project
          * Converts #ifs to #ifdef and #ifndefs where needed.
          * Replaces #ifdef WIN32 with #if PLATFORM(WIN_OS) or PLATFORM(WIN)
            (and in one instance in config.h with #if !COMPILER(MSVC))
          * Added #define YYMAXDEPTH 10000 in XPathGrammar.y and CSSGrammar.y
            to fix a warning from within Bison.
          * Cleaned up style a little in surrounding code.

        * WebCore.xcodeproj/project.pbxproj:
        * bridge/mac/WebCoreAXObject.mm:
        (-[WebCoreAXObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
        * config.h:
        * css/CSSGrammar.y:
        * css/MediaFeatureNames.cpp:
        * css/MediaFeatureNames.h:
        * css/cssparser.cpp:
        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::setActive):
        * dom/Element.cpp:
        (WebCore::Element::attach):
        * dom/Element.h:
        * dom/EventNames.cpp:
        * dom/EventNames.h:
        * dom/NamedAttrMap.h:
        * dom/Position.cpp:
        * dom/QualifiedName.cpp:
        * dom/QualifiedName.h:
        * dom/Range.h:
        * dom/XMLTokenizer.cpp:
        (WebCore::XMLTokenizer::error):
        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::scriptHandler):
        (WebCore::HTMLTokenizer::scriptExecution):
        (WebCore::HTMLTokenizer::parseTag):
        (WebCore::HTMLTokenizer::continueProcessing):
        (WebCore::HTMLTokenizer::write):
        (WebCore::HTMLTokenizer::timerFired):
        (WebCore::HTMLTokenizer::notifyFinished):
        * kcanvas/device/quartz/KCanvasFilterQuartz.h:
        * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
        * ksvg2/css/SVGRenderStyle.h:
        * ksvg2/css/SVGRenderStyleDefs.h:
        * ksvg2/scripts/make_names.pl:
        * loader/CachedResource.h:
        * loader/LoaderFunctions.h:
        * loader/loader.h:
        * page/Frame.cpp:
        * page/FrameTree.cpp:
        * page/FrameView.cpp:
        (WebCore::FrameView::clear):
        (WebCore::FrameView::layout):
        (WebCore::FrameView::layoutTimerFired):
        (WebCore::FrameView::scheduleRelayout):
        (WebCore::FrameView::unscheduleRelayout):
        * platform/AtomicString.cpp:
        * platform/AtomicString.h:
        * platform/Cursor.h:
        * platform/DeprecatedArray.h:
        * platform/DeprecatedString.cpp:
        (WebCore::allocateHandle):
        (WebCore::initializeHandleNodeBlock):
        (WebCore::freeHandle):
        * platform/FloatPoint.h:
        * platform/FloatRect.h:
        * platform/FloatSize.h:
        * platform/GraphicsContext.h:
        * platform/Image.h:
        * platform/IntPoint.h:
        * platform/IntRect.h:
        (WebCore::IntRect::inflateX):
        (WebCore::IntRect::inflateY):
        * platform/IntSize.h:
        * platform/PlatformKeyboardEvent.h:
        * platform/PlatformMouseEvent.h:
        * platform/PlatformString.h:
        * platform/ResourceLoader.h:
        * platform/ResourceLoaderInternal.h:
        (WebCore::ResourceLoaderInternal::ResourceLoaderInternal):
        * platform/ScrollView.h:
        * platform/StaticConstructors.h:
        * platform/StreamingTextDecoderICU.cpp:
        (WebCore::StreamingTextDecoderICU::convert):
        * platform/StringImpl.h:
        * platform/Widget.h:
        * platform/mac/BlockExceptions.mm:
        * platform/mac/ColorMac.mm:
        (+[WebCoreControlTintObserver WebCore]):
        * platform/mac/FloatPointMac.mm:
        * platform/mac/FloatRectMac.mm:
        * platform/mac/FloatSizeMac.mm:
        * platform/mac/FontMac.mm:
        * platform/mac/GraphicsContextMac.mm:
        (WebCore::GraphicsContext::drawFocusRing):
        * platform/mac/IntPointMac.mm:
        * platform/mac/IntRectMac.mm:
        * platform/mac/IntSizeMac.mm:
        * platform/mac/WebCoreSystemInterface.h:
        * rendering/RenderBlock.h:
        * rendering/RenderTableCell.h:
        * rendering/bidi.cpp:
        (WebCore::appendRun):
        (WebCore::RenderBlock::layoutInlineChildren):
        * xml/XSLTProcessor.cpp:
        (WebCore::parseErrorFunc):
        * xpath/impl/XPathGrammar.y:

WebKit:

        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
          Make WebCore compile with -Wundef

          * Adds -Wundef flag to Xcode project
          * Converts #ifs to #ifdef and #ifndefs where needed.

        * Carbon/CarbonUtils.m:
        * Carbon/CarbonWindowAdapter.m:
        * Carbon/HIViewAdapter.m:
        (+[NSView bindHIViewToNSView:nsView:]):
        * Carbon/HIWebView.m:
        (HIWebViewEventHandler):
        * Misc/WebFileDatabase.m:
        (UniqueFilePathForKey):
        * Misc/WebNSWindowExtras.m:
        (swizzleInstanceMethod):
        * Misc/WebTypesInternal.h:
        * Plugins/WebNetscapeDeprecatedFunctions.c:
        * Plugins/WebNetscapeDeprecatedFunctions.h:
        * Plugins/WebNetscapePluginPackage.h:
        * Plugins/WebNetscapePluginPackage.m:
        (-[WebNetscapePluginPackage unloadWithoutShutdown]):
        (-[WebNetscapePluginPackage load]):
        * WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15781 268f45cc-cd09-0410-ab3c-d52691b4dbfc

94 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/bindings/jni/jni_jsobject.cpp
JavaScriptCore/bindings/npapi.h
JavaScriptCore/bindings/objc/objc_class.mm
JavaScriptCore/bindings/objc/objc_instance.mm
JavaScriptCore/bindings/objc/objc_runtime.mm
JavaScriptCore/kjs/grammar.y
JavaScriptCore/kjs/identifier.h
JavaScriptGlue/ChangeLog
JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/config.h
WebCore/css/CSSGrammar.y
WebCore/css/MediaFeatureNames.cpp
WebCore/css/MediaFeatureNames.h
WebCore/css/cssparser.cpp
WebCore/dom/ContainerNode.cpp
WebCore/dom/Element.cpp
WebCore/dom/Element.h
WebCore/dom/EventNames.cpp
WebCore/dom/EventNames.h
WebCore/dom/NamedAttrMap.h
WebCore/dom/Position.cpp
WebCore/dom/QualifiedName.cpp
WebCore/dom/QualifiedName.h
WebCore/dom/Range.h
WebCore/dom/XMLTokenizer.cpp
WebCore/html/HTMLTokenizer.cpp
WebCore/kcanvas/device/quartz/KCanvasFilterQuartz.h
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.h
WebCore/ksvg2/css/SVGRenderStyle.h
WebCore/ksvg2/css/SVGRenderStyleDefs.h
WebCore/ksvg2/scripts/make_names.pl
WebCore/loader/CachedResource.h
WebCore/loader/LoaderFunctions.h
WebCore/loader/loader.h
WebCore/page/Frame.cpp
WebCore/page/FrameTree.cpp
WebCore/page/FrameView.cpp
WebCore/platform/AtomicString.cpp
WebCore/platform/AtomicString.h
WebCore/platform/Cursor.h
WebCore/platform/DeprecatedArray.h
WebCore/platform/DeprecatedString.cpp
WebCore/platform/FloatPoint.h
WebCore/platform/FloatRect.h
WebCore/platform/FloatSize.h
WebCore/platform/GraphicsContext.h
WebCore/platform/Image.h
WebCore/platform/IntPoint.h
WebCore/platform/IntRect.h
WebCore/platform/IntSize.h
WebCore/platform/PlatformKeyboardEvent.h
WebCore/platform/PlatformMouseEvent.h
WebCore/platform/PlatformString.h
WebCore/platform/ResourceLoader.h
WebCore/platform/ResourceLoaderInternal.h
WebCore/platform/ScrollView.h
WebCore/platform/StaticConstructors.h
WebCore/platform/StreamingTextDecoderICU.cpp
WebCore/platform/StringImpl.h
WebCore/platform/Widget.h
WebCore/platform/mac/BlockExceptions.mm
WebCore/platform/mac/ColorMac.mm
WebCore/platform/mac/FloatPointMac.mm
WebCore/platform/mac/FloatRectMac.mm
WebCore/platform/mac/FloatSizeMac.mm
WebCore/platform/mac/FontMac.mm
WebCore/platform/mac/GraphicsContextMac.mm
WebCore/platform/mac/IntPointMac.mm
WebCore/platform/mac/IntRectMac.mm
WebCore/platform/mac/IntSizeMac.mm
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/rendering/RenderBlock.h
WebCore/rendering/RenderTableCell.h
WebCore/rendering/bidi.cpp
WebCore/xml/XSLTProcessor.cpp
WebCore/xpath/impl/XPathGrammar.y
WebKit/Carbon/CarbonUtils.m
WebKit/Carbon/CarbonWindowAdapter.m
WebKit/Carbon/HIViewAdapter.m
WebKit/Carbon/HIWebView.m
WebKit/ChangeLog
WebKit/Misc/WebFileDatabase.m
WebKit/Misc/WebNSWindowExtras.m
WebKit/Misc/WebTypesInternal.h
WebKit/Plugins/WebNetscapeDeprecatedFunctions.c
WebKit/Plugins/WebNetscapeDeprecatedFunctions.h
WebKit/Plugins/WebNetscapePluginPackage.h
WebKit/Plugins/WebNetscapePluginPackage.m
WebKit/WebKit.xcodeproj/project.pbxproj

index 7160a24..2491cb5 100644 (file)
@@ -1,3 +1,32 @@
+2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
+          Make WebCore compile with -Wundef
+
+          * Adds -Wundef flag to Xcode project
+          * Converts #ifs to #ifdef and #ifndefs where needed.
+          * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
+            to fix a warning from within Bison.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * bindings/jni/jni_jsobject.cpp:
+        (JavaJSObject::getSlot):
+        (JavaJSObject::setSlot):
+        * bindings/npapi.h:
+        * bindings/objc/objc_class.mm:
+        (KJS::Bindings::ObjcClass::methodsNamed):
+        (KJS::Bindings::ObjcClass::fieldNamed):
+        * bindings/objc/objc_instance.mm:
+        (ObjcInstance::invokeMethod):
+        * bindings/objc/objc_runtime.mm:
+        (ObjcMethod::getMethodSignature):
+        (ObjcField::name):
+        (ObjcField::type):
+        * kjs/grammar.y:
+        * kjs/identifier.h:
+
 2006-08-03  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by John Sullivan.
index d239a20..3f2ee53 100644 (file)
                                        "-Wwrite-strings",
                                        "-Wno-format-y2k",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wwrite-strings",
                                        "-Wno-format-y2k",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wwrite-strings",
                                        "-Wno-format-y2k",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Production;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Production;
index 37d4a2d..e9231c4 100644 (file)
@@ -244,7 +244,7 @@ void JavaJSObject::removeMember(jstring memberName) const
 
 jobject JavaJSObject::getSlot(jint index) const
 {
-#if __LP64__
+#ifdef __LP64__
     JS_LOG ("index = %d\n", index);
 #else
     JS_LOG ("index = %ld\n", index);
@@ -261,7 +261,7 @@ jobject JavaJSObject::getSlot(jint index) const
 
 void JavaJSObject::setSlot(jint index, jobject value) const
 {
-#if __LP64__
+#ifdef __LP64__
     JS_LOG ("index = %d, value = %p\n", index, value);
 #else
     JS_LOG ("index = %ld, value = %p\n", index, value);
index c279922..521e3ec 100644 (file)
@@ -115,7 +115,7 @@ typedef unsigned short uint16;
 
 #ifndef _UINT32
 #define _UINT32
-#if __LP64__
+#ifdef __LP64__
 typedef unsigned int uint32;
 #else /* __LP64__ */
 typedef unsigned long uint32;
@@ -129,7 +129,7 @@ typedef short int16;
 
 #ifndef _INT32
 #define _INT32
-#if __LP64__
+#ifdef __LP64__
 typedef int int32;
 #else /* __LP64__ */
 typedef long int32;
index 89d97cc..a3d2d32 100644 (file)
@@ -93,7 +93,7 @@ MethodList ObjcClass::methodsNamed(const char* JSName, Instance*) const
 
     ClassStructPtr thisClass = _isa;
     while (thisClass && methodList.length() < 1) {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
         unsigned numMethodsInClass = 0;
         MethodStructPtr* objcMethodList = class_copyMethodList(thisClass, &numMethodsInClass);
 #else
@@ -103,7 +103,7 @@ MethodList ObjcClass::methodsNamed(const char* JSName, Instance*) const
             unsigned numMethodsInClass = objcMethodList->method_count;
 #endif
             for (unsigned i = 0; i < numMethodsInClass; i++) {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
                 MethodStructPtr objcMethod = objcMethodList[i];
                 SEL objcMethodSelector = method_getName(objcMethod);
                 const char* objcMethodSelectorName = sel_getName(objcMethodSelector);
@@ -132,7 +132,7 @@ MethodList ObjcClass::methodsNamed(const char* JSName, Instance*) const
                     break;
                 }
             }
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
             thisClass = class_getSuperclass(thisClass);
             free(objcMethodList);
 #else
@@ -191,7 +191,7 @@ Field* ObjcClass::fieldNamed(const char* name, Instance* instance) const
         // introspection.
 
         while (thisClass) {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
             unsigned numFieldsInClass = 0;
             IvarStructPtr* ivarsInClass = class_copyIvarList(thisClass, &numFieldsInClass);
 #else
@@ -200,7 +200,7 @@ Field* ObjcClass::fieldNamed(const char* name, Instance* instance) const
                 unsigned numFieldsInClass = fieldsInClass->ivar_count;
 #endif
                 for (unsigned i = 0; i < numFieldsInClass; i++) {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
                     IvarStructPtr objcIVar = ivarsInClass[i];
                     const char* objcIvarName = ivar_getName(objcIVar);
 #else
@@ -226,7 +226,7 @@ Field* ObjcClass::fieldNamed(const char* name, Instance* instance) const
                         break;
                     }
                 }
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
             thisClass = class_getSuperclass(thisClass);
             free(ivarsInClass);
 #else
index f67e73d..4c73295 100644 (file)
@@ -124,7 +124,7 @@ JSValue* ObjcInstance::invokeMethod(ExecState* exec, const MethodList &methodLis
     method = static_cast<ObjcMethod*>(methodList.methodAt(0));
     NSMethodSignature* signature = method->getMethodSignature();
     NSInvocation* invocation = [NSInvocation invocationWithMethodSignature:signature];
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
     [invocation setSelector:sel_registerName(method->name())];
 #else
     [invocation setSelector:(SEL)method->name()];
index 67477f8..3d4028c 100644 (file)
@@ -57,7 +57,7 @@ int ObjcMethod::numParameters() const
 
 NSMethodSignature* ObjcMethod::getMethodSignature() const
 {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
     return [_objcClass instanceMethodSignatureForSelector:sel_registerName(_selector)];
 #else
     return [_objcClass instanceMethodSignatureForSelector:(SEL)_selector];
@@ -89,7 +89,7 @@ ObjcField::ObjcField(CFStringRef name)
 
 const char* ObjcField::name() const 
 {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
     if (_ivar)
         return ivar_getName(_ivar);
 #else
@@ -101,7 +101,7 @@ const char* ObjcField::name() const
 
 RuntimeType ObjcField::type() const 
 { 
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
     if (_ivar)
         return ivar_getTypeEncoding(_ivar);
 #else
index b0aa05f..316bd81 100644 (file)
@@ -36,6 +36,8 @@
 // Not sure why, but yacc doesn't add this define along with the others.
 #define yylloc kjsyylloc
 
+#define YYMAXDEPTH 10000
+
 /* default values for bison */
 #define YYDEBUG 0
 #if !PLATFORM(DARWIN)
index 6d96ca1..a31e213 100644 (file)
@@ -82,7 +82,7 @@ namespace KJS {
         static PassRefPtr<UString::Rep> add(UString::Rep *);
     };
     
-#if !KJS_IDENTIFIER_HIDE_GLOBALS
+#ifndef KJS_IDENTIFIER_HIDE_GLOBALS
     extern const Identifier nullIdentifier;
 
     inline const Identifier &Identifier::null()
@@ -117,7 +117,7 @@ namespace KJS {
         macro(valueOf)
 
     // Define external global variables for all property names above (and one more).
-#if !KJS_IDENTIFIER_HIDE_GLOBALS
+#ifndef KJS_IDENTIFIER_HIDE_GLOBALS
     extern const Identifier specialPrototypePropertyName;
 
     #define KJS_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) extern const Identifier name ## PropertyName;
@@ -125,6 +125,6 @@ namespace KJS {
     #undef KJS_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL
 #endif
 
-}
+} // namespace KJS
 
-#endif
+#endif // KJS_IDENTIFIER_H
index b94bfbc..1bea746 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
+          Make WebCore compile with -Wundef
+
+          * Adds -Wundef flag to Xcode project
+
+        * JavaScriptGlue.xcodeproj/project.pbxproj:
+
 2006-07-29  Sam Weinig  <sam.weinig@gmail.com>
 
         Reviewed by Darin.
index e48eac7..a7567fd 100644 (file)
@@ -65,7 +65,7 @@
                0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
                089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; indentWidth = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                1422E86709DE3BCE00749B87 /* testjsglue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = testjsglue.cpp; sourceTree = "<group>"; };
-               1422E87709DE3BE800749B87 /* testjsglue */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testjsglue; sourceTree = BUILT_PRODUCTS_DIR; };
+               1422E87709DE3BE800749B87 /* testjsglue */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testjsglue; sourceTree = BUILT_PRODUCTS_DIR; };
                DD66F3D508F73ED700C75FD7 /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                DD66F3D608F73ED700C75FD7 /* JavaScriptGlue.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JavaScriptGlue.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                DD66F3F508F7401B00C75FD7 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Production;
index 368ee59..5c076f1 100644 (file)
@@ -1,3 +1,116 @@
+2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
+          Make WebCore compile with -Wundef
+
+          * Adds -Wundef flag to Xcode project
+          * Converts #ifs to #ifdef and #ifndefs where needed.
+          * Replaces #ifdef WIN32 with #if PLATFORM(WIN_OS) or PLATFORM(WIN)
+            (and in one instance in config.h with #if !COMPILER(MSVC))
+          * Added #define YYMAXDEPTH 10000 in XPathGrammar.y and CSSGrammar.y
+            to fix a warning from within Bison.
+          * Cleaned up style a little in surrounding code.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bridge/mac/WebCoreAXObject.mm:
+        (-[WebCoreAXObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
+        * config.h:
+        * css/CSSGrammar.y:
+        * css/MediaFeatureNames.cpp:
+        * css/MediaFeatureNames.h:
+        * css/cssparser.cpp:
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::setActive):
+        * dom/Element.cpp:
+        (WebCore::Element::attach):
+        * dom/Element.h:
+        * dom/EventNames.cpp:
+        * dom/EventNames.h:
+        * dom/NamedAttrMap.h:
+        * dom/Position.cpp:
+        * dom/QualifiedName.cpp:
+        * dom/QualifiedName.h:
+        * dom/Range.h:
+        * dom/XMLTokenizer.cpp:
+        (WebCore::XMLTokenizer::error):
+        * html/HTMLTokenizer.cpp:
+        (WebCore::HTMLTokenizer::scriptHandler):
+        (WebCore::HTMLTokenizer::scriptExecution):
+        (WebCore::HTMLTokenizer::parseTag):
+        (WebCore::HTMLTokenizer::continueProcessing):
+        (WebCore::HTMLTokenizer::write):
+        (WebCore::HTMLTokenizer::timerFired):
+        (WebCore::HTMLTokenizer::notifyFinished):
+        * kcanvas/device/quartz/KCanvasFilterQuartz.h:
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
+        * ksvg2/css/SVGRenderStyle.h:
+        * ksvg2/css/SVGRenderStyleDefs.h:
+        * ksvg2/scripts/make_names.pl:
+        * loader/CachedResource.h:
+        * loader/LoaderFunctions.h:
+        * loader/loader.h:
+        * page/Frame.cpp:
+        * page/FrameTree.cpp:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::clear):
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::layoutTimerFired):
+        (WebCore::FrameView::scheduleRelayout):
+        (WebCore::FrameView::unscheduleRelayout):
+        * platform/AtomicString.cpp:
+        * platform/AtomicString.h:
+        * platform/Cursor.h:
+        * platform/DeprecatedArray.h:
+        * platform/DeprecatedString.cpp:
+        (WebCore::allocateHandle):
+        (WebCore::initializeHandleNodeBlock):
+        (WebCore::freeHandle):
+        * platform/FloatPoint.h:
+        * platform/FloatRect.h:
+        * platform/FloatSize.h:
+        * platform/GraphicsContext.h:
+        * platform/Image.h:
+        * platform/IntPoint.h:
+        * platform/IntRect.h:
+        (WebCore::IntRect::inflateX):
+        (WebCore::IntRect::inflateY):
+        * platform/IntSize.h:
+        * platform/PlatformKeyboardEvent.h:
+        * platform/PlatformMouseEvent.h:
+        * platform/PlatformString.h:
+        * platform/ResourceLoader.h:
+        * platform/ResourceLoaderInternal.h:
+        (WebCore::ResourceLoaderInternal::ResourceLoaderInternal):
+        * platform/ScrollView.h:
+        * platform/StaticConstructors.h:
+        * platform/StreamingTextDecoderICU.cpp:
+        (WebCore::StreamingTextDecoderICU::convert):
+        * platform/StringImpl.h:
+        * platform/Widget.h:
+        * platform/mac/BlockExceptions.mm:
+        * platform/mac/ColorMac.mm:
+        (+[WebCoreControlTintObserver WebCore]):
+        * platform/mac/FloatPointMac.mm:
+        * platform/mac/FloatRectMac.mm:
+        * platform/mac/FloatSizeMac.mm:
+        * platform/mac/FontMac.mm:
+        * platform/mac/GraphicsContextMac.mm:
+        (WebCore::GraphicsContext::drawFocusRing):
+        * platform/mac/IntPointMac.mm:
+        * platform/mac/IntRectMac.mm:
+        * platform/mac/IntSizeMac.mm:
+        * platform/mac/WebCoreSystemInterface.h:
+        * rendering/RenderBlock.h:
+        * rendering/RenderTableCell.h:
+        * rendering/bidi.cpp:
+        (WebCore::appendRun):
+        (WebCore::RenderBlock::layoutInlineChildren):
+        * xml/XSLTProcessor.cpp:
+        (WebCore::parseErrorFunc):
+        * xpath/impl/XPathGrammar.y:
+
 2006-08-03  Adam Roben  <aroben@apple.com>
 
         Reviewed by Maciej and Beth.
index 0cc67db..df01119 100644 (file)
                                935C475E09AC4CAE00A6AAB4 /* HistoryMac.mm */,
                                F58784FF02DE375901EA4122 /* JavaAppletWidget.mm */,
                                93E47C5B09BE2BBB0019C5C1 /* PageMac.mm */,
+                               55998A5A052B59CC0017A6C1 /* WebCoreAXObject.h */,
+                               55998A5B052B59CC0017A6C1 /* WebCoreAXObject.mm */,
                                F5B2A4FC02E2220F018635CB /* WebCoreCache.h */,
                                F5B2A4FD02E2220F018635CB /* WebCoreCache.mm */,
                                BEF7EEA005FF8F0D009717EE /* WebCoreEditCommand.h */,
                                F587855502DE375901EA4122 /* WebCoreViewFactory.m */,
                                5150C2A10702629000AF642C /* WebDashboardRegion.h */,
                                5150C2A50702629800AF642C /* WebDashboardRegion.m */,
-                               55998A5A052B59CC0017A6C1 /* WebCoreAXObject.h */,
-                               55998A5B052B59CC0017A6C1 /* WebCoreAXObject.mm */,
                        );
                        path = mac;
                        sourceTree = "<group>";
                                F587868202DE3B8601EA4122 /* PopUpButton.h */,
                                F587852B02DE375901EA4122 /* RegularExpression.cpp */,
                                F58786B302DE3B8601EA4122 /* RegularExpression.h */,
+                               6545F66C09B82FED0013006F /* ResourceLoader.cpp */,
+                               6545F66D09B82FED0013006F /* ResourceLoader.h */,
+                               6545F66E09B82FED0013006F /* ResourceLoaderClient.h */,
+                               6545F66F09B82FED0013006F /* ResourceLoaderInternal.h */,
                                9385F761098D9C3100D90D24 /* Screen.h */,
                                BC7B2AF80450824100A8000F /* ScrollBar.h */,
                                9353673E09AED79200D35CD6 /* ScrollBarMode.h */,
                                F58786BF02DE3B8601EA4122 /* TextStream.h */,
                                93309EA1099EB78C0056E581 /* Timer.cpp */,
                                9305B24C098F1B6B00C28855 /* Timer.h */,
-                               6545F66C09B82FED0013006F /* ResourceLoader.cpp */,
-                               6545F66D09B82FED0013006F /* ResourceLoader.h */,
-                               6545F66E09B82FED0013006F /* ResourceLoaderClient.h */,
-                               6545F66F09B82FED0013006F /* ResourceLoaderInternal.h */,
                                9380F47109A11AB4001FDB34 /* Widget.cpp */,
                                9380F47209A11AB4001FDB34 /* Widget.h */,
                                93B780C909B3B7FE00690162 /* WidgetClient.h */,
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Production;
index 66df082..3156045 100644 (file)
@@ -1362,7 +1362,7 @@ static void AXAttributedStringAppendReplaced (NSMutableAttributedString *attrStr
 
 - (id)doAXTextMarkerRangeForUnorderedTextMarkers: (NSArray *) markers
 {
-#if MARKERARRAY_SELF_TEST
+#if defined(MARKERARRAY_SELF_TEST) && MARKERARRAY_SELF_TEST
     WebCoreTextMarkerRange *tmr = [self getSelectedTextMarkerRange];
     WebCoreTextMarker *tm1 = AXTextMarkerRangeCopyEndMarker(tmr);
     WebCoreTextMarker *tm2 = AXTextMarkerRangeCopyStartMarker(tmr);
index 285db47..919ea89 100644 (file)
 #define KHTML_NO_XBL 1
 #define KHTML_XSLT 1
 
+
 #if __APPLE__
 #define HAVE_FUNC_USLEEP 1
 
 #ifndef CGFLOAT_DEFINED
-#if __LP64__
+#ifdef __LP64__
 typedef double CGFloat;
 #else
 typedef float CGFloat;
@@ -35,9 +36,10 @@ typedef float CGFloat;
 #define CGFLOAT_DEFINED 1
 #endif
 
-#endif
+#endif /* __APPLE__ */
+
 
-#if WIN32
+#if PLATFORM(WIN_OS)
 
 #ifndef _WIN32_WINNT
 #define _WIN32_WINNT 0x0500
@@ -54,10 +56,10 @@ typedef float CGFloat;
 // FIXME: Should probably just dump this eventually, but it's needed for now.
 // We get this from some system place on OS X; probably better not to use it
 // in WebCore code.
-
 #include <assert.h>
 
-#endif
+#endif /* PLATFORM(WIN_OS) */
+
 
 #ifdef __cplusplus
 
@@ -69,6 +71,6 @@ typedef float CGFloat;
 
 #endif
 
-#if !defined(WIN32) // can't get this to compile on Visual C++ yet
+#if !COMPILER(MSVC) // can't get this to compile on Visual C++ yet
 #define AVOID_STATIC_CONSTRUCTORS 1
 #endif
index 1640407..e51b4fc 100644 (file)
@@ -117,6 +117,7 @@ static inline int getValueID(const char* tagStr, int len)
     return val->id;
 }
 
+#define YYMAXDEPTH 10000
 #define YYDEBUG 0
 #define YYPARSE_PARAM parser
 
index e015d7d..9e4454b 100644 (file)
 
 #include "config.h"
 
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
 #define CSS_MEDIAQUERY_NAMES_HIDE_GLOBALS 1
 #endif
 
 #include "MediaFeatureNames.h"
 #include "StaticConstructors.h"
 
-namespace WebCore { namespace MediaFeatureNames {
+namespace WebCore {
+namespace MediaFeatureNames {
 
 #define DEFINE_MEDIAFEATURE_GLOBAL(name, str) \
     DEFINE_GLOBAL(AtomicString, name##MediaFeature, str)
@@ -50,4 +51,5 @@ void init()
     }
 }
 
-} }
+} // namespace MediaFeatureNames
+} // namespace WebCore
index bb488b5..78a2a7c 100644 (file)
@@ -24,7 +24,8 @@
 
 #include "AtomicString.h"
 
-namespace WebCore { namespace MediaFeatureNames {
+namespace WebCore {
+    namespace MediaFeatureNames {
 
 #define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \
     macro(color, "color") \
@@ -54,15 +55,15 @@ namespace WebCore { namespace MediaFeatureNames {
     macro(min_width, "min-width") \
 // end of macro
 
-#if !CSS_MEDIAQUERY_NAMES_HIDE_GLOBALS
+#ifndef CSS_MEDIAQUERY_NAMES_HIDE_GLOBALS
     #define CSS_MEDIAQUERY_NAMES_DECLARE(name, str) extern const AtomicString name##MediaFeature;
     CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(CSS_MEDIAQUERY_NAMES_DECLARE)
     #undef CSS_MEDIAQUERY_NAMES_DECLARE
 #endif
 
-     void init();
-} }
-
-#endif
+        void init();
 
+    } // namespace MediaFeatureNames
+} // namespace WebCore
 
+#endif // MEDIAFEATURENAMES_H
index 5ba081c..00859ce 100644 (file)
@@ -2669,7 +2669,7 @@ bool CSSParser::parseBorderImage(int propId, bool important)
     return context.failed();
 }
 
-#if CSS_DEBUG
+#ifdef CSS_DEBUG
 
 static inline int yyerror(const char *str)
 {
index 99abac1..ff5c0b2 100644 (file)
@@ -783,7 +783,7 @@ void ContainerNode::setActive(bool down, bool pause)
             // to repaint the "down" state of the control is about the same time as it would take to repaint the
             // "up" state.  Once you assume this, you can just delay for 100ms - that time (assuming that after you
             // leave this method, it will be about that long before the flush of the up state happens again).
-#if HAVE_FUNC_USLEEP
+#ifdef HAVE_FUNC_USLEEP
             double startTime = currentTime();
 #endif
 
@@ -792,7 +792,7 @@ void ContainerNode::setActive(bool down, bool pause)
             
             // FIXME: Find a substitute for usleep for Win32.
             // Better yet, come up with a way of doing this that doesn't use this sort of thing at all.            
-#if HAVE_FUNC_USLEEP
+#ifdef HAVE_FUNC_USLEEP
             // Now pause for a small amount of time (1/10th of a second from before we repainted in the pressed state)
             double remainingTime = 0.1 - (currentTime() - startTime);
             if (remainingTime > 0)
index 7244ab8..43288d1 100644 (file)
@@ -540,7 +540,7 @@ void Element::removedFromDocument()
 
 void Element::attach()
 {
-#if SPEED_DEBUG < 1
+#if !defined(SPEED_DEBUG) || SPEED_DEBUG < 1
     createRendererIfNeeded();
 #endif
     ContainerNode::attach();
index d4c2d81..4128ead 100644 (file)
@@ -159,7 +159,7 @@ public:
     bool needsFocusAppearanceUpdate() const { return m_needsFocusAppearanceUpdate; }
     void setNeedsFocusAppearanceUpdate(bool b) { m_needsFocusAppearanceUpdate = b; }
     
-#if !NDEBUG
+#ifndef NDEBUG
     virtual void dump(TextStream *stream, DeprecatedString ind = "") const;
     virtual void formatForDebugger(char *buffer, unsigned length) const;
 #endif
index 5c54cc1..a8a488b 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
 #define DOM_EVENT_NAMES_HIDE_GLOBALS 1
 #endif
 
index 20b417f..5cd84d2 100644 (file)
@@ -96,7 +96,7 @@ namespace WebCore { namespace EventNames {
     \
 // end of DOM_EVENT_NAMES_FOR_EACH
 
-#if !DOM_EVENT_NAMES_HIDE_GLOBALS
+#ifndef DOM_EVENT_NAMES_HIDE_GLOBALS
     #define DOM_EVENT_NAMES_DECLARE(name) extern const AtomicString name##Event;
     DOM_EVENT_NAMES_FOR_EACH(DOM_EVENT_NAMES_DECLARE)
     #undef DOM_EVENT_NAMES_DECLARE
index 3d9f366..65fb736 100644 (file)
@@ -30,7 +30,7 @@
 #include "Element.h"
 #include "NamedNodeMap.h"
 
-#if __OBJC__
+#ifdef __OBJC__
 #define id id_AVOID_KEYWORD
 #endif
 
index 0e9ac78..bdd3824 100644 (file)
@@ -654,7 +654,7 @@ void Position::debugPosition(const char *msg) const
         fprintf(stderr, "Position [%s]: %s [%p] at %d\n", msg, node()->nodeName().deprecatedString().latin1(), node(), offset());
 }
 
-#if !NDEBUG
+#ifndef NDEBUG
 
 void Position::formatForDebugger(char *buffer, unsigned length) const
 {
index 1060734..bacc820 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
 #define WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS 1
 #else
 #define QNAME_DEFAULT_CONSTRUCTOR
index 1669486..cca5093 100644 (file)
@@ -71,7 +71,7 @@ private:
     QualifiedNameImpl* m_impl;
 };
 
-#if !WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS
+#ifndef WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS
 extern const QualifiedName anyName;
 inline const QualifiedName& anyQName() { return anyName; }
 #endif
index e268862..f69dfe2 100644 (file)
@@ -110,8 +110,8 @@ public:
 
     Position editingStartPosition() const;
 
-#if !NDEBUG
-    void formatForDebugger(char *buffer, unsigned length) const;
+#ifndef NDEBUG
+    void formatForDebugger(charbuffer, unsigned length) const;
 #endif
 
 private:
index 4576780..95f8d4c 100644 (file)
@@ -43,6 +43,7 @@
 #include "ResourceLoader.h"
 #include <libxml/parser.h>
 #include <libxml/parserInternals.h>
+#include <wtf/Platform.h>
 #include <wtf/Vector.h>
 
 #ifdef KHTML_XSLT
@@ -63,12 +64,11 @@ using namespace HTMLNames;
 
 const int maxErrors = 25;
 
-typedef HashMap<StringImpl *, StringImpl *> PrefixForNamespaceMap;
+typedef HashMap<StringImpl*, StringImpl*> PrefixForNamespaceMap;
 
 class PendingCallbacks;
 
-class XMLTokenizer : public Tokenizer, public CachedResourceClient
-{
+class XMLTokenizer : public Tokenizer, public CachedResourceClient {
 public:
     XMLTokenizer(Document *, FrameView * = 0);
     XMLTokenizer(DocumentFragment *, Element *);
@@ -922,7 +922,7 @@ void XMLTokenizer::error(ErrorType type, const char *message, va_list args)
     if (m_parserStopped)
         return;
 
-#if WIN32
+#if PLATFORM(WIN_OS)
     char m[1024];
     vsnprintf(m, sizeof(m) - 1, message, args);
 #else
@@ -935,7 +935,7 @@ void XMLTokenizer::error(ErrorType type, const char *message, va_list args)
     else
         handleError(type, m, lineNumber(), columnNumber());
 
-#if !WIN32
+#if !PLATFORM(WIN_OS)
     free(m);
 #endif
 }
index 7d79835..968fcf1 100644 (file)
@@ -363,10 +363,10 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
         if (!scriptSrc.isEmpty() && m_doc->frame()) {
             // forget what we just got; load from src url instead
             if (!parser->skipMode() && !followingFrameset) {
-    #if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
                 if (!m_doc->ownerElement())
                     printf("Requesting script at time %d\n", m_doc->elapsedTime());
-    #endif
+#endif
                 // The parser might have been stopped by for example a window.close call in an earlier script.
                 // If so, we don't want to load scripts.
                 if (!m_parserStopped && (cs = m_doc->docLoader()->requestScript(scriptSrc, scriptSrcCharset) ))
@@ -376,13 +376,12 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
             } else
                 scriptNode = 0;
             scriptSrc=DeprecatedString::null;
-        }
-        else {
-    #ifdef TOKEN_DEBUG
+        } else {
+#ifdef TOKEN_DEBUG
             kdDebug( 6036 ) << "---START SCRIPT---" << endl;
             kdDebug( 6036 ) << DeprecatedString(scriptCode, scriptCodeSize) << endl;
             kdDebug( 6036 ) << "---END SCRIPT---" << endl;
-    #endif
+#endif
             scriptNode = 0;
             // Parse scriptCode containing <script> info
             doScriptExec = true;
@@ -477,7 +476,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptExecution(const DeprecatedString& str,
     SegmentedString prependingSrc;
     currentPrependingSrc = &prependingSrc;
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("beginning script execution at %d\n", m_doc->elapsedTime());
 #endif
@@ -488,7 +487,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptExecution(const DeprecatedString& str,
 
     state.setAllowYield(true);
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("ending script execution at %d\n", m_doc->elapsedTime());
 #endif
@@ -808,7 +807,7 @@ HTMLTokenizer::State HTMLTokenizer::parseTag(SegmentedString &src, State state)
         }
         case TagName:
         {
-#if defined(TOKEN_DEBUG) &&  TOKEN_DEBUG > 1
+#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
             qDebug("TagName");
 #endif
             if (searchCount > 0)
@@ -1289,7 +1288,7 @@ inline bool HTMLTokenizer::continueProcessing(int& processedCount, double startT
                 (m_doc->documentElement()->id() != ID_HTML || m_doc->body()))) {*/
             // Schedule the timer to keep processing as soon as possible.
             m_timer.startOneShot(0);
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
             if (currentTime() - startTime > tokenizerTimeDelay)
                 printf("Deferring processing of data because 500ms elapsed away from event loop.\n");
 #endif
@@ -1335,7 +1334,7 @@ bool HTMLTokenizer::write(const SegmentedString &str, bool appendData)
     bool wasInWrite = inWrite;
     inWrite = true;
     
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("Beginning write at time %d\n", m_doc->elapsedTime());
 #endif
@@ -1453,7 +1452,7 @@ bool HTMLTokenizer::write(const SegmentedString &str, bool appendData)
         }
     }
     
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("Ending write at time %d\n", m_doc->elapsedTime());
 #endif
@@ -1487,7 +1486,7 @@ bool HTMLTokenizer::processingData() const
 
 void HTMLTokenizer::timerFired(Timer<HTMLTokenizer>*)
 {
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("Beginning timer write at time %d\n", m_doc->elapsedTime());
 #endif
@@ -1661,7 +1660,7 @@ void HTMLTokenizer::enlargeScriptBuffer(int len)
 
 void HTMLTokenizer::notifyFinished(CachedResource*)
 {
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("script loaded at %d\n", m_doc->elapsedTime());
 #endif
@@ -1689,7 +1688,7 @@ void HTMLTokenizer::notifyFinished(CachedResource*)
         RefPtr<Node> n = scriptNode;
         scriptNode = 0;
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
         if (!m_doc->ownerElement())
             printf("external script beginning execution at %d\n", m_doc->elapsedTime());
 #endif
@@ -1706,7 +1705,7 @@ void HTMLTokenizer::notifyFinished(CachedResource*)
         finished = pendingScripts.isEmpty();
         if (finished) {
             m_state.setLoadingExtScript(false);
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
             if (!m_doc->ownerElement())
                 printf("external script finished execution at %d\n", m_doc->elapsedTime());
 #endif
index 3d44e0b..affae84 100644 (file)
@@ -27,7 +27,7 @@
 
 #import "KCanvasFilters.h"
 
-#if __OBJC__
+#ifdef __OBJC__
 @class CIFilter;
 @class CIImage;
 #else
index 3bfd818..3dba791 100644 (file)
@@ -33,7 +33,7 @@
 typedef struct CGRect CGRect;
 typedef struct CGContext *CGContextRef;
 
-#if __OBJC__
+#ifdef __OBJC__
 @class NSGraphicsContext;
 #else
 class NSGraphicsContext;
index faad98b..87e35d2 100644 (file)
 #if SVG_SUPPORT
 
 #include "DataRef.h"
-
 #include <ksvg2/svg/SVGPaint.h>
 #include <ksvg2/css/SVGRenderStyleDefs.h>
+#include <wtf/Platform.h>
 
-#if WIN32
+#if PLATFORM(WIN_OS)
 typedef unsigned long long uint64_t;
 #endif
 
index 4691999..312b845 100644 (file)
@@ -102,7 +102,9 @@ namespace WebCore {
         PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_ALL
     };
     
+    class CSSValue;
     class CSSValueList;
+    class SVGPaint;
 
     // Inherited/Non-Inherited Style Datastructures
     class StyleFillData : public Shared<StyleFillData> {
index 6c254ed..d811b0b 100755 (executable)
@@ -214,7 +214,7 @@ sub printNamesHeaderFile
        }
        
        my $lowerNamespace = lc($namespacePrefix);
-       print "#if !DOM_${namespace}NAMES_HIDE_GLOBALS\n";
+       print "#ifndef DOM_${namespace}NAMES_HIDE_GLOBALS\n";
     print "// Namespace\n";
     print "extern const WebCore::AtomicString ${lowerNamespace}NamespaceURI;\n\n";
 
@@ -250,7 +250,7 @@ sub printNamesCppFile
 
 print "#include \"config.h\"\n";
 
-print "#if AVOID_STATIC_CONSTRUCTORS\n";
+print "#ifdef AVOID_STATIC_CONSTRUCTORS\n";
 print "#define DOM_${namespace}NAMES_HIDE_GLOBALS 1\n";
 print "#else\n";
 print "#define QNAME_DEFAULT_CONSTRUCTOR 1\n";
index 0539e86..ce4be43 100644 (file)
@@ -35,7 +35,7 @@
 #include <wtf/Vector.h>
 #include <time.h>
 
-#if __OBJC__
+#ifdef __OBJC__
 @class NSData;
 @class NSURLResponse;
 #else
index b102f87..2407916 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <wtf/Vector.h>
 
-#if __OBJC__
+#ifdef __OBJC__
 @class NSDictionary;
 @class NSString;
 @class NSURLResponse;
index 5d29c21..c27388b 100644 (file)
@@ -31,7 +31,7 @@
 #include <wtf/HashMap.h>
 #include "DeprecatedPtrList.h"
 
-#if __OBJC__
+#ifdef __OBJC__
 @class NSData;
 @class NSURLResponse;
 #else
index abbf48b..e7a22de 100644 (file)
 #include "FloatRect.h"
 #include "Frame.h"
 #include "GraphicsContext.h"
-#include "HTMLViewSourceDocument.h"
 #include "HTMLFormElement.h"
 #include "HTMLFrameElement.h"
 #include "HTMLGenericFormElement.h"
+#include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "HTMLObjectElement.h"
-#include "HTMLInputElement.h"
+#include "HTMLViewSourceDocument.h"
 #include "ImageDocument.h"
 #include "MediaFeatureNames.h"
 #include "MouseEventWithHitTestResults.h"
 #include "Plugin.h"
 #include "PluginDocument.h"
 #include "RenderPart.h"
-#include "RenderTheme.h"
 #include "RenderTextControl.h"
+#include "RenderTheme.h"
 #include "RenderView.h"
 #include "SegmentedString.h"
 #include "TextDocument.h"
 #include "TextIterator.h"
 #include "TypingCommand.h"
+#include "XMLTokenizer.h"
 #include "cssstyleselector.h"
 #include "htmlediting.h"
 #include "kjs_window.h"
 #include "markup.h"
 #include "visible_units.h"
-#include "XMLTokenizer.h"
 #include "xmlhttprequest.h"
 #include <math.h>
 #include <sys/types.h>
+#include <wtf/Platform.h>
 
-#if !WIN32
+#if !PLATFORM(WIN_OS)
 #include <unistd.h>
 #endif
 
index 00e2bcf..1fc79f6 100644 (file)
 
 #include "Frame.h"
 #include "Page.h"
-#include <wtf/Vector.h>
 #include <stdarg.h>
+#include <wtf/Platform.h>
+#include <wtf/Vector.h>
 
 using std::swap;
 
 namespace WebCore {
 
-// This belongs in some header file where multiple clients can share it.
-#if WIN32
+// FIXME: This belongs in some header file where multiple clients can share it.
+#if PLATFORM(WIN_OS)
 int snprintf(char* str, size_t size, const char* format, ...)
 {
     va_list args;
index b50bf76..f7d7b16 100644 (file)
@@ -230,7 +230,7 @@ void FrameView::clear()
 
     d->reset();
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (d->layoutTimer.isActive() && m_frame->document() && !m_frame->document()->ownerElement())
         printf("Killing the layout timer from a clear at %d\n", m_frame->document()->elapsedTime());
 #endif    
@@ -413,7 +413,7 @@ void FrameView::layout(bool allowSubtree)
             }
         } else if (rootRenderer)
             applyOverflowToViewport(rootRenderer, hMode, vMode); // XML/XHTML UAs use the root element.
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
         if (d->firstLayout && !document->ownerElement())
             printf("Elapsed time before first layout: %d\n", document->elapsedTime());
 #endif
@@ -1206,7 +1206,7 @@ void FrameView::repaintRectangle(const IntRect& r, bool immediate)
 
 void FrameView::layoutTimerFired(Timer<FrameView>*)
 {
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (m_frame->document() && !m_frame->document()->ownerElement())
         printf("Layout timer fired at %d\n", m_frame->document()->elapsedTime());
 #endif
@@ -1240,7 +1240,7 @@ void FrameView::scheduleRelayout()
 
     d->delayedLayout = delay != 0;
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_frame->document()->ownerElement())
         printf("Scheduling layout for %d\n", delay);
 #endif
@@ -1288,7 +1288,7 @@ void FrameView::unscheduleRelayout()
     if (!d->layoutTimer.isActive())
         return;
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (m_frame->document() && !m_frame->document()->ownerElement())
         printf("Layout timer unscheduled at %d\n", m_frame->document()->elapsedTime());
 #endif
index 90a7cd6..0ae8379 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
 #define ATOMICSTRING_HIDE_GLOBALS 1
 #endif
 
index de3a8ab..840ba5b 100644 (file)
@@ -114,7 +114,7 @@ inline bool equalIgnoringCase(const char* a, const AtomicString& b) { return equ
 inline bool equalIgnoringCase(const String& a, const AtomicString& b) { return equalIgnoringCase(a.impl(), b.impl()); }
 
 // Define external global variables for the commonly used atomic strings.
-#if !ATOMICSTRING_HIDE_GLOBALS
+#ifndef ATOMICSTRING_HIDE_GLOBALS
     extern const AtomicString nullAtom;
     extern const AtomicString emptyAtom;
     extern const AtomicString textAtom;
@@ -122,6 +122,6 @@ inline bool equalIgnoringCase(const String& a, const AtomicString& b) { return e
     extern const AtomicString starAtom;
 #endif
 
-}
+} // namespace WebCore
 
-#endif
+#endif // AtomicString_h
index 94e9f31..ad4751a 100644 (file)
@@ -26,7 +26,9 @@
 #ifndef CURSOR_H
 #define CURSOR_H
 
-#ifdef WIN32
+#include <wtf/Platform.h>
+
+#if PLATFORM(WIN)
 #include <windows.h>
 #elif PLATFORM(GDK)
 #include <gdk/gdk.h>
@@ -44,7 +46,7 @@ namespace WebCore {
 
     class Image;
 
-#ifdef WIN32
+#if PLATFORM(WIN)
     typedef HCURSOR PlatformCursor;
 #elif defined(__APPLE__)
     typedef NSCursor* PlatformCursor;
@@ -92,6 +94,6 @@ namespace WebCore {
     const Cursor& columnResizeCursor();
     const Cursor& rowResizeCursor();
 
-}
+} // namespace WebCore
 
-#endif
+#endif // CURSOR_H
index a4e202e..239adc6 100644 (file)
@@ -27,6 +27,7 @@
 #define ARRAY_H_
 
 #include "ArrayImpl.h"
+#include <wtf/Platform.h>
 
 namespace WebCore {
 
@@ -51,7 +52,7 @@ public:
 
     T &operator[](int i) { return *(T *)impl.at(i); }
     const T &operator[](int i) const { return *(T *)impl.at(i); }
-#if WIN32
+#if PLATFORM(WIN_OS)
     // FIXME: Look into this strange compile error on Win32.
     T &operator[](unsigned i) { return *(T *)impl.at(i); }
     const T &operator[](unsigned i) const { return *(T *)impl.at(i); }
@@ -66,6 +67,6 @@ public:
 
 typedef DeprecatedArray<char> DeprecatedByteArray;
 
-}
+} // namespace WebCore
 
-#endif
+#endif // ARRAY_H_
index c8fd957..342a17c 100644 (file)
 #include "TextEncoding.h"
 #include <kjs/dtoa.h>
 #include <kjs/identifier.h>
-#include <stdio.h>
 #include <stdarg.h>
-#ifdef WIN32
+#include <stdio.h>
+#include <wtf/Platform.h>
+
+#if PLATFORM(WIN_OS)
 #include <windows.h>
 #endif
 
@@ -72,7 +74,7 @@ static inline void initializeHandleNodes()
 
 static inline DeprecatedStringData **allocateHandle()
 {
-#if CHECK_FOR_HANDLE_LEAKS
+#ifdef CHECK_FOR_HANDLE_LEAKS
     return static_cast<DeprecatedStringData **>(fastMalloc(sizeof(DeprecatedStringData *)));
 #endif
 
@@ -814,7 +816,7 @@ bool DeprecatedString::startsWith(const char *prefix) const
     }
 }
 
-#ifdef WIN32
+#if PLATFORM(WIN_OS)
 inline int strncasecmp(const char *first, const char *second, size_t maxLength)
 {
     return _strnicmp(first, second, maxLength);
@@ -2437,7 +2439,7 @@ static HandleNode *initializeHandleNodeBlock(HandlePageNode *pageNode)
     HandleNode* block;
     HandleNode* aNode;
 
-#ifdef WIN32
+#if PLATFORM(WIN_OS)
     block = (HandleNode*)VirtualAlloc(0, pageSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
 #else
     block = (HandleNode*)valloc(pageSize);
@@ -2506,7 +2508,7 @@ static HandleNode *allocateNode(HandlePageNode *pageNode)
 
 void freeHandle(DeprecatedStringData **_free)
 {
-#if CHECK_FOR_HANDLE_LEAKS
+#ifdef CHECK_FOR_HANDLE_LEAKS
     fastFree(_free);
     return;
 #endif
index 5b6cf3a..b25aa0f 100644 (file)
@@ -33,7 +33,7 @@
 
 typedef struct CGPoint CGPoint;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGPoint NSPoint;
 #else
 typedef struct _NSPoint NSPoint;
@@ -63,7 +63,7 @@ public:
     FloatPoint(const CGPoint&);
     operator CGPoint() const;
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
     FloatPoint(const NSPoint&);
     operator NSPoint() const;
 #endif
index 06f5b2d..0fb7c89 100644 (file)
@@ -33,7 +33,7 @@
 
 typedef struct CGRect CGRect;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGRect NSRect;
 #else
 typedef struct _NSRect NSRect;
@@ -100,7 +100,7 @@ public:
     FloatRect(const CGRect&);
     operator CGRect() const;
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
     FloatRect(const NSRect&);
     operator NSRect() const;
 #endif
index 346fc17..618815a 100644 (file)
@@ -31,7 +31,7 @@
 
 typedef struct CGSize CGSize;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGSize NSSize;
 #else
 typedef struct _NSSize NSSize;
@@ -118,6 +118,6 @@ inline bool operator!=(const FloatSize& a, const FloatSize& b)
     return a.width() != b.width() || a.height() != b.height();
 }
 
-}
+} // namespace WebCore
 
-#endif
+#endif // FloatSize_h
index 030741c..3bc3c66 100644 (file)
 #ifndef GraphicsContext_h
 #define GraphicsContext_h
 
-#include "Font.h"
 #include "FloatRect.h"
+#include "Font.h"
 #include "Image.h"
 #include "IntRect.h"
 #include "Pen.h"
 #include "TextDirection.h"
-#include <wtf/Noncopyable.h>
 #include <unicode/umachine.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Platform.h>
 
+// FIXME: how should Cairo figure into the platform macros?
 #if __APPLE__
 typedef struct CGContext PlatformGraphicsContext;
-#elif WIN32
+#elif PLATFORM(WIN)
 typedef struct HDC__* HDC;
 typedef struct _cairo PlatformGraphicsContext;
 #elif PLATFORM(GDK)
@@ -158,7 +160,7 @@ namespace WebCore {
         KRenderingDeviceContext* createRenderingDeviceContext();
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
         GraphicsContext(HDC); // FIXME: To be removed.
 #endif
 
@@ -177,6 +179,6 @@ namespace WebCore {
         GraphicsContextPlatformPrivate* m_data;
     };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // GraphicsContext_h
index 4b071da..8d1c8a1 100644 (file)
@@ -34,7 +34,7 @@
 #include "FloatSize.h"
 
 #if __APPLE__
-#if __OBJC__
+#ifdef __OBJC__
 @class NSImage;
 #else
 class NSImage;
index 0291ea3..278c779 100644 (file)
 #define INTPOINT_H_
 
 #include "IntSize.h"
+#include <wtf/Platform.h>
 
 #if __APPLE__
 
 typedef struct CGPoint CGPoint;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGPoint NSPoint;
 #else
 typedef struct _NSPoint NSPoint;
 #endif
 
-#endif
+#endif // __APPLE__
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct tagPOINT POINT;
 #endif
 
@@ -64,14 +65,14 @@ public:
     explicit IntPoint(const CGPoint&); // don't do this implicitly since it's lossy
     operator CGPoint() const;
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
     explicit IntPoint(const NSPoint&); // don't do this implicitly since it's lossy
     operator NSPoint() const;
 #endif
 
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
     IntPoint(const POINT&);
     operator POINT() const;
 #endif
@@ -117,6 +118,6 @@ inline bool operator!=(const IntPoint& a, const IntPoint& b)
     return a.x() != b.x() || a.y() != b.y();
 }
 
-}
+} // namespace WebCore
 
-#endif
+#endif // INTPOINT_H_
index cde166f..3fd0664 100644 (file)
 #define INTRECT_H_
 
 #include "IntPoint.h"
+#include <wtf/Platform.h>
 
 #if __APPLE__
 
 typedef struct CGRect CGRect;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGRect NSRect;
 #else
 typedef struct _NSRect NSRect;
 #endif
 
-#endif
+#endif // __APPLE__
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct tagRECT RECT;
 #endif
 
@@ -90,18 +91,20 @@ public:
     void intersect(const IntRect&);
     void unite(const IntRect&);
 
-    void inflateX(int dx) {
+    void inflateX(int dx)
+    {
         m_location.setX(m_location.x() - dx);
         m_size.setWidth(m_size.width() + dx + dx);
     }
-    void inflateY(int dy) {
+    void inflateY(int dy)
+    {
         m_location.setY(m_location.y() - dy);
         m_size.setHeight(m_size.height() + dy + dy);
     }
     void inflate(int d) { inflateX(d); inflateY(d); }
     void scale(float s);
 
-#if WIN32
+#if PLATFORM(WIN)
     IntRect(const RECT&);
     operator RECT() const;
 #endif
@@ -110,7 +113,7 @@ public:
 
     operator CGRect() const;
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
     operator NSRect() const;
 #endif
 
@@ -149,7 +152,7 @@ inline bool operator!=(const IntRect& a, const IntRect& b)
 
 IntRect enclosingIntRect(const CGRect&);
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 IntRect enclosingIntRect(const NSRect&);
 
@@ -157,6 +160,6 @@ IntRect enclosingIntRect(const NSRect&);
 
 #endif
 
-}
+} // namespace WebCore
 
-#endif
+#endif // INTRECT_H_
index bd0cf38..d2cb6c5 100644 (file)
 #ifndef INTSIZE_H_
 #define INTSIZE_H_
 
+#include <wtf/Platform.h>
+
 #if __APPLE__
 
 typedef struct CGSize CGSize;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGSize NSSize;
 #else
 typedef struct _NSSize NSSize;
 #endif
 
-#endif
+#endif // __APPLE__
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct tagSIZE SIZE;
 #endif
 
@@ -86,7 +88,7 @@ public:
 
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
     IntSize(const SIZE&);
     operator SIZE() const;
 #endif
@@ -134,6 +136,6 @@ inline bool operator!=(const IntSize& a, const IntSize& b)
     return a.width() != b.width() || a.height() != b.height();
 }
 
-}
+} // namespace WebCore
 
-#endif
+#endif // INTSIZE_H_
index 9470e3e..4cd984c 100644 (file)
@@ -27,6 +27,7 @@
 #define PlatformKeyboardEvent_h
 
 #include "PlatformString.h"
+#include <wtf/Platform.h>
 
 #ifdef __OBJC__
 @class NSEvent;
@@ -34,7 +35,7 @@
 class NSEvent;
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct HWND__ *HWND;
 typedef unsigned    WPARAM;
 typedef long        LPARAM;
@@ -65,7 +66,7 @@ namespace WebCore {
         PlatformKeyboardEvent(NSEvent*, bool forceAutoRepeat = false);
 #endif
 
-#ifdef WIN32
+#if PLATFORM(WIN)
         PlatformKeyboardEvent(HWND, WPARAM, LPARAM);
 #endif
 
index 13be8d1..8f74077 100644 (file)
@@ -27,6 +27,7 @@
 #define PlatformMouseEvent_h
 
 #include "IntPoint.h"
+#include <wtf/Platform.h>
 
 #if __APPLE__
 #ifdef __OBJC__
@@ -36,7 +37,7 @@ class NSEvent;
 #endif
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct HWND__* HWND;
 typedef unsigned WPARAM;
 typedef long LPARAM;
@@ -93,7 +94,7 @@ namespace WebCore {
 #if __APPLE__
         PlatformMouseEvent(NSEvent*);
 #endif
-#if WIN32
+#if PLATFORM(WIN)
         PlatformMouseEvent(HWND, WPARAM, LPARAM, int clickCount);
 #endif
 #if PLATFORM(GDK) 
index 992ba49..d1dae8f 100644 (file)
@@ -133,7 +133,7 @@ public:
     String(CFStringRef);
     CFStringRef createCFString() const { return m_impl ? m_impl->createCFString() : CFSTR(""); }
 #endif
-#if __OBJC__
+#ifdef __OBJC__
     String(NSString*);
     operator NSString*() const { if (!m_impl) return @""; return *m_impl; }
 #endif
index faa84a5..c06992a 100644 (file)
 #ifndef ResourceLoader_H_
 #define ResourceLoader_H_
 
+#include "ResourceLoaderClient.h" // for PlatformResponse
 #include "StringHash.h"
 #include "Timer.h"
-#include "ResourceLoaderClient.h" // for PlatformResponse
 #include <wtf/HashMap.h>
+#include <wtf/Platform.h>
 
-#ifdef WIN32
+#if PLATFORM(WIN)
 typedef unsigned long DWORD;
 typedef unsigned long DWORD_PTR;
 typedef void* LPVOID;
@@ -82,7 +83,7 @@ public:
 #if __APPLE__
     void setLoader(WebCoreResourceLoaderImp*);
 #endif
-#if WIN32
+#if PLATFORM(WIN)
     void fileLoadTimer(Timer<ResourceLoader>* timer);
     friend void __stdcall transferJobStatusCallback(HINTERNET, DWORD_PTR, DWORD, LPVOID, DWORD);
     friend LRESULT __stdcall ResourceLoaderWndProc(HWND, unsigned message, WPARAM, LPARAM);
index 3e37508..f228894 100644 (file)
 #ifndef ResourceLoaderInternal_H_
 #define ResourceLoaderInternal_H_
 
-#include "KURL.h"
 #include "FormData.h"
+#include "KURL.h"
 #include <wtf/HashMap.h>
+#include <wtf/Platform.h>
 
-#ifdef WIN32
+#if PLATFORM(WIN)
 typedef void* HANDLE;
 #endif
 
@@ -59,7 +60,7 @@ namespace WebCore {
             , loader(nil)
             , response(nil)
 #endif
-#if WIN32
+#if PLATFORM(WIN)
             , m_fileHandle(0)
             , m_fileLoadTimer(job, &ResourceLoader::fileLoadTimer)
             , m_resourceHandle(0)
@@ -89,7 +90,7 @@ namespace WebCore {
             , loader(nil)
             , response(nil)
 #endif
-#if WIN32
+#if PLATFORM(WIN)
             , m_fileHandle(0)
             , m_fileLoadTimer(job, &ResourceLoader::fileLoadTimer)
             , m_resourceHandle(0)
@@ -125,7 +126,7 @@ namespace WebCore {
         WebCoreResourceLoaderImp* loader;
         NSURLResponse* response;
 #endif
-#if WIN32
+#if PLATFORM(WIN)
         HANDLE m_fileHandle;
         Timer<ResourceLoader> m_fileLoadTimer;
         HINTERNET m_resourceHandle;
index 585d718..af495d4 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "ScrollBarMode.h"
 #include "Widget.h"
+#include <wtf/Platform.h>
 
 namespace WebCore {
     class FloatRect;
@@ -76,7 +77,7 @@ namespace WebCore {
         NSView* getDocumentView() const;
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
         ScrollView();
         ~ScrollView();
     private:
@@ -87,7 +88,7 @@ namespace WebCore {
         ScrollViewPrivate* m_data;
 #endif
 
-#if  PLATFORM(GDK)
+#if PLATFORM(GDK)
         void updateView(const IntRect&, bool now = false);
         virtual void setDrawable(GdkDrawable* drawable);
         virtual void setFrameGeometry(const IntRect&);
@@ -102,6 +103,6 @@ namespace WebCore {
 #endif
     };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // ScrollView_H
index b65ff56..448adcf 100644 (file)
@@ -26,7 +26,7 @@
 // portable, and it would be good to figure out a 100% clean way that still avoids code that
 // runs at init time.
 
-#if !AVOID_STATIC_CONSTRUCTORS
+#ifndef AVOID_STATIC_CONSTRUCTORS
     // Define an global in the normal way.
 #define DEFINE_GLOBAL(type, name, ...) \
     const type name;
index 1be1ef8..d6e7301 100644 (file)
@@ -27,8 +27,8 @@
 #include "config.h"
 #include "StreamingTextDecoderICU.h"
 
-#include <wtf/Assertions.h>
 #include <unicode/unorm.h>
+#include <wtf/Assertions.h>
 
 using std::min;
 
@@ -273,7 +273,7 @@ DeprecatedString StreamingTextDecoderICU::convert(const unsigned char* chs, int
     }
 
     //#define PARTIAL_CHARACTER_HANDLING_TEST_CHUNK_SIZE 1000
-#if PARTIAL_CHARACTER_HANDLING_TEST_CHUNK_SIZE
+#ifdef PARTIAL_CHARACTER_HANDLING_TEST_CHUNK_SIZE
     DeprecatedString result;
     int chunkSize;
     for (int i = 0; i != len; i += chunkSize) {
index 0a553d0..fb3c806 100644 (file)
@@ -36,7 +36,7 @@
 #include <CoreFoundation/CoreFoundation.h>
 #endif
 
-#if __OBJC__
+#ifdef __OBJC__
 @class NSString;
 #endif
 
@@ -122,7 +122,7 @@ public:
     StringImpl(CFStringRef);
     CFStringRef createCFString() const;
 #endif
-#if __OBJC__
+#ifdef __OBJC__
     StringImpl(NSString*);
     operator NSString*() const;
 #endif
index 3ee78a4..f74a699 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef WEBCORE_PLATFORM_WIDGET_H_
 #define WEBCORE_PLATFORM_WIDGET_H_
 
+#include <wtf/Platform.h>
+
 #if __APPLE__
 #ifdef __OBJC__
 @class NSView;
@@ -34,7 +36,7 @@ class NSView;
 #endif
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct HWND__ *HWND;
 typedef struct HINSTANCE__ *HINSTANCE;
 #endif
@@ -125,7 +127,7 @@ namespace WebCore {
 
         virtual bool isFrameView() const;
 
-#if WIN32
+#if PLATFORM(WIN)
         Widget(HWND);
         HWND windowHandle() const;
         void setWindowHandle(HWND);
@@ -161,6 +163,6 @@ namespace WebCore {
         WidgetPrivate* data;
     };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // WEBCORE_PLATFORM_WIDGET_H_
index da55e34..0ce50d7 100644 (file)
@@ -25,6 +25,7 @@
 
 #import "config.h"
 #import "BlockExceptions.h"
+
 #import <wtf/Assertions.h>
 
 void ReportBlockedObjCException(NSException *localException)
index 086898b..50e8b24 100644 (file)
@@ -66,7 +66,7 @@ NSColor* nsColor(const Color& color)
                 if (cachedRGBAValues[i] == c)
                     return cachedColors[i];
 
-#if COLORMATCH_EVERYTHING
+#ifdef COLORMATCH_EVERYTHING
             NSColor* result = [NSColor colorWithCalibratedRed:color.red() / 255.0
                                                         green:color.green() / 255.0
                                                          blue:color.blue() / 255.0
index 6e3a569..ae019a6 100644 (file)
@@ -38,7 +38,7 @@ FloatPoint::operator CGPoint() const
     return CGPointMake(m_x, m_y);
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 FloatPoint::FloatPoint(const NSPoint& p) : m_x(p.x), m_y(p.y)
 {
index 6b2d685..1e008dc 100644 (file)
@@ -38,7 +38,7 @@ FloatRect::operator CGRect() const
     return CGRectMake(x(), y(), width(), height());
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 FloatRect::FloatRect(const NSRect& r) : m_location(r.origin), m_size(r.size)
 {
index 6b45b23..e43ae39 100644 (file)
@@ -38,7 +38,7 @@ FloatSize::operator CGSize() const
     return CGSizeMake(m_width, m_height);
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 FloatSize::FloatSize(const NSSize& s) : m_width(s.width), m_height(s.height)
 {
index cc3769e..39bc24b 100644 (file)
@@ -47,7 +47,7 @@
 #define LEFT_TO_RIGHT_OVERRIDE 0x202D
 #define RIGHT_TO_LEFT_OVERRIDE 0x202E
 
-#if defined(__LP64__)
+#ifdef __LP64__
 #define URefCon void*
 #else
 #define URefCon UInt32
index bb4da2f..b7c85a1 100644 (file)
@@ -106,7 +106,7 @@ void GraphicsContext::drawFocusRing(const Color& color)
     ASSERT(view);
 
     const NSRect* drawRects;
-#if defined(__LP64__)
+#ifdef __LP64__
     long count;
 #else
     int count;
index def4040..8eb012e 100644 (file)
@@ -37,7 +37,7 @@ IntPoint::operator CGPoint() const
     return CGPointMake(m_x, m_y);
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 IntPoint::IntPoint(const NSPoint& p) : m_x(static_cast<int>(p.x)), m_y(static_cast<int>(p.y))
 {
index f4bc11b..7997919 100644 (file)
@@ -42,7 +42,7 @@ IntRect enclosingIntRect(const CGRect& rect)
     return IntRect(l, t, r - l, b - t);
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 IntRect::operator NSRect() const
 {
index b784867..a80eaca 100644 (file)
@@ -37,7 +37,7 @@ IntSize::operator CGSize() const
     return CGSizeMake(m_width, m_height);
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 IntSize::IntSize(const NSSize& s) : m_width(static_cast<int>(s.width)), m_height(static_cast<int>(s.height))
 {
index e438fd6..08e1d22 100644 (file)
@@ -32,7 +32,7 @@ typedef signed char BOOL;
 typedef struct CGRect CGRect;
 #endif
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGRect NSRect;
 #else
 typedef struct _NSRect NSRect;
@@ -42,7 +42,7 @@ typedef struct _NSRect NSRect;
 typedef struct CGPoint CGPoint;
 #endif
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGPoint NSPoint;
 #else
 typedef struct _NSPoint NSPoint;
index f7057ca..244e8a8 100644 (file)
@@ -266,7 +266,7 @@ public:
     int leftSelectionOffset(RenderBlock* rootBlock, int y);
     int rightSelectionOffset(RenderBlock* rootBlock, int y);
 
-#if !NDEBUG
+#ifndef NDEBUG
     virtual void dump(TextStream *stream, DeprecatedString ind = "") const;
 #endif
 
index 990c9e2..f63a0ec 100644 (file)
@@ -100,7 +100,7 @@ public:
     RenderTable* table() const { return static_cast<RenderTable*>(parent()->parent()->parent()); }
     RenderTableSection* section() const { return static_cast<RenderTableSection*>(parent()->parent()); }
 
-#if !NDEBUG
+#ifndef NDEBUG
     virtual void dump(TextStream *stream, DeprecatedString ind = "") const;
 #endif
 
index 90121fb..e61831b 100644 (file)
@@ -595,7 +595,7 @@ static void appendRun(BidiState &bidi)
 {
     if (emptyRun || !bidi.eor.obj)
         return;
-#if BIDI_DEBUG > 1
+#if defined(BIDI_DEBUG) && BIDI_DEBUG > 1
     kdDebug(6041) << "appendRun: dir="<<(int)dir<<endl;
 #endif
 
@@ -1759,7 +1759,7 @@ IntRect RenderBlock::layoutInlineChildren(bool relayoutChildren)
 
     return repaintRect;
 
-#if BIDI_DEBUG > 1
+#if defined(BIDI_DEBUG) && BIDI_DEBUG > 1
     kdDebug(6041) << " ------- bidi end " << this << " -------" << endl;
 #endif
 }
index 236b055..f3d2b47 100644 (file)
 #include "HTMLDocument.h"
 #include "HTMLTokenizer.h"
 #include "LoaderFunctions.h"
-#include "Text.h"
 #include "ResourceLoader.h"
+#include "Text.h"
 #include "loader.h"
 #include "markup.h"
-#include <wtf/Vector.h>
 #include <libxslt/imports.h>
 #include <libxslt/variables.h>
 #include <libxslt/xsltutils.h>
+#include <wtf/Assertions.h>
+#include <wtf/Platform.h>
+#include <wtf/Vector.h>
 
 namespace WebCore {
 
 static void parseErrorFunc(void *ctxt, const char *msg, ...)
 {
     // FIXME: It would be nice to display error messages somewhere.
-#if !WIN32
+#if !PLATFORM(WIN_OS)
     // FIXME: No vasprintf support.
-#if !ERROR_DISABLED
+#ifndef ERROR_DISABLED
     char *errorMessage = 0;
     va_list args;
     va_start(args, msg);
@@ -376,6 +378,6 @@ void XSLTProcessor::removeParameter(StringImpl *namespaceURI, StringImpl *localN
     m_parameters.remove(localName);
 }
 
-}
+} // namespace WebCore
 
-#endif
+#endif // KHTML_XSLT
index ad0a50a..cb50715 100644 (file)
@@ -38,6 +38,7 @@
 #include "XPathVariableReference.h"
 
 #define YYDEBUG 0
+#define YYMAXDEPTH 10000
 #define YYPARSE_PARAM parserParameter
 #define PARSER static_cast<Parser*>(parserParameter)
 
index 982bc2e..4a6548f 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 // <rdar://problem/4561772> HIWebView needs to be reworked to not use QuickDraw, needed for 64-bit
-#if !__LP64__
+#ifndef __LP64__
 
 #include "CarbonUtils.h"
 #import <WebKitSystemInterface.h>
index 87b5913..bb4d848 100644 (file)
@@ -410,7 +410,7 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
 }
 
 // FIXME: <rdar://problem/4561772> HIWebView and HIViewAdapter need to be reworked for 64-bit
-#if !__LP64__
+#ifndef __LP64__
 
 - (BOOL)makeFirstResponder:(NSResponder *)aResponder
 {
@@ -613,7 +613,7 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
 }
 
 // FIXME: <rdar://problem/4561772> HIWebView and HIViewAdapter need to be reworked for 64-bit
-#if !__LP64__
+#ifndef __LP64__
 
 - (void)selectKeyViewFollowingView:(NSView *)aView {
        HIViewRef       view = NULL;
index 39cc86c..dd687a4 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 // <rdar://problem/4561772> HIWebView needs to be reworked to not use QuickDraw, needed for 64-bit
-#if !__LP64__
+#ifndef __LP64__
 
 #import "HIViewAdapter.h"
 
@@ -65,7 +65,7 @@ static NSView *_webkit_NSView_nextValidKeyView(id self, SEL _cmd);
         Method setNeedsDisplayMethod = class_getInstanceMethod(objc_getClass("NSView"), @selector(setNeedsDisplay:));
         ASSERT(setNeedsDisplayMethod);
         ASSERT(!oldNSViewSetNeedsDisplayIMP);
-#if OBJC_API_VERSION > 0
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION > 0
         oldNSViewSetNeedsDisplayIMP = method_setImplementation(setNeedsDisplayMethod, (IMP)_webkit_NSView_setNeedsDisplay);
 #else
         oldNSViewSetNeedsDisplayIMP = setNeedsDisplayMethod->method_imp;
@@ -76,7 +76,7 @@ static NSView *_webkit_NSView_nextValidKeyView(id self, SEL _cmd);
         Method setNeedsDisplayInRectMethod = class_getInstanceMethod(objc_getClass("NSView"), @selector(setNeedsDisplayInRect:));
         ASSERT(setNeedsDisplayInRectMethod);
         ASSERT(!oldNSViewSetNeedsDisplayInRectIMP);
-#if OBJC_API_VERSION > 0
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION > 0
         oldNSViewSetNeedsDisplayInRectIMP = method_setImplementation(setNeedsDisplayInRectMethod, (IMP)_webkit_NSView_setNeedsDisplayInRect);
 #else
         oldNSViewSetNeedsDisplayInRectIMP = setNeedsDisplayInRectMethod->method_imp;
@@ -87,7 +87,7 @@ static NSView *_webkit_NSView_nextValidKeyView(id self, SEL _cmd);
         Method nextValidKeyViewMethod = class_getInstanceMethod(objc_getClass("NSView"), @selector(nextValidKeyView));
         ASSERT(nextValidKeyViewMethod);
         ASSERT(!oldNSViewNextValidKeyViewIMP);
-#if OBJC_API_VERSION > 0
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION > 0
         oldNSViewNextValidKeyViewIMP = method_setImplementation(nextValidKeyViewMethod, (IMP)_webkit_NSView_nextValidKeyView);
 #else
         oldNSViewNextValidKeyViewIMP = nextValidKeyViewMethod->method_imp;
index f27f04e..b53c930 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 // <rdar://problem/4561772> HIWebView needs to be reworked to not use QuickDraw, needed for 64-bit
-#if !__LP64__
+#ifndef __LP64__
 
 #include "HIWebView.h"
 
@@ -1400,7 +1400,7 @@ HIWebViewEventHandler(
                                        GetEventParameter( inEvent, kEventParamControlDataBuffer, typePtr, NULL,
                                                        sizeof( Ptr ), NULL, &ptr );
 
-#if __LP64__
+#ifdef __LP64__
                                        GetEventParameter(inEvent, kEventParamControlDataBufferSize, typeSInt64, NULL, sizeof(Size), NULL, &size);
 #else
                                        GetEventParameter(inEvent, kEventParamControlDataBufferSize, typeSInt32, NULL, sizeof(Size), NULL, &size);
@@ -1421,7 +1421,7 @@ HIWebViewEventHandler(
                                                }
 
                                                outSize = sizeof( ControlKind );
-#if __LP64__
+#ifdef __LP64__
                         SetEventParameter(inEvent, kEventParamControlDataBufferSize, typeSInt64, sizeof(Size), &outSize);
 #else
                         SetEventParameter(inEvent, kEventParamControlDataBufferSize, typeSInt32, sizeof(Size), &outSize);
index 15a53eb..8594b8a 100644 (file)
@@ -1,3 +1,32 @@
+2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
+          Make WebCore compile with -Wundef
+
+          * Adds -Wundef flag to Xcode project
+          * Converts #ifs to #ifdef and #ifndefs where needed.
+
+        * Carbon/CarbonUtils.m:
+        * Carbon/CarbonWindowAdapter.m:
+        * Carbon/HIViewAdapter.m:
+        (+[NSView bindHIViewToNSView:nsView:]):
+        * Carbon/HIWebView.m:
+        (HIWebViewEventHandler):
+        * Misc/WebFileDatabase.m:
+        (UniqueFilePathForKey):
+        * Misc/WebNSWindowExtras.m:
+        (swizzleInstanceMethod):
+        * Misc/WebTypesInternal.h:
+        * Plugins/WebNetscapeDeprecatedFunctions.c:
+        * Plugins/WebNetscapeDeprecatedFunctions.h:
+        * Plugins/WebNetscapePluginPackage.h:
+        * Plugins/WebNetscapePluginPackage.m:
+        (-[WebNetscapePluginPackage unloadWithoutShutdown]):
+        (-[WebNetscapePluginPackage load]):
+        * WebKit.xcodeproj/project.pbxproj:
+
 2006-08-03  Darin Adler  <darin@apple.com>
 
         Reviewed by Eric Seidel.
index ec666c9..19174c2 100644 (file)
@@ -210,7 +210,7 @@ static void UniqueFilePathForKey(id key, char *buffer)
         hash2 = (37 * hash2) ^ s[cnt];
     }
 
-#if __LP64__
+#ifdef __LP64__
     snprintf(buffer, UniqueFilePathSize, "%.2u/%.2u/%.10u-%.10u.cache", ((hash1 & 0xff) >> 4), ((hash2 & 0xff) >> 4), hash1, hash2);
 #else
     snprintf(buffer, UniqueFilePathSize, "%.2lu/%.2lu/%.10lu-%.10lu.cache", ((hash1 & 0xff) >> 4), ((hash2 & 0xff) >> 4), hash1, hash2);
index 37f9da1..42056be 100644 (file)
@@ -161,7 +161,7 @@ static IMP swizzleInstanceMethod(Class class, SEL selector, IMP newImplementatio
     Method method = class_getInstanceMethod(class, selector);
     ASSERT(method);
     IMP oldIMP;
-#if OBJC_API_VERSION > 0
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION > 0
     oldIMP = method_setImplementation(method, newImplementation);
 #else
     oldIMP = method->method_imp;
index 44dcc48..b9f12cb 100644 (file)
@@ -35,7 +35,7 @@ typedef NSUInteger WebNSUInteger;
 #endif
 
 #ifndef CGFLOAT_DEFINED
-#if __LP64__
+#ifdef __LP64__
 typedef double CGFloat;
 #else
 typedef float CGFloat;
index 4efeab4..a370728 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "WebNetscapeDeprecatedFunctions.h"
 
-#if !__LP64__
+#ifndef __LP64__
 
 OSErr WebGetDiskFragment(const FSSpec *fileSpec, UInt32 offset, UInt32 length, ConstStr63Param fragName, CFragLoadOptions options, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage)
 {
index 6b600e7..f1390a4 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 
-#if !__LP64__
+#ifndef __LP64__
 
 #import <CoreServices/CoreServices.h>
 
index 10dbbd3..85be8f8 100644 (file)
@@ -44,7 +44,7 @@ typedef enum {
     uint16 pluginSize;
     uint16 pluginVersion;
         
-#if !__LP64__
+#ifndef __LP64__
     // CFM is not supported in 64-bit
     CFragConnectionID connID;
 #endif
index da399be..635800b 100644 (file)
@@ -50,7 +50,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
 
 @implementation WebNetscapePluginPackage
 
-#if !__LP64__
+#ifndef __LP64__
 + (void)initialize
 {
     // The Shockwave plugin requires a valid file in CurApRefNum.
@@ -265,7 +265,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
     if (isBundle)
         CFBundleUnloadExecutable(cfBundle);
     else
-#if !__LP64__
+#ifndef __LP64__
         // CFM is not supported in 64-bit
         WebCloseConnection(&connID);
 #endif
@@ -326,7 +326,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
                 goto abort;
         }
     } else {
-#if __LP64__
+#ifdef __LP64__
         // CFM is not supported in 64-bit
         goto abort;
 #else
index 23d1081..de0c7b0 100644 (file)
                                        "-Wbad-function-cast",
                                        "-Wmissing-declarations",
                                        "-Wnested-externs",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wbad-function-cast",
                                        "-Wmissing-declarations",
                                        "-Wnested-externs",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wbad-function-cast",
                                        "-Wmissing-declarations",
                                        "-Wnested-externs",
+                                       "-Wundef",
                                );
                        };
                        name = Production;