Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
e875e314
Commit
e875e314
authored
Feb 08, 2015
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix print_colored on Windows
parent
9368b6a4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
format.cc
format.cc
+2
-3
No files found.
format.cc
View file @
e875e314
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
# include <cstring>
# include <cstring>
# endif
# endif
# include <windows.h>
# include <windows.h>
# include <io.h> // for _get_osfhandle
#endif
#endif
using
fmt
::
internal
::
Arg
;
using
fmt
::
internal
::
Arg
;
...
@@ -1112,9 +1113,7 @@ FMT_FUNC void fmt::print(std::ostream &os, StringRef format_str, ArgList args) {
...
@@ -1112,9 +1113,7 @@ FMT_FUNC void fmt::print(std::ostream &os, StringRef format_str, ArgList args) {
FMT_FUNC
void
fmt
::
print_colored
(
Color
c
,
StringRef
format
,
ArgList
args
)
{
FMT_FUNC
void
fmt
::
print_colored
(
Color
c
,
StringRef
format
,
ArgList
args
)
{
#ifdef _WIN32
#ifdef _WIN32
HANDLE
handle
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
HANDLE
handle
=
reinterpret_cast
<
HANDLE
>
(
_get_osfhandle
(
_fileno
(
stdout
)));
if
(
handle
==
INVALID_HANDLE_VALUE
)
FMT_THROW
(
WindowsError
(
GetLastError
(),
"cannot get output handle"
));
CONSOLE_SCREEN_BUFFER_INFO
info_con
;
CONSOLE_SCREEN_BUFFER_INFO
info_con
;
if
(
!
GetConsoleScreenBufferInfo
(
handle
,
&
info_con
))
if
(
!
GetConsoleScreenBufferInfo
(
handle
,
&
info_con
))
FMT_THROW
(
WindowsError
(
GetLastError
(),
"cannot get console information"
));
FMT_THROW
(
WindowsError
(
GetLastError
(),
"cannot get console information"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment