Skip to content

Commit a95d001

Browse files
authored
Change calls to setmode to _setmode (#14220)
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
1 parent 173f513 commit a95d001

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

sapi/cgi/cgi_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,9 +1779,9 @@ int main(int argc, char *argv[])
17791779

17801780
#ifdef PHP_WIN32
17811781
_fmode = _O_BINARY; /* sets default for file streams to binary */
1782-
setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */
1783-
setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */
1784-
setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
1782+
_setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */
1783+
_setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */
1784+
_setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
17851785
#endif
17861786

17871787
if (!fastcgi) {

sapi/cli/php_cli.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,9 +1240,9 @@ int main(int argc, char *argv[])
12401240

12411241
#ifdef PHP_WIN32
12421242
_fmode = _O_BINARY; /*sets default for file streams to binary */
1243-
setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */
1244-
setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */
1245-
setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
1243+
_setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */
1244+
_setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */
1245+
_setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
12461246
#endif
12471247

12481248
php_ini_builder_init(&ini_builder);

sapi/embed/php_embed.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv)
194194

195195
#ifdef PHP_WIN32
196196
_fmode = _O_BINARY; /*sets default for file streams to binary */
197-
setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */
198-
setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */
199-
setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
197+
_setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */
198+
_setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */
199+
_setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
200200
#endif
201201

202202
/* This hard-coded string of INI settings is parsed and read into PHP's

sapi/phpdbg/phpdbg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,9 +1154,9 @@ int main(int argc, char **argv) /* {{{ */
11541154

11551155
#ifdef PHP_WIN32
11561156
_fmode = _O_BINARY; /* sets default for file streams to binary */
1157-
setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */
1158-
setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */
1159-
setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
1157+
_setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */
1158+
_setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */
1159+
_setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
11601160
#else
11611161
struct sigaction signal_struct;
11621162
signal_struct.sa_sigaction = phpdbg_signal_handler;

0 commit comments

Comments
 (0)