diff options
author | Chris Robinson <[email protected]> | 2022-09-09 18:29:44 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-09-09 18:29:44 -0700 |
commit | e6fe5bc33485211b03242a193eb9a981916efee1 (patch) | |
tree | ae004df7c180bc173f1c547b1ff91a5bae974ba7 | |
parent | ee3142d4d605eac7e7c5f6d4df87ec5e3b345d29 (diff) |
Recognize void(pthread_t,const char*)
-rw-r--r-- | common/threads.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/common/threads.cpp b/common/threads.cpp index ee29de91..52c61ac4 100644 --- a/common/threads.cpp +++ b/common/threads.cpp @@ -103,7 +103,8 @@ namespace { using setname_t1 = int(*)(const char*); using setname_t2 = int(*)(pthread_t, const char*); -using setname_t3 = int(*)(pthread_t, const char*, void*); +using setname_t3 = void(*)(pthread_t, const char*); +using setname_t4 = int(*)(pthread_t, const char*, void*); void setname_caller(setname_t1 func, const char *name) { func(name); } @@ -112,6 +113,9 @@ void setname_caller(setname_t2 func, const char *name) { func(pthread_self(), name); } void setname_caller(setname_t3 func, const char *name) +{ func(pthread_self(), name); } + +void setname_caller(setname_t4 func, const char *name) { func(pthread_self(), "%s", static_cast<void*>(const_cast<char*>(name))); } } // namespace @@ -128,6 +132,7 @@ void althrd_setname(const char *name) std::ignore = static_cast<void(*)(setname_t1,const char*)>(&setname_caller); std::ignore = static_cast<void(*)(setname_t2,const char*)>(&setname_caller); std::ignore = static_cast<void(*)(setname_t3,const char*)>(&setname_caller); + std::ignore = static_cast<void(*)(setname_t4,const char*)>(&setname_caller); } #ifdef __APPLE__ |