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 9425d2bc9b3760fb
parent 9308 bda7de312fbd
child 9426 c238763e1228
SDL-1.2: Fixed recursive mutexes on Linux (thanks, Ozkan!).
configure.in
src/thread/pthread/SDL_sysmutex.c
     1.1 --- a/configure.in	Mon Jan 12 21:18:31 2015 +0100
     1.2 +++ b/configure.in	Mon Mar 23 20:10:08 2015 -0400
     1.3 @@ -2022,7 +2022,8 @@
     1.4              AC_MSG_CHECKING(for recursive mutexes)
     1.5              has_recursive_mutexes=no
     1.6              if test x$has_recursive_mutexes = xno; then
     1.7 -                AC_TRY_COMPILE([
     1.8 +                AC_TRY_LINK([
     1.9 +                  #define _GNU_SOURCE 1
    1.10                    #include <pthread.h>
    1.11                  ],[
    1.12                    pthread_mutexattr_t attr;
    1.13 @@ -2033,7 +2034,8 @@
    1.14                  ])
    1.15              fi
    1.16              if test x$has_recursive_mutexes = xno; then
    1.17 -                AC_TRY_COMPILE([
    1.18 +                AC_TRY_LINK([
    1.19 +                  #define _GNU_SOURCE 1
    1.20                    #include <pthread.h>
    1.21                  ],[
    1.22                    pthread_mutexattr_t attr;
     2.1 --- a/src/thread/pthread/SDL_sysmutex.c	Mon Jan 12 21:18:31 2015 +0100
     2.2 +++ b/src/thread/pthread/SDL_sysmutex.c	Mon Mar 23 20:10:08 2015 -0400
     2.3 @@ -21,6 +21,9 @@
     2.4  */
     2.5  #include "SDL_config.h"
     2.6  
     2.7 +#ifndef _GNU_SOURCE
     2.8 +#define _GNU_SOURCE
     2.9 +#endif
    2.10  #include <pthread.h>
    2.11  
    2.12  #include "SDL_thread.h"