From ad4b6097c0014e94ff80fa8b5592c05f5964a832 Mon Sep 17 00:00:00 2001 From: brian khuu Date: Tue, 21 May 2024 00:37:12 +1000 Subject: [PATCH] main: dprintf isn't part of the IEEE POSIX standard. Just use write(). --- examples/main/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 8effd02a8bdc0..4019485124029 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -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