emilk / loguru

A lightweight C++ logging library
The Unlicense
1.76k stars 256 forks source link

Add support for Haiku, a POSIX platform without thread naming and `vasprintf` #188

Open kcgen opened 2 years ago

kcgen commented 2 years ago

Loguru doesn't compile on Haiku, which is a "generally" complete Posix platform - but with some addons missing, like thread naming.

Most of the thread naming is protected with #if MACOS and #elif BSD and LINUX platform branches, however some of these blocks are missing the trailing #else to cover unsupported systems (like Haiku).

This PR also simplifies vtextprintf with standard vsnprintf calls, so avoids needing the WIN32 and POSIX branches. The previous vtextprintf implementation failed on Haiku because it's missing vasprintf.

-h2a

kcgen commented 2 years ago

Hmm.. it looks like the current master branch is actually failing CI with this:

2021-12-03_19-43

Fortunately @zivke's already submitted a one-line fix for this (https://github.com/emilk/loguru/pull/187), which is also sitting in the PR queue.

I merged @zivke's fix to this PR, just to get passing the AppVeyor tests.