From 8b8d448ea49121c3deb87a93cbc6b1a43795aa99 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 13 May 2024 20:48:15 +0200 Subject: [PATCH] Change calls to setmode to _setmode setmode is the deprecated alias of _setmode [1]. [1] https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/posix-setmode?view=msvc-170 --- sapi/cgi/cgi_main.c | 6 +++--- sapi/cli/php_cli.c | 6 +++--- sapi/embed/php_embed.c | 6 +++--- sapi/phpdbg/phpdbg.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 3759f24d45df8..3d7df7e283954 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1779,9 +1779,9 @@ int main(int argc, char *argv[]) #ifdef PHP_WIN32 _fmode = _O_BINARY; /* sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ #endif if (!fastcgi) { diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index e107667828caa..0376ffe2e5dac 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1240,9 +1240,9 @@ int main(int argc, char *argv[]) #ifdef PHP_WIN32 _fmode = _O_BINARY; /*sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ #endif php_ini_builder_init(&ini_builder); diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c index 4626451f9f68a..33364d3e65334 100644 --- a/sapi/embed/php_embed.c +++ b/sapi/embed/php_embed.c @@ -194,9 +194,9 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv) #ifdef PHP_WIN32 _fmode = _O_BINARY; /*sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ #endif /* This hard-coded string of INI settings is parsed and read into PHP's diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index ffff7e2c219be..65745cd454eea 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1154,9 +1154,9 @@ int main(int argc, char **argv) /* {{{ */ #ifdef PHP_WIN32 _fmode = _O_BINARY; /* sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ + _setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ #else struct sigaction signal_struct; signal_struct.sa_sigaction = phpdbg_signal_handler;