dbg-macro
dbg-macro copied to clipboard
Colorized output support for Windows.
- Use
SetConsoleTextAttribute
to support Colorized output on Windows. - Must set
NOMINMAX
when usestd::min
on Windows. -
__cplusplus
is not enough to check MSVC standard.
Thank you very much for your contribution!
Happy to take a look when the builds are green.
I have updated our CI system to GitHub Actions, see #104. It would be great if you could rebase your branch to run the new set of tests.
The checks have passed, Please review it.^_^
I learning to solve #97 .
Thank you for your contribution. A few things are included here. It would be great if we could split them into separate PRs. As for part 2 (Must set NOMINMAX when use std::min on Windows.), have you seen https://github.com/sharkdp/dbg-macro/pull/100?
As for the main change here (colorized support for Windows): I would prefer if we could keep the complexity somewhat limited and only support ANSI-escape sequence based terminals. This should work just fine on Windows 10, if the support is enabled (https://docs.microsoft.com/de-de/windows/console/console-virtual-terminal-sequences).
I defined a DBG_ANSI_TYPE
marco in dbg.h
, for optional support Classic Console API on Windows 7 in example.cpp
.
cc @sharkdp
cc @sharkdp
?
Sorry, that wasn't very clear. 😄
I was using my own macro on a project, but I recently came upon this library, which I immediately preferred and attempted to use, but I found that it doesn't support the platform I'm developing for, Windows. I can easily checkout this PR, but I'd love to see it merged into master
(which maybe should be renamed to main
?)
To be honest, I have lost track of what this PR does. There are a lot of changes, especially to the CMake config. As I said above: I'm happy to integrate this, but only for terminals that support ANSI escape sequences. I don't want to add (and maintain) a lot of code for legacy Windows terminals.
Must set NOMINMAX when use std::min on Windows.
just wrap it in parenthesis =)
(std::min)(...)
Must set NOMINMAX when use std::min on Windows.
just wrap it in parenthesis =)
(std::min)(...)
Thank you but >_<