-
Notifications
You must be signed in to change notification settings - Fork 267
Add support for Haiku, a POSIX platform without thread naming and vasprintf
#188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kcgen
wants to merge
7
commits into
emilk:master
Choose a base branch
from
dosbox-staging:upstream/support-haiku-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes an invalid conversion error on 32-bit platforms that don't support assigning pointers directly to integers.
b4d2245
to
8a27e50
Compare
Add a simple solution to a compilation warning that doesn't require any special changes to be made to already existing enums, types or logic. loguru/loguru.cpp: In function ‘void loguru::print_preamble(char*, size_t, loguru::Verbosity, const char*, unsigned int)’: loguru/loguru.cpp:1208:50: warning: ‘% 4d’ directive output may be truncated writing between 4 and 11 bytes into a region of size 5 [-Wformat-truncation=] 1208 | snprintf(level_buff, sizeof(level_buff) - 1, "% 4d", verbosity); | ^~~~ loguru/loguru.cpp:1208:49: note: directive argument in the range [1, 2147483647] 1208 | snprintf(level_buff, sizeof(level_buff) - 1, "% 4d", verbosity); | ^~~~~~ In file included from /usr/include/stdio.h:867, from /usr/include/c++/9/cstdio:42, from /usr/include/c++/9/ext/string_conversions.h:43, from /usr/include/c++/9/bits/basic_string.h:6493, from /usr/include/c++/9/string:55, from /usr/include/c++/9/stdexcept:39, from /usr/include/c++/9/array:39, from /usr/include/c++/9/tuple:39, from /usr/include/c++/9/functional:54, from /usr/include/c++/9/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/9/algorithm:71, from loguru/loguru.cpp:36: /usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 5 and 12 bytes into a destination of size 5 67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | __bos (__s), __fmt, __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 standardvsnprintf
calls, so avoids needing the WIN32 and POSIX branches. The previousvtextprintf
implementation failed on Haiku because it's missingvasprintf
.