summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-rc/ResourceFileWriter.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-10-09 22:59:40 +0000
committerZachary Turner <zturner@google.com>2017-10-09 22:59:40 +0000
commit1e2c8b115700a6dd41e347ee813b44fa58baf7c1 (patch)
tree2e1b334ab10f8a6d979264d5e0cfa041ce1a4206 /llvm/tools/llvm-rc/ResourceFileWriter.cpp
parentcb993304acc1a3bd28ab47c701ecaf62eda3c2cc (diff)
downloadbcm5719-llvm-1e2c8b115700a6dd41e347ee813b44fa58baf7c1.tar.gz
bcm5719-llvm-1e2c8b115700a6dd41e347ee813b44fa58baf7c1.zip
[llvm-rc] Try again to fix errors on big endian systems.
llvm-svn: 315248
Diffstat (limited to 'llvm/tools/llvm-rc/ResourceFileWriter.cpp')
-rw-r--r--llvm/tools/llvm-rc/ResourceFileWriter.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/llvm/tools/llvm-rc/ResourceFileWriter.cpp b/llvm/tools/llvm-rc/ResourceFileWriter.cpp
index 3d72e16bf6e..1a9f4eba189 100644
--- a/llvm/tools/llvm-rc/ResourceFileWriter.cpp
+++ b/llvm/tools/llvm-rc/ResourceFileWriter.cpp
@@ -166,9 +166,7 @@ static Error processString(StringRef Str, NullHandlingMethod NullHandler,
}
}
- // Make sure to write little-endian strings, regardless of the host
- // byte-order.
- Result.push_back(endian::byte_swap(Char, little));
+ Result.push_back(Char);
return Error::success();
};
@@ -1131,7 +1129,7 @@ Error ResourceFileWriter::writeMenuDefinitionList(
Error ResourceFileWriter::writeMenuBody(const RCResource *Base) {
// At first, MENUHEADER structure. In fact, these are two WORDs equal to 0.
// Ref: msdn.microsoft.com/en-us/library/windows/desktop/ms648018.aspx
- writeObject<uint32_t>(0);
+ writeInt<uint32_t>(0);
return writeMenuDefinitionList(cast<MenuResource>(Base)->Elements);
}
@@ -1250,9 +1248,9 @@ Error ResourceFileWriter::writeVersionInfoBlock(const VersionInfoBlock &Blk) {
uint64_t LengthLoc;
if (OutputHeader) {
- LengthLoc = writeObject<uint16_t>(0);
- writeObject<uint16_t>(0);
- writeObject<uint16_t>(true);
+ LengthLoc = writeInt<uint16_t>(0);
+ writeInt<uint16_t>(0);
+ writeInt<uint16_t>(1); // true
RETURN_IF_ERROR(writeCString(Blk.Name));
padStream(sizeof(uint32_t));
}
@@ -1304,9 +1302,9 @@ Error ResourceFileWriter::writeVersionInfoValue(const VersionInfoValue &Val) {
return createError(Twine("VALUE ") + Val.Key +
" cannot contain both strings and integers");
- auto LengthLoc = writeObject<uint16_t>(0);
- auto ValLengthLoc = writeObject<uint16_t>(0);
- writeObject<uint16_t>(HasStrings);
+ auto LengthLoc = writeInt<uint16_t>(0);
+ auto ValLengthLoc = writeInt<uint16_t>(0);
+ writeInt<uint16_t>(HasStrings);
RETURN_IF_ERROR(writeCString(Val.Key));
padStream(sizeof(uint32_t));
OpenPOWER on IntegriCloud