mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-13 21:21:22 +00:00
posix_thread.c: Avoid sem_getvalue deprecation warning on macOS (#1596)
This commit is contained in:
parent
02f0c2bed8
commit
6f04f115ab
|
@ -228,7 +228,17 @@ os_sem_post(korp_sem *sem)
|
||||||
int
|
int
|
||||||
os_sem_getvalue(korp_sem *sem, int *sval)
|
os_sem_getvalue(korp_sem *sem, int *sval)
|
||||||
{
|
{
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
/*
|
||||||
|
* macOS doesn't have working sem_getvalue.
|
||||||
|
* It's marked as deprecated in the system header.
|
||||||
|
* Mock it up here to avoid compile-time deprecation warnings.
|
||||||
|
*/
|
||||||
|
errno = ENOSYS;
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
return sem_getvalue(sem, sval);
|
return sem_getvalue(sem, sval);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in New Issue
Block a user