From 3411f9399c3ab6d642f350ea8e4c355f719d01d9 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 15 Sep 2010 11:53:47 -0400 Subject: [PATCH] Support __thread on MINGW 4.5 By the way, it seems that with gcc 4.5.0 from mingw.org, __thread, sse and mmx work fine. I added the below to pixman 0.18 and as far as I can see, it works. make check reports no problems. (Earlier I had to use --disable-mmx and --disable-sse2.) Also gtk-demo and gimp run fine. (Also a change to get rid of the warnings about -fvisibility being ignored.) --- configure.ac | 8 ++++++-- pixman/pixman-compiler.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index d3b71fa..47213a0 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,9 @@ dnl -fvisibility stuff PIXMAN_CHECK_CFLAG([-fvisibility=hidden], [dnl #if defined(__GNUC__) && (__GNUC__ >= 4) +#ifdef _WIN32 +#error Have -fvisibility but it is ignored and generates a warning +#endif #else error Need GCC 4.0 for visibility #endif @@ -643,8 +646,9 @@ support_for__thread=no AC_MSG_CHECKING(for __thread) AC_LINK_IFELSE([ -#ifdef __MINGW32__ -#error MinGW has broken __thread support +#ifdef defined __MINGW32__ && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) +#error This MinGW version has broken __thread support +#endif #endif #ifdef __OpenBSD__ #error OpenBSD has broken __thread support diff --git a/pixman/pixman-compiler.h b/pixman/pixman-compiler.h index 5501396..22b9fe7 100644 --- a/pixman/pixman-compiler.h +++ b/pixman/pixman-compiler.h @@ -60,7 +60,7 @@ #endif /* GCC visibility */ -#if defined(__GNUC__) && __GNUC__ >= 4 +#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(_WIN32) # define PIXMAN_EXPORT __attribute__ ((visibility("default"))) /* Sun Studio 8 visibility */ #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) -- 2.7.4