Fix thread safety on mingw-w64 and clang
authorBenjamin Gilbert <bgilbert@backtick.net>
Sun, 2 Dec 2012 04:55:31 +0000 (23:55 -0500)
committerSiarhei Siamashka <siarhei.siamashka@gmail.com>
Sat, 8 Dec 2012 14:41:10 +0000 (16:41 +0200)
After finding a working TLS storage class specifier, configure was
continuing to test other candidates.  This caused it to prefer
__declspec(thread) over __thread.  However, __declspec(thread) is
ignored with a warning by mingw-w64 [1] and silently ignored by clang [2].
The resulting binary behaved as if PIXMAN_NO_TLS was defined.

Bug introduced by a069da6c.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=57591
[2] http://lists.freedesktop.org/archives/pixman/2012-October/002320.html

configure.ac

index 45b709d..81f068d 100644 (file)
@@ -860,7 +860,7 @@ AC_CACHE_VAL(ac_cv_tls, [
 #error OpenBSD has broken __thread support
 #endif
 
-int $kw test;], [], ac_cv_tls=$kw)
+int $kw test;], [], [ac_cv_tls=$kw; break])
     done
 ])
 AC_MSG_RESULT($ac_cv_tls)