2006-03-29 Darin Adler <darin@apple.com>
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Mar 2006 15:09:35 +0000 (15:09 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Mar 2006 15:09:35 +0000 (15:09 +0000)
        Reviewed by Anders.

        - another cut at fixing the buildbot

        * generate-derived-sources: Fix if statement that was always following
        the Windows case. I believe this is the main problem.

        * WebCore.xcodeproj/project.pbxproj: Added CharsetData.h and added CharsetData.cpp
        to the target.
        * WebCore.vcproj/WebCore/WebCore.vcproj: Similar changes.

        * platform/CharsetData.h: Added.
        * platform/CharsetNames.cpp: Moved the actual character set data out into a
        separate source file instead of include a .cpp file.

        * platform/make-charset-table.pl: Changed to generate a file that can stand alone.

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

WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/generate-derived-sources
WebCore/platform/CharsetData.h [new file with mode: 0644]
WebCore/platform/CharsetNames.cpp
WebCore/platform/make-charset-table.pl

index 49b754cb1a04266099453fc3d980acd5e0c4f672..58889ecb0c45c820ffa9fd7c89891c5c8bfc966f 100644 (file)
@@ -1,3 +1,22 @@
+2006-03-29  Darin Adler  <darin@apple.com>
+
+        Reviewed by Anders.
+
+        - another cut at fixing the buildbot
+
+        * generate-derived-sources: Fix if statement that was always following
+        the Windows case. I believe this is the main problem.
+
+        * WebCore.xcodeproj/project.pbxproj: Added CharsetData.h and added CharsetData.cpp
+        to the target.
+        * WebCore.vcproj/WebCore/WebCore.vcproj: Similar changes.
+
+        * platform/CharsetData.h: Added.
+        * platform/CharsetNames.cpp: Moved the actual character set data out into a
+        separate source file instead of include a .cpp file.
+
+        * platform/make-charset-table.pl: Changed to generate a file that can stand alone.
+
 2006-03-29  Darin Adler  <darin@apple.com>
 
         - an attempt to fix the buildbot
index a08e35857a4e2e8346231f2ac993d52b0f4022fe..a42dffbd476beb560a4d328388e9a1f9d5c2d409 100644 (file)
                <Filter
                        Name="DerivedSources"
                        >
+                       <File
+                               RelativePath="..\..\DerivedSources\WebCore\CharsetData.cpp"
+                               >
+                       </File>
                        <File
                                RelativePath="..\..\DerivedSources\WebCore\ColorData.c"
                                >
index 0363e9860885a8c3ea5321d0225e3b487be32edd..0be5f1ab9d68695cb8ea007cd4b9b0f210a89406 100644 (file)
                930CAB9709C49FAA00229C04 /* CodeGeneratorJS.pm in Resources */ = {isa = PBXBuildFile; fileRef = 930CAB9609C49FAA00229C04 /* CodeGeneratorJS.pm */; };
                930CAD1509C4F3C300229C04 /* JSCanvasRenderingContext2DBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 930CAD1409C4F3C300229C04 /* JSCanvasRenderingContext2DBase.h */; };
                930CAD2609C4F49100229C04 /* JSCanvasRenderingContext2DBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930CAD2509C4F49100229C04 /* JSCanvasRenderingContext2DBase.cpp */; };
+               9326DC0B09DAD5BE00AFC847 /* CharsetData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9326DC0A09DAD5BE00AFC847 /* CharsetData.h */; };
+               9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AC09D14EE6000E61D7 /* CharsetData.cpp */; };
                9327A94209968D1A0068A546 /* HTMLOptionsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */; };
                93309DD6099E64920056E581 /* AppendNodeCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309D87099E64910056E581 /* AppendNodeCommand.cpp */; };
                93309DD7099E64920056E581 /* AppendNodeCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309D88099E64910056E581 /* AppendNodeCommand.h */; };
                930CAB9609C49FAA00229C04 /* CodeGeneratorJS.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = CodeGeneratorJS.pm; path = bindings/scripts/CodeGeneratorJS.pm; sourceTree = "<group>"; };
                930CAD1409C4F3C300229C04 /* JSCanvasRenderingContext2DBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSCanvasRenderingContext2DBase.h; path = bindings/js/JSCanvasRenderingContext2DBase.h; sourceTree = "<group>"; };
                930CAD2509C4F49100229C04 /* JSCanvasRenderingContext2DBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSCanvasRenderingContext2DBase.cpp; path = bindings/js/JSCanvasRenderingContext2DBase.cpp; sourceTree = "<group>"; };
+               9326DC0A09DAD5BE00AFC847 /* CharsetData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CharsetData.h; path = platform/CharsetData.h; sourceTree = "<group>"; };
                9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLOptionsCollection.cpp; sourceTree = "<group>"; };
                93309D87099E64910056E581 /* AppendNodeCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppendNodeCommand.cpp; sourceTree = "<group>"; };
                93309D88099E64910056E581 /* AppendNodeCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppendNodeCommand.h; sourceTree = "<group>"; };
                                93CD4FD90995F9EA007ECC97 /* AtomicStringImpl.h */,
                                BC075985098861A400407B48 /* Brush.h */,
                                65F5382009B2B55700F3DC4A /* character-sets.txt */,
+                               9326DC0A09DAD5BE00AFC847 /* CharsetData.h */,
                                65F5386A09B2C05E00F3DC4A /* CharsetNames.cpp */,
                                65F537D809B2B20F00F3DC4A /* CharsetNames.h */,
                                BCC8CFC80986CD2400140BF2 /* Color.cpp */,
                                A86629CF09DA2B47009633A5 /* JSUIEvent.h in Headers */,
                                A86629D109DA2B48009633A5 /* JSMouseEvent.h in Headers */,
                                A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */,
+                               9326DC0B09DAD5BE00AFC847 /* CharsetData.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                A86629D009DA2B48009633A5 /* JSUIEvent.cpp in Sources */,
                                A86629D209DA2B48009633A5 /* JSMouseEvent.cpp in Sources */,
                                A86629D409DA2B48009633A5 /* JSKeyboardEvent.cpp in Sources */,
+                               9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 2c17400be2c82366ac45a955569443c2768472af..f9897feae73c29baadbe4ea237a3f9e84e8dcab8 100755 (executable)
@@ -68,10 +68,10 @@ fi
 
 # Generate the charset name table
 
-ENCODINGS_FILE="platform/mac/mac-encodings.txt"
-ENCODINGS_PREFIX="kCFStringEncoding"
-which sw_vers 2>&1 > /dev/null  # Check if we're on os x
-if [ $? ]; then
+if which sw_vers 2>&1 > /dev/null; then
+    ENCODINGS_FILE="platform/mac/mac-encodings.txt"
+    ENCODINGS_PREFIX="kCFStringEncoding"
+else
     ENCODINGS_FILE="platform/win/win-encodings.txt";
     ENCODINGS_PREFIX=""
 fi
diff --git a/WebCore/platform/CharsetData.h b/WebCore/platform/CharsetData.h
new file mode 100644 (file)
index 0000000..d7a5e91
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "TextEncoding.h"
+
+#if __APPLE__
+#include "ExtraCFEncodings.h"
+#endif
+
+namespace WebCore {
+
+    struct CharsetEntry {
+        const char* name;
+        TextEncodingID encoding;
+        int flags; // actually TextEncodingFlags
+    };
+
+    extern const CharsetEntry CharsetTable[];
+
+}
index 593128b7f095cb4c3f9fbbf041c5c88d0db6fd91..5d4c5a87a15491fd59dbfae25b2d9e92afcef9b7 100644 (file)
 #include "config.h"
 #include "CharsetNames.h"
 
+#include "CharsetData.h"
 #include <kxmlcore/HashMap.h>
 #include <unicode/ucnv.h>
 #include <unicode/utypes.h>
 
-#if __APPLE__
-#include "ExtraCFEncodings.h"
-#endif
-
 namespace KXMLCore {
 
     template<> struct DefaultHash<WebCore::TextEncodingID> {
@@ -49,15 +46,6 @@ namespace KXMLCore {
 
 namespace WebCore {
 
-struct CharsetEntry {
-    const char* name;
-    TextEncodingID encoding;
-    int flags; // actually TextEncodingFlags
-};
-
-// The following autogenerated file includes the charset data.
-#include "CharsetData.cpp"
-
 // Golden ratio - arbitrary start value to avoid mapping all 0's to all 0's
 // or anything like that.
 const unsigned PHI = 0x9e3779b9U;
@@ -119,9 +107,9 @@ static void buildDictionaries()
     nameMap = new HashMap<const char*, const CharsetEntry*, EncodingHash>();
     encodingMap = new HashMap<TextEncodingID, const CharsetEntry*>();
 
-    for (int i = 0; table[i].name; ++i) {
-        nameMap->add(table[i].name, &table[i]);
-        encodingMap->add(table[i].encoding, &table[i]);
+    for (int i = 0; CharsetTable[i].name; ++i) {
+        nameMap->add(CharsetTable[i].name, &CharsetTable[i]);
+        encodingMap->add(CharsetTable[i].encoding, &CharsetTable[i]);
     }
 }
 
index a233d32c85d5ee66615f0b3a7d9d1363c2c21d3c..83c940fc4e9cfeeac4ed19c389f6684d0b3f1c5e 100755 (executable)
@@ -1,9 +1,32 @@
 #!/usr/bin/perl -w
 
-use strict;
-
+# Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer. 
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution. 
+# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+#     its contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission. 
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-my $MAC_SUPPORTED_ONLY = 1;
+use strict;
 
 my %aliasesFromCharsetsFile;
 my %namesWritten;
@@ -25,7 +48,7 @@ sub emit_line
     error "$name shows up twice in output" if $namesWritten{$name};
     $namesWritten{$name} = 1;
     
-    $output .= "    { \"$name\", $prefix$encoding, $flags },\n";
+    $output .= "        { \"$name\", $prefix$encoding, $flags },\n";
 }
 
 sub process_platform_encodings
@@ -183,6 +206,18 @@ process_platform_encodings($ARGV[1], $ARGV[2]);
 
 exit 1 if $error;
 
-print "static const CharsetEntry table[] = {\n";
-print $output;
-print "    { 0, WebCore::InvalidEncoding, NoEncodingFlags }\n};\n";
+print <<EOF
+// File generated by make-charset-table.pl. Do not edit!
+
+#include "config.h"
+#include "CharsetData.h"
+
+namespace WebCore {
+
+    const CharsetEntry CharsetTable[] = {
+$output
+        { 0, WebCore::InvalidEncoding, NoEncodingFlags }
+    };
+
+}
+EOF