[PATCH] D87570: [llvm-rc] Allow omitting components from VERSIONINFO version numbers
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 12 14:27:10 PDT 2020
mstorsjo created this revision.
mstorsjo added reviewers: amccarth, rnk.
Herald added a project: LLVM.
mstorsjo requested review of this revision.
MS rc.exe doesn't require specifying all 4 components.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D87570
Files:
llvm/test/tools/llvm-rc/Inputs/tag-versioninfo.rc
llvm/test/tools/llvm-rc/tag-versioninfo.test
llvm/tools/llvm-rc/ResourceScriptParser.cpp
Index: llvm/tools/llvm-rc/ResourceScriptParser.cpp
===================================================================
--- llvm/tools/llvm-rc/ResourceScriptParser.cpp
+++ llvm/tools/llvm-rc/ResourceScriptParser.cpp
@@ -778,8 +778,10 @@
// VERSION variations take multiple integers.
size_t NumInts = RetType::isVersionType(FixedType) ? 4 : 1;
- ASSIGN_OR_RETURN(ArgsResult, readIntsWithCommas(NumInts, NumInts));
+ ASSIGN_OR_RETURN(ArgsResult, readIntsWithCommas(1, NumInts));
SmallVector<uint32_t, 4> ArgInts(ArgsResult->begin(), ArgsResult->end());
+ while (ArgInts.size() < NumInts)
+ ArgInts.push_back(0);
Result.setValue(FixedType, ArgInts);
}
Index: llvm/test/tools/llvm-rc/tag-versioninfo.test
===================================================================
--- llvm/test/tools/llvm-rc/tag-versioninfo.test
+++ llvm/test/tools/llvm-rc/tag-versioninfo.test
@@ -14,7 +14,7 @@
; CHECK-NEXT: 0000: A0023400 00005600 53005F00 56004500 |..4...V.S._.V.E.|
; CHECK-NEXT: 0010: 52005300 49004F00 4E005F00 49004E00 |R.S.I.O.N._.I.N.|
; CHECK-NEXT: 0020: 46004F00 00000000 BD04EFFE 00000100 |F.O.............|
-; CHECK-NEXT: 0030: 02000100 04000300 06000500 08000700 |................|
+; CHECK-NEXT: 0030: 02000100 04000300 06000500 00000700 |................|
; CHECK-NEXT: 0040: 32000000 2B020000 6E000000 237A0800 |2...+...n...#z..|
; CHECK-NEXT: 0050: 0E000000 00000000 00000000 00020000 |................|
; CHECK-NEXT: 0060: 01005300 74007200 69006E00 67004600 |..S.t.r.i.n.g.F.|
Index: llvm/test/tools/llvm-rc/Inputs/tag-versioninfo.rc
===================================================================
--- llvm/test/tools/llvm-rc/Inputs/tag-versioninfo.rc
+++ llvm/test/tools/llvm-rc/Inputs/tag-versioninfo.rc
@@ -1,6 +1,6 @@
1 VERSIONINFO
FILEVERSION 1, 2, 3, 4
-PRODUCTVERSION 5, 6, 7, 8
+PRODUCTVERSION 5, 6, 7
FILEFLAGSMASK 50
FILEFLAGS 555
FILEOS 110
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87570.291419.patch
Type: text/x-patch
Size: 1941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200912/40a53723/attachment.bin>
More information about the llvm-commits
mailing list