File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 8
8
#include < time.h> // for clock_gettime
9
9
#else
10
10
#include < sys/time.h> // for gettimeofday
11
+ #ifndef __APPLE__
12
+ #include < pthread_np.h> // for getting proper threadid on modern BSDs but not Mac OSX
13
+ #endif
11
14
#endif
12
15
#endif
13
16
@@ -100,7 +103,11 @@ uint32 thread_id() { return syscall(SYS_gettid); }
100
103
#else /* for mac, bsd.. */
101
104
uint32 thread_id () {
102
105
uint64 x;
106
+ #ifdef __APPLE__
103
107
pthread_threadid_np (0 , &x);
108
+ #else
109
+ x = pthread_getthreadid_np ();
110
+ #endif
104
111
return (uint32)x;
105
112
}
106
113
#endif
Original file line number Diff line number Diff line change 53
53
defined(__mips__ )
54
54
#define ARCH_MIPS
55
55
56
+ #elif defined(loongarch ) || \
57
+ defined(_loongarch ) || \
58
+ defined(_loongarch64 ) || \
59
+ defined(__loongarch__ )
60
+ #define ARCH_LOONGARCH
61
+
62
+ #elif defined(riscv ) || \
63
+ defined(_riscv ) || \
64
+ defined(_riscv64 ) || \
65
+ defined(__riscv__ )
66
+ #define ARCH_RISCV
67
+
68
+
56
69
#else
57
70
#error unknown arch
58
71
#endif
115
128
defined(__PPC64__ ) || \
116
129
defined(__ppc64__ ) || \
117
130
defined(__powerpc64__ ) || \
131
+ defined(__loongarch64 ) || \
132
+ defined(__riscv64 ) || \
118
133
defined(_M_X64 ) || \
119
134
defined(_M_AMD64 ) || \
120
135
defined(_M_IA64 ) || \
You can’t perform that action at this time.
0 commit comments