Skip to content

Commit

Permalink
attribute gnu::format on AnsiPrintf
Browse files Browse the repository at this point in the history
  • Loading branch information
Grégoire Roussel committed Jul 17, 2024
1 parent cd09d2d commit 9a5ae35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions capture/src/lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ bool IsStdoutATerminal() { return s_isStdoutATerminal; }

// Like printf, but if stdout is a terminal, prepends the output with
// the given `ansiEscape` and appends ANSI_RESET.
#ifdef __GNUC__
[[gnu::format(__printf__, 2, 3)]]
#endif
void AnsiPrintf( const char* ansiEscape, const char* format, ... ) {
if( IsStdoutATerminal() )
{
Expand Down

0 comments on commit 9a5ae35

Please sign in to comment.