]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Fix gettid() on Android, which is defined in unistd.h there.
authorTobias Brunner <tobias@strongswan.org>
Thu, 12 Jan 2012 10:08:22 +0000 (11:08 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 12 Jan 2012 10:08:22 +0000 (11:08 +0100)
configure.in
src/libstrongswan/threading/thread.c

index 59dc86f04b5d8663af00c8e1ad5ce347e6e77dae..e77238556be971a35796394babba25e345a46a55 100644 (file)
@@ -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])]
        )]
 )
index 0cbd97c3f98e957e12f501bd06390372ad32a060..49a1b84300ac2424327aeec752df99a943967c5e 100644 (file)
 
 #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>