]> git.ipfire.org Git - thirdparty/ccache.git/commit
fix: Work around endianness problem in Util::read_text_file
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 19 Mar 2022 19:23:21 +0000 (20:23 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 19 Mar 2022 19:53:03 +0000 (20:53 +0100)
commitdfb3111f71ea19e7d2c3aaf161ba96a44e2af155
tree10f199ee37bb7f996cd03c1789fb5db77eb5fd97
parent05ac8dc345e758a3d31859e01b26a0104c0707e6
fix: Work around endianness problem in Util::read_text_file

The code in Util::read_text_file for converting UTF-16LE to UTF-8 only
works on little-endian machines. This makes the unit test fail on
big-endian machines.

Since the conversion is only needed on Windows (for Visual Studio, which
creates UTF-16LE .rsp files) in practice, work around the problem by
only doing the conversion in Windows builds.

Fixes #1014.
src/Util.cpp
unittest/test_Util.cpp