It seems CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS on CMake 3.27 breaks
compilation on Windows.
The reason for it here is wrong: unit tests do not need non exported
symbols.
* This matches an alias target name
* Recommend using the namespaced target in the README
Signed-off-by: Ryan Friedman <ryan.friedman+github@avinc.com>
c == 0 was a dead branch because of the way printable ascii was
calculated. Move it up instead.
While at it, replace std::transform with std::replace. Easier to read.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
GCC is able to see that the branch is useless as it can be done at
compile time. Produces shorter assembly with both -O2 and -O3.
Assign the pointer to the std::string directly and use proper iterators
with std::transform. Also produces shorter assembly.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The actual values of errno constants are not specified in POSIX, and
left as implementation details; hence, tweak the check for the ENOENT
description to not check for the actual value.
Setting the initial parts (data1_, data2_, data3_) from the bytes
directly using memcpy() means that they will be interpreted depending
on the platform endianness. For example, the initial 4 bytes of the ASF
header are 0x30, 0x26, 0xB2, 0x75, which will be read as 0x3026B275 on
big endian platforms, never matching the actual GUID (0x75B22630), which
is always specified in little endian format.
Hence, when reading a GUID from data, make sure to turn the GUID parts
to little endian. This fixes the reading of ASF files on big endian
platforms.
Fixes commit bed8d3d93c
GCC is able to see that the branch is useless as it can be done at
compile time. Produces shorter assembly with both -O2 and -O3.
https://godbolt.org/z/ejhfxh8Tx
Signed-off-by: Rosen Penev <rosenp@gmail.com>
More readable anyway.
Also remove specific version. Problems have been fixed already. All
versions should work the same now.
Signed-off-by: Rosen Penev <rosenp@gmail.com>