Fix gettid() on Android, which is defined in unistd.h there.
This commit is contained in:
parent
66f16d9629
commit
17e3a92661
|
@ -390,7 +390,8 @@ AC_CHECK_FUNC(
|
|||
#include <sys/syscall.h>],
|
||||
[int main() {
|
||||
return syscall(SYS_gettid);}],
|
||||
[AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_SYS_GETTID])],
|
||||
[AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GETTID])
|
||||
AC_DEFINE([HAVE_SYS_GETTID])],
|
||||
[AC_MSG_RESULT([no])]
|
||||
)]
|
||||
)
|
||||
|
|
|
@ -20,15 +20,16 @@
|
|||
|
||||
#ifdef HAVE_GETTID
|
||||
#include <sys/types.h>
|
||||
#elif defined(HAVE_SYS_GETTID)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_GETTID
|
||||
#include <sys/syscall.h>
|
||||
static inline pid_t gettid()
|
||||
{
|
||||
return syscall(SYS_gettid);
|
||||
}
|
||||
#define HAVE_GETTID
|
||||
#endif /* HAVE_SYS_GETTID */
|
||||
#endif
|
||||
|
||||
#include <library.h>
|
||||
#include <debug.h>
|
||||
|
|
Loading…
Reference in New Issue