Changeset 70844 in webkit
- Timestamp:
- Oct 28, 2010 11:32:52 PM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r70843 r70844 1 2010-10-28 Sergio Villar Senin <svillar@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] GObject bindings generator issues 6 https://bugs.webkit.org/show_bug.cgi?id=48135 7 8 GObject code generator must not generate conditional API's. This 9 patch also adds an alternative return value for non-void 10 conditional methods. With this change the conditionalMethods hack 11 is no longer needed. 12 13 * bindings/scripts/CodeGeneratorGObject.pm: 14 1 15 2010-10-28 David Hyatt <hyatt@apple.com> 2 16 -
trunk/WebCore/bindings/scripts/CodeGeneratorGObject.pm
r66308 r70844 797 797 } 798 798 799 # Some methods' body (only the body, since the public API can't be800 # conditional) should be guarded by #ifdefs depending on whether801 # certain features in WebKit are enabled.802 my %conditionalMethods = ("webkit_dom_geolocation_clear_watch" => "GEOLOCATION");803 804 799 sub GenerateFunction { 805 800 my ($object, $interfaceName, $function, $prefix) = @_; … … 880 875 } 881 876 882 push(@hBody, "#if ${conditionalString}\n") if $conditionalString;883 877 push(@hBody, "WEBKIT_API $returnType\n$functionName($functionSig);\n"); 884 push(@hBody, "#endif /* ${conditionalString} */\n") if $conditionalString;885 878 push(@hBody, "\n"); 886 879 880 push(@cBody, "$returnType\n$functionName($functionSig)\n{\n"); 887 881 push(@cBody, "#if ${conditionalString}\n") if $conditionalString; 888 push(@cBody, "$returnType\n$functionName($functionSig)\n{\n");889 push(@cBody, " WebCore::JSMainThreadNullState state;\n");890 891 if ($conditionalMethods{$functionName}) {892 push(@cBody, "#if ENABLE($conditionalMethods{$functionName})\n");893 }894 882 895 883 if ($returnType ne "void") { … … 899 887 push(@cBody, " g_return_if_fail(self);\n"); 900 888 } 889 890 push(@cBody, " WebCore::JSMainThreadNullState state;\n"); 901 891 902 892 # The WebKit::core implementations check for NULL already; no need to … … 1051 1041 } 1052 1042 1053 if ($conditionalMethods{$functionName}) { 1054 push(@cBody, "#endif\n"); 1055 } 1056 1057 push(@cBody, "}\n"); 1058 push(@cBody, "#endif /* ${conditionalString} */\n") if $conditionalString; 1059 push(@cBody, "\n"); 1043 if ($conditionalString) { 1044 if ($returnType ne "void") { 1045 push(@cBody, "#else\n"); 1046 if ($codeGenerator->IsNonPointerType($functionSigType)) { 1047 push(@cBody, " return static_cast<${returnType}>(0);\n"); 1048 } else { 1049 push(@cBody, " return NULL;\n"); 1050 } 1051 } 1052 push(@cBody, "#endif /* ${conditionalString} */\n") if $conditionalString; 1053 } 1054 1055 push(@cBody, "}\n\n"); 1060 1056 } 1061 1057
Note: See TracChangeset
for help on using the changeset viewer.