additional Andrew provided Termux mods +
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / thread.h
index 7ad81b233b68ac5df1dac76582cf9ef8cc466f02..0d71afb4cad59f1e400ead1ec8eed21781ce890b 100644 (file)
 #include <stdio.h>
 #include <pthread.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <pthread.h>
 #include <unistd.h>
+
+#if !defined(__TERMUX__)
+
+#ifndef NO_TID
 #include <sys/syscall.h>
 
 // glibc >= 2.30 provides gettid() in unistd
 #if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 30)
 static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
 #include <sys/syscall.h>
 
 // glibc >= 2.30 provides gettid() in unistd
 #if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 30)
 static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
+#endif
+#else
+static inline long gettid() { return (long)pthread_self(); }
+#endif
+
 #endif
 
 // The thread does not autodelete by default.
 #endif
 
 // The thread does not autodelete by default.