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 - pthread/SDL_syssem.c requires _GNU_SOURCE
Summary: pthread/SDL_syssem.c requires _GNU_SOURCE
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: thread (show other bugs)
Version: HG 2.0
Hardware: All Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-13 19:52 UTC by Ozkan Sezer
Modified: 2015-06-13 20:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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