Commit Graph

1088 Commits

Author SHA1 Message Date
e8b4279062 Don't use sendfile64() if input and output are the same to avoid EBADF
This does not work and leads to sendfile64() running into EBADF ("Bad file
descriptor").
2023-04-23 21:21:32 +02:00
a55a3604bd Fallback from sendfile64() in case of ENOSYS as well
As suggested on https://man7.org/linux/man-pages/man2/sendfile.2.html.
2023-04-23 21:04:31 +02:00
da91e54ec7 Disable use of sendfile64() by default
When changing tagparser to actually make use of the overloads
that use sendfile64() it breaks with "Bad file descriptor". So
better disable this until it has been better tested.
2023-04-23 20:51:33 +02:00
83025c17a1 Fallback to unoptimized version if sendfile64() fails
It might fail on some filesystems such as `ecryptfs`, see
https://github.com/Martchus/cpp-utilities/issues/24.
2023-04-23 19:38:56 +02:00
2467c4f815 Make use of platform-specific APIs for optimizing CopyHelper configurable
There might be unexpected limitations like
https://github.com/Martchus/cpp-utilities/issues/24. To be able to at least
workaround those limitations it makes sense to allow disabling the
optimization completely.
2023-04-23 19:23:47 +02:00
10a7e4d814 Bump patch version 2023-04-06 18:09:42 +02:00
59896da087
Merge pull request #23 from ahesford/minimalism
Fix use of `sendfile()` on 32-bit systems
2023-04-06 18:06:59 +02:00
Andrew J. Hesford
c9131ce6e7 Fix use of sendfile() on 32-bit systems 2023-04-06 11:36:06 -04:00
4316dfd846 Fix formatting in README 2023-04-04 17:10:34 +02:00
873cf513c3 Improve README
* Wrap long lines
* Improve wording
* Mention icon bundling
* Remove obsolete notes
* List requires MSYS2 and VCPKG packages for Windows builds using CMake
  preset
2023-03-30 21:37:51 +02:00
48aa1f54e0 Add FFMPEG_BIN to Windows preset 2023-03-30 21:33:42 +02:00
b426443aaf Workaround issues with win-x64-msvc-static preset
* Set CXX flags manually to specify the `/MT` flag explicitly; this is
  needed as compilations of moc objects apparently don't pick-up the
  variable `CMAKE_MSVC_RUNTIME_LIBRARY` and instead use what the Qt build
  had used (which breaks the compilation when using a shared Qt build with
  this setup which otherwise prefers static libraries)
* Set build type explicitly to release as otherwise a debug build would be
  made (but we have `win-x64-msvc-static-debug` for that)
* Specify the VCPKG target triplet to prefer static libs
* Disable the Qt Quick GUI for now; otherwise passwordmanager is trying to
  pull-in kirigami
* Remove most hardcoded paths for dependencies; with the correct VCPKG
  target triplet those paths can be auto-detected (except for CppUnit)
2023-03-29 23:40:57 +02:00
2a123df86d Avoid use of non-standard escape character to avoid MSVC warning about it 2023-03-26 21:49:54 +02:00
bcd5816d23 Apply clang-format and cmake-format 2023-03-25 18:52:13 +01:00
d94e49620d Add paths for Doxygen and clang-format to Windows preset 2023-03-23 21:51:57 +01:00
c3470d0378 Improve build instructions
* Move packaging info into its own section
* Link build instructions for Tag Editor as well as they differ
  slightly from Syncthing Tray
* Use consistent path separator for Windows-specific variables
2023-03-20 23:01:00 +01:00
9bd7dbc41c Use Ninja in build example 2023-03-20 22:49:26 +01:00
9b1a7b3bf4 Fix includes in copy.h when using sendfile() 2023-03-19 20:09:14 +01:00
ec891b48f6 Use sendfile() to speed up copying 2023-03-19 20:02:32 +01:00
7a5a02976a Fix symbol visibility when building Android apps 2023-03-19 20:02:32 +01:00
6e28bec4c5 Add REALPATH_BIN to Windows-preset for CMake bug workaround 2023-03-16 01:02:49 +01:00
65b86d71f6 Set QT_ANDROID_VERSION_NAME for Android target 2023-03-11 19:59:09 +01:00
ab298b200f Apply clang-format 2023-03-11 17:05:08 +01:00
2a9949ce77 Tweak app target creation for Android deployment via Qt 6 helpers 2023-03-11 17:04:41 +01:00
e2593cea2a Bump minor version 2023-03-11 17:00:04 +01:00
6ec77a1d1c Add extractNativePath() as counterpart to makeNativePath() 2023-03-06 22:17:44 +01:00
283c416a59 Add preset for building on Windows with MSVC 2023-03-06 22:17:37 +01:00
4aea7f5a57 Set KF_PACKAGE_PREFIX as well when building against Qt 6 2023-03-05 12:26:33 +01:00
169756fce4 Fix loop-condition in iotests.cpp 2023-02-28 21:18:15 +01:00
30819d9e85 Improve condition for use of pubsetbuf
Using this function like this seems only be possible with `libstdc++`. The
standard lib of MSVC and Clang both don't support this (so it is not just
MSVC and thus not Windows-specific).
2023-02-28 21:17:33 +01:00
78d57902a7 Workaround MSVC-specific issues in testsuite so tests pass with MSVC 2023-02-28 00:07:56 +01:00
2b6f26895d Support multiple source directories in srcdirref file
* Locate test files in all source directories specified in `srcdirref`
* Allow overriding contents of `srcdirref` so the directory of another
  component (within the same repository) can be appended to share testfiles
2023-02-27 18:29:31 +01:00
a703813b4c Mark helper functions of testutils.cpp as static; they're not used elsewhere 2023-02-27 18:29:21 +01:00
07e9546855 Avoid relying on compiler optimizations for binary conversions
* Add/update binary conversion functions to use `std::memcopy`
* Only GCC could actually optimize the custom code using bit operations
    * Clang could only optimize the `getBytes()` functions
    * MSVC could not optimize any of the functions
* The to…Int…() functions cannot be updated as they are `constexpr` (and
  thus `std::memcopy` and `reinterpret_cast` cannot be used). So they stay
  as-is and `toInt()` has been added instead
* The `BinaryReader` class has been updated to use the new `toInt()`
  function
2023-02-05 21:29:22 +01:00
147d36a578 Improve messages of conversion tests 2023-02-05 21:21:26 +01:00
31f369d051 Add signed versions of swapOrder() functions 2023-02-05 21:20:53 +01:00
66621d757b Bump minor release 2023-02-05 20:40:24 +01:00
3b2615fa62 Move BE/LE namespaces to the end so these functions can use previous helpers 2023-02-05 20:17:32 +01:00
b3fd365502 Use std::byteswap() when compiling in C++23 mode 2023-02-05 20:15:29 +01:00
8588c17df3 Remove wrong includes in binaryconversionprivate.h
This header is not meant to be self-contained and must not include any
other headers.
2023-02-05 19:57:36 +01:00
7d6fc9721a Apply clang-format/cmake-format 2023-02-03 13:31:18 +01:00
be6626f6a6 Fix using percentage operators of stringbuilder.h with MSVC 2023-02-01 00:43:53 +01:00
024865cc44 Fix building conversion tests with MSVC 2023-02-01 00:42:44 +01:00
b9b8bfc62a Fix and improve code for finding CppUnit
* Remove `FORCE` in initialization of cache variables as this makes the
  library/include dir effectively *not* configurable
* Try using `find_package()` as the vcpkg package provides a CMake module
2023-01-31 22:37:06 +01:00
25e4eebb64 Avoid MSVC warning about possible overflow 2023-01-31 22:37:06 +01:00
4d96a82ed9 Workaround unfortunate macro definition in windows.h 2023-01-31 22:37:06 +01:00
a5a33bbcef Add missing include for std::tuple to argumentparser.h 2023-01-31 22:37:06 +01:00
da830dcef5 Apply clang-format and cmake-format 2023-01-28 20:20:47 +01:00
3a4d71ef5c Avoid unqualified call to std::move 2023-01-28 20:20:30 +01:00
53ce099bf9 Apply clang-format 2023-01-28 18:49:54 +01:00