SDL-1.2: Fixed recursive mutexes on Linux (thanks, Ozkan!). SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Mon, 23 Mar 2015 20:10:08 -0400
branchSDL-1.2
changeset 9425 d2bc9b3760fb
parent 9308 bda7de312fbd
child 9426 c238763e1228
SDL-1.2: Fixed recursive mutexes on Linux (thanks, Ozkan!).
configure.in
src/thread/pthread/SDL_sysmutex.c
--- a/configure.in	Mon Jan 12 21:18:31 2015 +0100
+++ b/configure.in	Mon Mar 23 20:10:08 2015 -0400
@@ -2022,7 +2022,8 @@
             AC_MSG_CHECKING(for recursive mutexes)
             has_recursive_mutexes=no
             if test x$has_recursive_mutexes = xno; then
-                AC_TRY_COMPILE([
+                AC_TRY_LINK([
+                  #define _GNU_SOURCE 1
                   #include <pthread.h>
                 ],[
                   pthread_mutexattr_t attr;
@@ -2033,7 +2034,8 @@
                 ])
             fi
             if test x$has_recursive_mutexes = xno; then
-                AC_TRY_COMPILE([
+                AC_TRY_LINK([
+                  #define _GNU_SOURCE 1
                   #include <pthread.h>
                 ],[
                   pthread_mutexattr_t attr;
--- a/src/thread/pthread/SDL_sysmutex.c	Mon Jan 12 21:18:31 2015 +0100
+++ b/src/thread/pthread/SDL_sysmutex.c	Mon Mar 23 20:10:08 2015 -0400
@@ -21,6 +21,9 @@
 */
 #include "SDL_config.h"
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
 #include <pthread.h>
 
 #include "SDL_thread.h"