Skip to content

Commit

Permalink
main: dprintf isn't part of the IEEE POSIX standard. Just use write().
Browse files Browse the repository at this point in the history
  • Loading branch information
mofosyne committed May 20, 2024
1 parent 9f445a7 commit ad4b609
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,10 +748,11 @@ int main(int argc, char ** argv) {
// Stream Output Token To Standard Output
fprintf(stdout, "%s", token_str.c_str());
} else if (!params.ctrl_token_no_out) {
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
#ifndef _MSC_VER
if (params.ctrl_token_fd_out) {
// Stream Control Token To Special Token Output. Useful for debugging control token behaviour
dprintf(CONTROL_TOKEN_FILE_DESCRIPTOR, "%s", token_str.c_str());
ssize_t result = write(CONTROL_TOKEN_FILE_DESCRIPTOR, token_str.c_str(), token_str.length());
(void) result;
}
else
#endif
Expand Down

0 comments on commit ad4b609

Please sign in to comment.