Andoni Morales <[email protected]> writes:

> Building libintl targeting the 10.6 SDK with a newer SDK (10.7 or
> 10.8) leads to the following abort in Snow Leopard:
> libSystem.B.dylib 0x00007fff872940b6 __kill + 10
> libSystem.B.dylib 0x00007fff873349f6 abort + 83
> libintl.8.dylib 0x000000010072148d _nl_load_domain + 3802
> libintl.8.dylib 0x000000010072050e _nl_find_domain + 460
> libintl.8.dylib 0x00000001007230ed libintl_dcigettext + 1132
>
> In 10.7 and 10.8 pthread.h defines unconditionally
> PTHREAD_RECURSIVE_MUTEX_INITIALIZER, which is undefined in 10.6. So
> building with -mmacosx-version-min=10.6 using a newer SDK causes the
> above error when used in Snow Leopard.

Thanks for the report and patch.  However,

>  # include <pthread.h>
>  
> +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_6

I doubt this works as expected on platforms other than Mac OS X, since
#if directive treats non-macro identifiers as zero[1].  And perhaps we
might better use a numeric value instead of MAC_OS_X_VERSION_10_6 to
support older Mac OS X versions.

> +#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER
> +#undef PTHREAD_RECURSIVE_MUTEX_INITIALIZER
> +#endif

Probably it can be safely #undef'ed without #ifdef.

Footnotes: 
[1]  http://gcc.gnu.org/onlinedocs/gcc-4.8.0/cpp/If.html#If

Regards,
-- 
Daiki Ueno

Reply via email to