osdep: hack to fix build with low quality pthreads-w32 headers

When compiling semaphore_osx.c on win32, the following error happened:

/usr/i686-w64-mingw32/include/semaphore.h:160:6: error: unknown type name 'mode_t'

This is because this system header references symbols that are not
not defined anywhere. This is clearly a bug in pthreads-w32, but has
been known and unfixed since 2012, so add a hack to fix it.

We build semaphore_osx.c this way because it saves us an extra configure
check. On win32, Linux, etc. it's empty and contains
"#include <semaphore.h>" only.

Should fix #1108.
This commit is contained in:
wm4 2014-09-20 04:18:40 +02:00
parent 7329101478
commit 34fac3bf68
1 changed files with 1 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#ifndef MP_SEMAPHORE_H_
#define MP_SEMAPHORE_H_
#include <sys/types.h>
#include <semaphore.h>
// OSX provides non-working empty stubs, so we emulate them.