Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 1 | From a610f4c21b083c0f9cf62ad2251dfadc98abb50e Mon Sep 17 00:00:00 2001 |
| 2 | From: Rudi Heitbaum <rudi@heitbaum.com> |
| 3 | Date: Sat, 22 Jul 2023 15:36:09 +0000 |
| 4 | Subject: [PATCH] alsactl: add define to compile with glibc 2.38 |
| 5 | |
| 6 | strlcat and strlcpy have been added to glibc 2.38. |
| 7 | update the defines to use the glibc versions, and not conflict with |
| 8 | string.h. |
| 9 | |
| 10 | ref: |
| 11 | - https://sourceware.org/git/?p=glibc.git;a=commit;h=454a20c8756c9c1d55419153255fc7692b3d2199 |
| 12 | |
| 13 | Fixes: https://github.com/alsa-project/alsa-utils/pull/225 |
| 14 | Signed-off-by: Jaroslav Kysela <perex@perex.cz> |
| 15 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> |
| 16 | |
| 17 | Upstream-Status: Backport [https://github.com/alsa-project/alsa-utils/commit/d6a71bfbde9e1710743d3a446c6ea3b41c45234e] |
| 18 | --- |
| 19 | alsactl/init_sysdeps.c | 2 ++ |
| 20 | 1 file changed, 2 insertions(+) |
| 21 | |
| 22 | diff --git a/alsactl/init_sysdeps.c b/alsactl/init_sysdeps.c |
| 23 | index 3aca1b4..f09b1ae 100644 |
| 24 | --- a/alsactl/init_sysdeps.c |
| 25 | +++ b/alsactl/init_sysdeps.c |
| 26 | @@ -18,6 +18,7 @@ |
| 27 | */ |
| 28 | |
| 29 | #if defined(__GLIBC__) && !(defined(__UCLIBC__) && defined(__USE_BSD)) |
| 30 | +#if !(__GLIBC_PREREQ(2, 38)) |
| 31 | static size_t strlcpy(char *dst, const char *src, size_t size) |
| 32 | { |
| 33 | size_t bytes = 0; |
| 34 | @@ -60,4 +61,5 @@ static size_t strlcat(char *dst, const char *src, size_t size) |
| 35 | *q = '\0'; |
| 36 | return bytes; |
| 37 | } |
| 38 | +#endif /* !(__GLIBC_PREREQ(2, 38)) */ |
| 39 | #endif /* __GLIBC__ */ |