The following user-settable values for CMake are supported:
- TESTS_DIR: Tests directory, is path to unit test data when 'data' is
appended. Can be used to run the unit tests on a target.
- TESTS_TMPDIR: Directory for temporary files created during unit tests,
system tmpdir is used if undefined. Has to be defined on systems
without global temporary directory.
* Add Shorten (SHN) support
* Add `<cmath>` include and use `std::log2`
* Use `uintptr_t` for buffer size calculations
* Work around `byteSwap` not using fixed width types
* Remove four-character codes
* Attempt to fix `static_assert`
* Revert previous commit
* Update `read_uint`* functions
* Use ByteVector for byte swaps
* Use different ByteVector ctor
* Rework variable-length input to use ByteVector
* Rename some variables
* Naming and formatting cleanup
* Add basic Shorten tests
* Rename a constant
* Rename `internalFileType` to `fileType`
* Add documentation on `fileType` meaning
* Add DO_NOT_DOCUMENT guard
* Fix shadowVariable issues reported by cppcheck
cppcheck --enable=all --inline-suppr \
--suppress=noExplicitConstructor --suppress=unusedFunction \
--suppress=missingIncludeSystem --project=compile_commands.json
* Formatting cleanup
* More explicit types
Reason for these changes: getRiceGolombCode(k, uInt32CodeSize) was
called with int k for uint32_t& argument.
There was also a warning from MSVC for line 299:
warning C4267: 'argument': conversion from 'size_t' to 'int'
* Additional explicit types
* Rename `SHN` namespace to `Shorten`
Also rename files to match
---------
Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
This affects for example openSUSE Leap 15.6, which installs
utfcpp 3.2.1 in its own folder.
Now not only utf8::cpp, but also utf8cpp is supported as a CMake
target.
The -p option of tagwriter sample does not work.
This is because the picture file is open in text mode instead of binary.
Also, the isFile function does not work on Windows in 32 bit mode with
large files. Using _stat64 instead of stat solves the problem.
When building WASM with emscripten
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/Emscripten.cmake ...
all SIZEOF_ variables which should be defined in ConfigureChecks.cmake
are empty and the wchar_t check fails with "LESS" "2", the other
checks seem to pass since they start with NOT. Instead of explicitly
skipping the check for "if(NOT EMSCRIPTEN)" as is done in vcpkg's
disable-wchar-t-check-emscripten.patch, the check is inverted to
start with NOT, so the build still has a chance to run for compilers
which behave like emscripten.
To make sure paths longer than MAX_PATH (260) can be opened, prefix local
paths with `\\?\`, and UNC paths with `\\?\UNC\`.
I've tested on Windows 10 22H2 (Build 19045.3930), even when setting
LongPathsEnabled to 1 in the registry, it still won't open files with long
paths without prefixing them.
For more information see:
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry