Index: trunk/src/sh_mem.c
===================================================================
--- trunk/src/sh_mem.c	(revision 138)
+++ trunk/src/sh_mem.c	(revision 139)
@@ -19,4 +19,8 @@
 
 #include "config_xor.h"
+
+#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
+#define _XOPEN_SOURCE 500
+#endif
 
 #include <stdio.h>
Index: trunk/src/sh_pthread.c
===================================================================
--- trunk/src/sh_pthread.c	(revision 138)
+++ trunk/src/sh_pthread.c	(revision 139)
@@ -15,5 +15,5 @@
 }
 
-
+#if !defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
 /**
  * libxml2 threads.c: set of generic threading related routines 
@@ -73,2 +73,5 @@
 }
 #endif
+
+
+#endif
