Skip to content

Commit

Permalink
fix build with ohos toolchain (#5105)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored Oct 25, 2023
1 parent 9dda7e3 commit 3eb2969
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ static bool is_smt_cpu(int cpuid)
static int set_sched_affinity(const ncnn::CpuSet& thread_affinity_mask)
{
// set affinity for thread
#if defined(__BIONIC__)
#if defined(__BIONIC__) && !defined(__OHOS__)
pid_t pid = gettid();
#else
pid_t pid = syscall(SYS_gettid);
Expand Down Expand Up @@ -1677,7 +1677,7 @@ static unsigned int get_midr_from_register()
static int get_sched_affinity(ncnn::CpuSet& thread_affinity_mask)
{
// get affinity for thread
#if defined(__BIONIC__)
#if defined(__BIONIC__) && !defined(__OHOS__)
pid_t pid = gettid();
#else
pid_t pid = syscall(SYS_gettid);
Expand Down

0 comments on commit 3eb2969

Please sign in to comment.