Open morgant opened 2 years ago
I'll submit a patch, but I'm curious whether you prefer to have the logic defined in get_thread_name()
, like it currently is in set_thread_name()
, or would it be better to just appropriately alias pthread_getname_np
& pthread_setname_np
for OpenBSD with a macro? The latter seems cleaner to me at this time.
I have a patch here if anyone can review/test: https://github.com/emilk/loguru/pull/245
I'm working on updating the
eduke32
port for OpenBSD to the latest release, which has since migrated to using loguru. When building under OpenBSD/amd64 7.1-stable, the following error is generated:This is because OpenBSD's
pthread_get_name_np()
implementation does not aliaspthread_getname_np
like FreeBSD does.Reviewing
loguru.cpp
, it appears that there are some attempts at OpenBSD support, including in theset_thread_name()
&get_thread_name()
implementations. However, while theset_thread_name()
implementation seems to correctly usepthread_set_name_np()
for FreeBSD & OpenBSD, unfortunately theget_thread_name()
implementations doesn't have similar platform support and just tries to usepthread_getname_np()
.