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 179

Summary: SDL_SemValue() always returns 0 on Mac OS X
Product: SDL Reporter: Christian Walther <cwalther>
Component: threadAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2    
Version: HG 1.2   
Hardware: PowerPC   
OS: Mac OS X (All)   

Description Christian Walther 2006-03-25 03:10:22 UTC
SDL_SemValue() always returns 0. That's because the underlying POSIX sem_getvalue() is implemented as a noop in Mac OS X. Apart from that, semaphores do work properly (at least according to test/testsem), so I'm not sure if this is worth fixing at all.

Interestingly, the release notes for SDL 1.1.8 say "Worked around broken sem_getvalue() on MacOS X". How was that done? I can't find the source for 1.1.8 in the CVS.
Comment 1 Sam Lantinga 2006-04-13 10:04:22 UTC
I think this is fixed in CVS, can you take a look?
Comment 2 Christian Walther 2006-04-14 09:34:29 UTC
Yep, seems to work.

By the way, I had to make the following change to SDL_config_macosx.h to make SDL compile in Xcode (because of http://libsdl.org/cgi/cvsweb.cgi/SDL12/src/loadso/macosx/SDL_sysloadso.c.diff?r1=1.5&r2=1.6), is this the right thing to do?

 /* Enable various shared object loading systems */
-#define SDL_LOADSO_DLOPEN      1
+#define SDL_LOADSO_DLCOMPAT    1