Files
winf-photobooth/package/freeswitch/0003-apr-fix-musl-build.patch
Michael b8783708ae Initial Commit
- initial default booting image
2026-11-06 20:45:42 +01:00

66 lines
2.0 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
From 81bbf05838fc24b221debfdf75ab8a4c7e7b260c Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd@kuhls.net>
Date: Fri, 29 May 2026 08:14:32 +0200
Subject: [PATCH] apr: fix musl build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
strerror_r on musl always returns an int since its addition back in 2011
with
https://git.musl-libc.org/cgit/musl/commit/src/string/strerror_r.c?id=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01
Add defines created by freeswitch configure to apr subproject to fix the
build error:
misc/unix/errorcodes.c: In function ‘native_strerror’:
misc/unix/errorcodes.c:358:9: error: assignment to ‘const char *’ from
‘int’ makes pointer from integer without a cast [-Wint-conversion]
358 | msg = strerror_r(statcode, buf, bufsize);
Upstream: https://github.com/signalwire/freeswitch/pull/3046
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
libs/apr/misc/unix/errorcodes.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/libs/apr/misc/unix/errorcodes.c b/libs/apr/misc/unix/errorcodes.c
index 3be0b25b93..93c428df62 100644
--- a/libs/apr/misc/unix/errorcodes.c
+++ b/libs/apr/misc/unix/errorcodes.c
@@ -25,6 +25,9 @@
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
+#ifndef WIN32
+#include "../../../src/include/switch_private.h"
+#endif
/*
* stuffbuffer - like fspr_cpystrn() but returns the address of the
@@ -352,12 +355,20 @@ const char *strerror_r(fspr_status_t, char *, fspr_size_t);
static char *native_strerror(fspr_status_t statcode, char *buf,
fspr_size_t bufsize)
{
+#if defined(STRERROR_R_CHAR_P)
const char *msg;
+#else
+ int msg;
+#endif
buf[0] = '\0';
msg = strerror_r(statcode, buf, bufsize);
if (buf[0] == '\0') { /* libc didn't use our buffer */
+#if defined(STRERROR_R_CHAR_P)
return stuffbuffer(buf, bufsize, msg);
+#else
+ return stuffbuffer(buf, bufsize, (const char*)msg);
+#endif
}
else {
return buf;
--
2.47.3