eina: fix support for system requiring _XOPEN_SOURCE to use spinlock and barrier.

This commit is contained in:
Cedric Bail 2014-01-04 11:25:19 +09:00
parent 4225ef35e1
commit 319766f837
1 changed files with 12 additions and 0 deletions

View File

@ -19,6 +19,12 @@
#ifndef EINA_INLINE_LOCK_POSIX_X_
#define EINA_INLINE_LOCK_POSIX_X_
#ifdef _XOPEN_SOURCE
# define EINA_XOPEN_SOURCE _XOPEN_SOURCE
# undef _XOPEN_SOURCE
#endif
#define _XOPEN_SOURCE 600
#ifdef EINA_HAVE_POSIX_SPINLOCK
# include <sched.h>
#endif
@ -650,4 +656,10 @@ eina_spinlock_free(Eina_Spinlock *spinlock)
#endif
}
#undef _XOPEN_SOURCE
// This is necessary to let third party still define this macro
#ifdef EINA_XOPEN_SOURCE
# define _XOPEN_SOURCE EINA_XOPEN_SOURCE
#endif
#endif