3 Downloaded from upstream commit
4 https://git.gnome.org/browse/libxml2/commit/?id=fff8a6b87e05200a0ad0af6f86c2e859c7de9172
6 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
8 From fff8a6b87e05200a0ad0af6f86c2e859c7de9172 Mon Sep 17 00:00:00 2001
9 From: Michael Heimpold <mhei@heimpold.de>
10 Date: Mon, 22 Dec 2014 11:12:12 +0800
11 Subject: threads: use forward declarations only for glibc
15 The declarations of pthread functions, used to generate weak references
16 to them, fail to suppress macros. Thus, if any pthread function has
17 been provided as a macro, compiling threads.c will fail.
18 This breaks on musl libc, which defines pthread_equal as a macro (in
19 addition to providing the function, as required).
21 Prevent the declarations for e.g. musl libc by refining the condition.
23 The idea for this solution was borrowed from the alpine linux guys, see
24 http://git.alpinelinux.org/cgit/aports/tree/main/libxml2/libxml2-pthread.patch
26 Signed-off-by: Michael Heimpold <mhei@heimpold.de>
28 diff --git a/threads.c b/threads.c
29 index 8921204..78006a2 100644
35 static int libxml_is_threaded = -1;
37 +#if defined(__GNUC__) && defined(__GLIBC__)
39 #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
40 extern int pthread_once (pthread_once_t *__once_control,
41 @@ -89,7 +89,7 @@ extern int pthread_cond_signal ()
45 -#endif /* __GNUC__ */
46 +#endif /* defined(__GNUC__) && defined(__GLIBC__) */
47 #endif /* HAVE_PTHREAD_H */