Skip to content

Commit c597619

Browse files
fix compilation on android older than API 26 (#11366)
Co-authored-by: Giacomo Amante <[email protected]>
1 parent 234236e commit c597619

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/threading_utils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ std::int32_t OmpGetNumThreads(std::int32_t n_threads) noexcept(true) {
130130
}
131131

132132
void NameThread(std::thread* t, StringView name) {
133-
#if defined(__linux__)
133+
#if defined(__linux__) && (!defined(__ANDROID__) || __ANDROID_API__ >= 26)
134134
auto handle = t->native_handle();
135135
char old[16];
136136
auto ret = pthread_getname_np(handle, old, 16);

0 commit comments

Comments
 (0)