We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3011

Summary: pthread/SDL_syssem.c requires _GNU_SOURCE
Product: SDL Reporter: Ozkan Sezer <sezeroz>
Component: threadAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: Linux   

Description Ozkan Sezer 2015-06-13 19:52:46 UTC
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.  Trivial patch below.

diff -r a8140c580b85 src/thread/pthread/SDL_syssem.c
--- a/src/thread/pthread/SDL_syssem.c	Sat Jun 13 10:47:55 2015 -0700
+++ b/src/thread/pthread/SDL_syssem.c	Sat Jun 13 22:10:14 2015 +0300
@@ -20,6 +20,9 @@
 */
 #include "../../SDL_internal.h"
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
 #include <errno.h>
 #include <pthread.h>
 #include <semaphore.h>
Comment 1 Sam Lantinga 2015-06-13 20:37:10 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/e9738a3ac057