Commit Graph

1078 Commits

Author SHA1 Message Date
Max Kellermann 2c7ca16c4e lib/fmt/ToBuffer: add constexpr 2025-01-29 18:12:08 +01:00
Max Kellermann 57e7fb3f62 tag/Id3Load, ...: use std::make_unique_for_overwrite()
Don't zero-initialize the buffers.  This removes some useless
overhead.
2025-01-29 12:01:27 +01:00
Max Kellermann a5da7fd51a Merge branch 'v0.23.x' 2025-01-28 19:33:19 +01:00
Max Kellermann 0aeda01ba6 lib/yajl: drop "yajl/" prefix from #include paths
According to the yajl API documentation, #include lines should have
the "yajl/" path prefix, but the actual pkg-config file contains:

 includedir=${dollar}{prefix}/include/yajl

.. which already contains this directory name, and thus the "yajl/"
prefix cannot work.  Unfortunately, the yajl project hasn't been
maintained for nearly 10 years, and there's little chance this bug
will ever be fixed.
2025-01-28 19:27:46 +01:00
Max Kellermann 578c94081f subprojects: add curl 2025-01-28 19:12:57 +01:00
Max Kellermann 2752f67877 lib/nfs/meson.build: add missing dependency on libevent.a 2025-01-28 19:05:09 +01:00
Max Kellermann f55e0df614 lib/curl/meson.build: add missing internal dependency on libevent.a 2025-01-28 18:52:37 +01:00
Max Kellermann 177ffde90f Merge branch 'v0.23.x' 2025-01-28 18:45:02 +01:00
Max Kellermann 508bfbe334 pipewire/meson.build: add "include_type:system"
This suppresses a compiler warning due to sloppy code in PipeWire:

 /usr/include/spa-0.2/spa/utils/json-core.h:440:29: error: implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion]
   440 |         return spa_dtoa(str, size, val);
       |                ~~~~~~~~            ^~~
2025-01-28 18:34:12 +01:00
Michael Herstine 194ecd69e0 lib/fmt: remove even more now-broken uses of FMT_STRING
MPD stopped building since fmt 11.1.0; see
<https://github.com/fmtlib/fmt/issues/4304>. The first commit
fixing this was 9db7144, followed by 5de0909 (both on the
unstable branch).

This commit removes what the author believes to be the remaining
uses in the MPD codebase.
2025-01-20 19:54:41 -08:00
Michael Cho 4a49f75799 meson.build: support building with ICU 76
ICU 76 decided to reduce overlinking[^1] thus `icu-i18n` will no longer
add `icu-uc` when linking to shared libraries. This results in failure:
```
src/lib/icu/libicu.a.p/Converter.cxx.o: undefined reference to symbol 'ucnv_fromUnicode_76'
```

[^1]: https://github.com/unicode-org/icu/commit/199bc827021ffdb43b6579d68e5eecf54c7f6f56

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2151
2024-12-03 12:47:55 +01:00
Rudi Heitbaum a42da90042 lib/fmt: support build with libfmt-11.0.0
Upstream libfmt commit fmtlib/fmt@d707292
now requires the format function to be const.

Adjust the function prototype so it is const and can compile.

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2141
2024-12-03 12:42:02 +01:00
Michael Cho 1a063fee7e meson.build: support building with ICU 76
ICU 76 decided to reduce overlinking[^1] thus `icu-i18n` will no longer
add `icu-uc` when linking to shared libraries. This results in failure:
```
src/lib/icu/libicu.a.p/Converter.cxx.o: undefined reference to symbol 'ucnv_fromUnicode_76'
```

[^1]: https://github.com/unicode-org/icu/commit/199bc827021ffdb43b6579d68e5eecf54c7f6f56
2024-10-27 09:57:22 -04:00
Max Kellermann 752c6c1f03 lib/fmt/ExceptionFormatter: move the exception_ptr 2024-09-27 08:48:30 +02:00
Max Kellermann ed755f04e9 lib/fmt/meson.build: suppress -Warray-bounds with GCC 14
The bug is still present in GCC 14.
2024-08-30 12:48:41 +02:00
Max Kellermann d207c144d6 lib/curl/Multi: remove the Wait() overload with "int" timeout
Enforce type-safety.
2024-08-30 12:30:18 +02:00
Max Kellermann 435f1eb6cc lib/curl/Multi: remove default timeout value
-1 is an illegal value and leads to CURLM_BAD_FUNCTION_ARGUMENT.  Our
API shouldn't imply this value.
2024-08-30 12:30:15 +02:00
Max Kellermann f7790430a0 lib/curl/Multi: add SetSocketFunction(), SetTimerFunction() 2024-07-31 10:06:29 +02:00
Max Kellermann fb151c8662 lib/fmt/meson.build: suppress -Warray-bounds with GCC 13 2024-07-29 22:13:11 +02:00
Max Kellermann 323517753d lib/fmt/meson.build: remove obsolete clang 14 workaround
Android NDK r27 has clang 18 and I don't feel like supporting clang 14.
2024-07-29 22:11:20 +02:00
Max Kellermann 9c8f4aaf99 lib/alsa/meson.build: require libasound 1.2 or later
This allows us to drop the 1.1.4 snd_pcm_drain() bug workaround (added
by commit f85d4d28d1).
2024-07-29 15:42:46 +02:00
Max Kellermann 90dfa437e0 lib/alsa/NonBlock: use a persistent pollfd array
This implements the semantic API change introduced by commit
https://github.com/alsa-project/alsa-lib/commit/cd04da2bcfe147b08b8db2930b2294aead0a8968
2024-07-11 21:47:15 +02:00
Max Kellermann 4486b2eded lib/alsa/NonBlock: add common base class 2024-07-11 21:38:45 +02:00
Max Kellermann 3db8a4f41b lib/alsa/NonBlock: embed in "namespace Alsa" 2024-07-11 21:33:03 +02:00
Max Kellermann 9704cf3dcb lib/alsa/NonBlock: fix lambda indent 2024-07-11 21:12:18 +02:00
Max Kellermann 9aa6b03ba8 event/MultiSocketMonitor: pass std::span to ReplaceSocketList() 2024-07-11 21:09:27 +02:00
Max Kellermann 13576b8a2e lib/curl/Easy: use pass std::chrono::duration to SetTimeout() 2024-07-10 16:58:16 +02:00
Max Kellermann 8790f2469c lib/fmt/SocketAddressFormatter: switch to the new net/FormatAddress library 2024-07-05 18:39:10 +02:00
Max Kellermann 28c030c0f0 lib/fmt/SocketAddressFormatter: add const for fmt 11 support
See https://github.com/fmtlib/fmt/commit/d70729215fba1d54862e407b626abf86ddf409bf
2024-07-05 18:21:38 +02:00
Max Kellermann 175103e8d4 lib/fmt/ExceptionFormatter: un-inline to reduce header dependencies 2024-07-05 18:20:31 +02:00
Max Kellermann 3f638eeed6 lib/fmt/SocketAddressFormatter: un-inline to reduce header dependencies 2024-07-05 18:20:31 +02:00
Max Kellermann 044280c538 meson.build: require Meson 1.0
Debian Bookworm (the current stable) has 1.0.1 and Ubuntu LTS 24.04
has 1.3.2.  It's acceptable to require at least version 1.0 now.
2024-07-05 17:23:52 +02:00
Rudi Heitbaum 1402869715 lib/fmt: support build with libfmt-11.0.0
Upstream libfmt commit fmtlib/fmt@d707292
now requires the format function to be const.

Adjust the function prototype so it is const and can compile.

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
2024-07-05 14:33:07 +00:00
Max Kellermann ac1265b9cc output/alsa: set up the ALSA channel map
This is necessary for proper multi-channel support because many ALSA
drivers do not use the channel maps from surround*.conf.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2063
2024-06-27 21:52:38 +02:00
Max Kellermann a739eefb01 lib/zlib/Error: derive from std::system_error 2024-06-25 20:32:33 +02:00
Max Kellermann 381215fd73 *: use std::scoped_lock with implicit template parameter 2024-05-23 20:54:49 +02:00
Max Kellermann 64bdaa46fb lib/curl/Init: use std::scoped_lock with implicit template parameter 2024-05-23 20:44:12 +02:00
Max Kellermann 6e16eaebba lib/fmt/SystemError: include <array> only on Windows 2024-05-23 20:31:56 +02:00
Max Kellermann b64d01677b storage/nfs: optimize OpenFile() 2024-05-17 13:39:42 +02:00
Max Kellermann 9e8128ecb5 lib/nfs/FileReader: convert path to std::string 2024-05-17 12:54:08 +02:00
Max Kellermann 58e3b830e9 lib/nfs/FileReader: clear the read_buffer in CancelRead()
Fixes assertion failure with libnfs 6.
2024-05-17 12:53:35 +02:00
Max Kellermann 1d35031024 lib/nfs/Connection: merge CancelAndClose() into Cancel() 2024-05-17 12:53:30 +02:00
Max Kellermann 96b61755da lib/nfs/FileReader: fix doc typo 2024-05-15 21:31:30 +02:00
Max Kellermann 31e583e9f8 lib/nfs: initial support for libnfs API 2
Commit
https://github.com/sahlberg/libnfs/commit/5e8f7ce273308eb77f94248f4501e574a703c1a5
introduced the libnfs API version 2 which may eventually become libnfs
version 6.

This version detection depends on my pull request
https://github.com/sahlberg/libnfs/pull/468
2024-05-15 06:01:42 +02:00
Max Kellermann 0ac24e5a24 lib/nfs/FileReader: move code to ReadCallback() 2024-05-15 06:00:37 +02:00
Max Kellermann 98f53b6d3d lib/nfs/Connection: add DisposablePointer parameter to CancelAndClose()
Just in case somebody needs to free a buffer after the NFS
cancellation has completed.
2024-05-15 06:00:35 +02:00
Max Kellermann 48d3bd1cca lib/nfs/Connection: add API documentation 2024-05-14 19:57:50 +02:00
Max Kellermann 5cffd4f673 lib/nfs/Connection: remove EnableCloseOnExec() call
SOCK_CLOEXEC has been added to libnfs version 2, and since we require
at least version 4, we can safely remove this call.
2024-05-14 19:51:52 +02:00
Max Kellermann 64c291ba78 lib/nfs/Connection: suppress bogus clang warning
We do need to capture "this" because we use "this->active_leases", but
clang 18 is too dumb to understand this.
2024-05-13 18:30:05 +02:00
Max Kellermann dcde2a0bae lib/nfs/Connection: fix -Wunused-lambda-capture 2024-05-13 18:27:38 +02:00