From fd5fe8b17e27ab92dcc70ed4974915b8dbe2a553 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Fri, 9 Feb 2024 16:42:36 -0800 Subject: Further address Microsoft deprecation warnings. --- examples/gznorm.c | 6 +++++- examples/zpipe.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/gznorm.c b/examples/gznorm.c index 2a1dda8..e8d9b48 100644 --- a/examples/gznorm.c +++ b/examples/gznorm.c @@ -10,6 +10,10 @@ // the data, so it is fast, but no advantage is gained from the history that // could be available across member boundaries. +#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE) +# define _CRT_NONSTDC_NO_DEPRECATE +#endif + #include // fread, fwrite, putc, fflush, ferror, fprintf, // vsnprintf, stdout, stderr, NULL, FILE #include // malloc, free @@ -24,7 +28,7 @@ #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) # include # include -# define SET_BINARY_MODE(file) _setmode(_fileno(file), O_BINARY) +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) #else # define SET_BINARY_MODE(file) #endif diff --git a/examples/zpipe.c b/examples/zpipe.c index 184fce5..51dec47 100644 --- a/examples/zpipe.c +++ b/examples/zpipe.c @@ -12,6 +12,10 @@ Avoid some compiler warnings for input and output buffers */ +#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE) +# define _CRT_NONSTDC_NO_DEPRECATE +#endif + #include #include #include @@ -20,7 +24,7 @@ #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) # include # include -# define SET_BINARY_MODE(file) _setmode(_fileno(file), O_BINARY) +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) #else # define SET_BINARY_MODE(file) #endif -- cgit v1.2.3-55-g6feb