Fixed bug 3011 - pthread/SDL_syssem.c requires _GNU_SOURCE
authorSam Lantinga <slouken@libsdl.org>
Sat, 13 Jun 2015 13:36:47 -0700
changeset 9734e9738a3ac057
parent 9733 dd3c3024723c
child 9735 35d8f8976d32
Fixed bug 3011 - pthread/SDL_syssem.c requires _GNU_SOURCE

Ozkan Sezer

pthread/SDL_syssem.c requires _GNU_SOURCE predefined (like SDL_sysmutex.c),
otherwise sem_timedwait() prototype might not be available to it. Problem
seen with glibc-2.3.4.
src/thread/pthread/SDL_sysmutex.c
src/thread/pthread/SDL_syssem.c
     1.1 --- a/src/thread/pthread/SDL_sysmutex.c	Sat Jun 13 13:34:30 2015 -0700
     1.2 +++ b/src/thread/pthread/SDL_sysmutex.c	Sat Jun 13 13:36:47 2015 -0700
     1.3 @@ -23,8 +23,8 @@
     1.4  #ifndef _GNU_SOURCE
     1.5  #define _GNU_SOURCE
     1.6  #endif
     1.7 +#include <errno.h>
     1.8  #include <pthread.h>
     1.9 -#include <errno.h>
    1.10  
    1.11  #include "SDL_thread.h"
    1.12  
     2.1 --- a/src/thread/pthread/SDL_syssem.c	Sat Jun 13 13:34:30 2015 -0700
     2.2 +++ b/src/thread/pthread/SDL_syssem.c	Sat Jun 13 13:36:47 2015 -0700
     2.3 @@ -20,6 +20,9 @@
     2.4  */
     2.5  #include "../../SDL_internal.h"
     2.6  
     2.7 +#ifndef _GNU_SOURCE
     2.8 +#define _GNU_SOURCE
     2.9 +#endif
    2.10  #include <errno.h>
    2.11  #include <pthread.h>
    2.12  #include <semaphore.h>