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. --- test/example.c | 4 ++++ test/minigzip.c | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/example.c b/test/example.c index e9cb806..d22e5f4 100644 --- a/test/example.c +++ b/test/example.c @@ -5,6 +5,10 @@ /* @(#) $Id$ */ +#if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS) +# define _CRT_SECURE_NO_WARNINGS +#endif + #include "zlib.h" #include diff --git a/test/minigzip.c b/test/minigzip.c index ec86e3f..541f371 100644 --- a/test/minigzip.c +++ b/test/minigzip.c @@ -19,6 +19,13 @@ # define _POSIX_C_SOURCE 200112L #endif +#if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS) +# define _CRT_SECURE_NO_WARNINGS +#endif +#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE) +# define _CRT_NONSTDC_NO_DEPRECATE +#endif + #include "zlib.h" #include @@ -39,7 +46,7 @@ # ifdef UNDER_CE # include # endif -# 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 @@ -58,10 +65,6 @@ #if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include /* for fileno */ #endif -#ifdef WIN32 -# define fileno _fileno -# define unlink _unlink -#endif #if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE) #ifndef WIN32 /* unlink already in stdio.h for WIN32 */ -- cgit v1.2.3-55-g6feb