Changeset 90717 in webkit
- Timestamp:
- Jul 10, 2011 10:19:51 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90709 r90717 1 2011-07-10 Patrick Gansterer <paroga@webkit.org> 2 3 Generate conditional include statements in CodeGeneratorJS 4 https://bugs.webkit.org/show_bug.cgi?id=64231 5 6 Reviewed by Brent Fulgham. 7 8 Suround headers with a correspondig #if ENABLE() line. 9 This allows us to generate bindings only of required IDL files. 10 11 Changing the current preprocessor statements to the Conditional attribute 12 in a next step helps in getting rid of calls to the preprocessor, 13 which causes so much pain on a natvie Windows environment. 14 15 * bindings/scripts/CodeGeneratorJS.pm: 16 (GenerateImplementation): 17 (WriteData): 18 1 19 2011-07-10 Patrick Gansterer <paroga@webkit.org> 2 20 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r90709 r90717 8 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. 9 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 10 # Copyright (C) 2011 Patrick Gansterer <paroga@webkit.org> 10 11 # 11 12 # This library is free software; you can redistribute it and/or … … 1752 1753 $constructorType =~ s/Constructor$//; 1753 1754 if ($constructorType ne "DOMObject") { 1754 $implIncludes{"JS" . $constructorType . ".h"} = 1; 1755 my $header = "JS" . $constructorType . ".h"; 1756 my $conditional = $attribute->signature->extendedAttributes->{"Conditional"}; 1757 if (not $conditional) { 1758 $implIncludes{$header} = 1; 1759 } elsif (not exists($implIncludes{$header})) { 1760 $implIncludes{$header} = $conditional; 1761 } else { 1762 my $oldValue = $implIncludes{$header}; 1763 if ($oldValue ne 1) { 1764 my %newValue = (); 1765 $newValue{$conditional} = 1; 1766 foreach my $condition (split(/\|/, $oldValue)) { 1767 $newValue{$condition} = 1; 1768 } 1769 $implIncludes{$header} = join("|", sort keys %newValue); 1770 } 1771 } 1755 1772 } 1756 1773 push(@implContent, " // Shadowing a built-in constructor\n"); … … 2927 2944 2928 2945 my @includes = (); 2946 my %implIncludeConditions = (); 2929 2947 foreach my $include (keys %implIncludes) { 2948 my $condition = $implIncludes{$include}; 2930 2949 my $checkType = $include; 2931 2950 $checkType =~ s/\.h//; … … 2933 2952 2934 2953 $include = "\"$include\"" unless $include =~ /^["<]/; # " 2935 push @includes, $include; 2954 2955 if ($condition eq 1) { 2956 push @includes, $include; 2957 } else { 2958 push @{$implIncludeConditions{$condition}}, $include; 2959 } 2936 2960 } 2937 2961 foreach my $include (sort @includes) { 2938 2962 print $IMPL "#include $include\n"; 2963 } 2964 foreach my $condition (sort keys %implIncludeConditions) { 2965 print $IMPL "\n#if " . GenerateConditionalStringFromAttributeValue($condition) . "\n"; 2966 foreach my $include (sort @{$implIncludeConditions{$condition}}) { 2967 print $IMPL "#include $include\n"; 2968 } 2969 print $IMPL "#endif\n"; 2939 2970 } 2940 2971
Note: See TracChangeset
for help on using the changeset viewer.