summaryrefslogtreecommitdiff
path: root/Source/WebCore/bindings/scripts/StaticString.pm
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/bindings/scripts/StaticString.pm
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/bindings/scripts/StaticString.pm')
-rw-r--r--Source/WebCore/bindings/scripts/StaticString.pm35
1 files changed, 17 insertions, 18 deletions
diff --git a/Source/WebCore/bindings/scripts/StaticString.pm b/Source/WebCore/bindings/scripts/StaticString.pm
index b8feaa57e..9ba0c70a8 100644
--- a/Source/WebCore/bindings/scripts/StaticString.pm
+++ b/Source/WebCore/bindings/scripts/StaticString.pm
@@ -33,27 +33,26 @@ sub GenerateStrings($)
my @result = ();
- while ( my ($name, $value) = each %strings ) {
- push(@result, "static const LChar ${name}String8[] = \"${value}\";\n");
- }
-
- push(@result, "\n");
+ push(@result, <<END);
+#if COMPILER(MSVC)
+#pragma warning(push)
+#pragma warning(disable: 4307)
+#endif
- while ( my ($name, $value) = each %strings ) {
- my $length = length($value);
- my $hash = Hasher::GenerateHashValue($value);
- push(@result, <<END);
-static StringImpl::StaticASCIILiteral ${name}Data = {
- StringImpl::StaticASCIILiteral::s_initialRefCount,
- $length,
- ${name}String8,
- 0,
- StringImpl::StaticASCIILiteral::s_initialFlags | (${hash} << StringImpl::StaticASCIILiteral::s_hashShift)
-};
END
+
+ for my $name (sort keys %strings) {
+ my $value = $strings{$name};
+ push(@result, "static StringImpl::StaticStringImpl ${name}Data(\"${value}\");\n");
}
- push(@result, "\n");
+ push(@result, <<END);
+
+#if COMPILER(MSVC)
+#pragma warning(pop)
+#endif
+
+END
return join "", @result;
}
@@ -67,7 +66,7 @@ sub GenerateStringAsserts($)
push(@result, "#ifndef NDEBUG\n");
- while ( my ($name, $value) = each %strings ) {
+ for my $name (sort keys %strings) {
push(@result, " reinterpret_cast<StringImpl*>(&${name}Data)->assertHashIsCorrect();\n");
}