GNOME Bugzilla – Bug 704908
Failure to suppress macros when re-declaring pthread functions
Last modified: 2015-10-16 10:32:57 UTC
The declarations of pthread functions in threads.c, used to generate weak references to them, fail to suppress macros. Thus, if any pthread function has been provided as a macro, compiling threads.c will fail. This breaks on musl libc, which defines pthread_equal as a macro (in addition to providing the function, as required). There are three possible solutions: 1. Move the declarations before the inclusion of pthread.h. 2. #undef all of them to ensure that the function is used instead of a macro. 3. Enclose the names in parentheses (e.g. extern int (pthread_equal)() ...) so that function-like macro expansion is inhibited.
current code does static int libxml_is_threaded = -1; #if defined(__GNUC__) && defined(__GLIBC__) #ifdef linux #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3) extern int pthread_once (pthread_once_t *__once_control, so assuming the musc don't define __GLIBC___ then the issue ought to be fixed in git already, Daniel