Fix more weak external symbol errors.
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Feb 2015 02:25:42 +0000 (02:25 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Feb 2015 02:25:42 +0000 (02:25 +0000)
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* page/make_settings.pl:
(printGetterAndSetter):
Remove some WEBCORE_EXPORT macros.

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/page/make_settings.pl

index 81b680c..cbff5b8 100644 (file)
@@ -1,5 +1,15 @@
 2015-02-11  Alex Christensen  <achristensen@webkit.org>
 
+        Fix more weak external symbol errors.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        * page/make_settings.pl:
+        (printGetterAndSetter):
+        Remove some WEBCORE_EXPORT macros.
+
+2015-02-11  Alex Christensen  <achristensen@webkit.org>
+
         Do not export functions defined in headers.
         This prevents weak external symbol errors in some configurations.
 
index 6450b49..db48a74 100644 (file)
@@ -1149,7 +1149,12 @@ sub GenerateHeader
         push(@headerContent, "\n");
     }
     if (ShouldGenerateToJSDeclaration($hasParent, $interface)) {
-        push(@headerContent, "WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n");
+        # Node needs to not be exported, others need to be exported.
+        if ($implType eq "Node") {
+            push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n");
+        } else {
+            push(@headerContent, "WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n");
+        }
         push(@headerContent, "inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType& impl) { return toJS(exec, globalObject, &impl); }\n");
     }
     if ($usesToJSNewlyCreated{$interfaceName}) {
index 9fc6adb..b6356f4 100755 (executable)
@@ -239,12 +239,18 @@ sub printGetterAndSetter($$$$)
 {
     my ($file, $settingName, $type, $setNeedsStyleRecalcInAllFrames) = @_;
     my $setterFunctionName = setterFunctionName($settingName);
+    
+    my $webcoreExport = "";
+    if ($setNeedsStyleRecalcInAllFrames) {
+        $webcoreExport = "WEBCORE_EXPORT"; # Export is only needed if the definition is not in the header.
+    }
+    
     if (lc(substr($type, 0, 1)) eq substr($type, 0, 1)) {
         print $file "    $type $settingName() const { return m_$settingName; } \\\n";
-        print $file "    WEBCORE_EXPORT void $setterFunctionName($type $settingName)";
+        print $file "    $webcoreExport void $setterFunctionName($type $settingName)";
     } else {
         print $file "    const $type& $settingName() { return m_$settingName; } \\\n";
-        print $file "    WEBCORE_EXPORT void $setterFunctionName(const $type& $settingName)";
+        print $file "    $webcoreExport void $setterFunctionName(const $type& $settingName)";
     }
     if ($setNeedsStyleRecalcInAllFrames) {
         print $file "; \\\n";