diff options
| author | Mark Adler <madler@alumni.caltech.edu> | 2024-02-09 16:42:36 -0800 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2024-02-09 20:11:54 -0800 |
| commit | fd5fe8b17e27ab92dcc70ed4974915b8dbe2a553 (patch) | |
| tree | 880202f45d75dbdbde30125ef59c320e3b909349 /test | |
| parent | ceac32f156c4d39bf991e1163223b8d910a258d3 (diff) | |
| download | zlib-fd5fe8b17e27ab92dcc70ed4974915b8dbe2a553.tar.gz zlib-fd5fe8b17e27ab92dcc70ed4974915b8dbe2a553.tar.bz2 zlib-fd5fe8b17e27ab92dcc70ed4974915b8dbe2a553.zip | |
Further address Microsoft deprecation warnings.
Diffstat (limited to 'test')
| -rw-r--r-- | test/example.c | 4 | ||||
| -rw-r--r-- | test/minigzip.c | 13 |
2 files changed, 12 insertions, 5 deletions
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 @@ | |||
| 5 | 5 | ||
| 6 | /* @(#) $Id$ */ | 6 | /* @(#) $Id$ */ |
| 7 | 7 | ||
| 8 | #if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS) | ||
| 9 | # define _CRT_SECURE_NO_WARNINGS | ||
| 10 | #endif | ||
| 11 | |||
| 8 | #include "zlib.h" | 12 | #include "zlib.h" |
| 9 | #include <stdio.h> | 13 | #include <stdio.h> |
| 10 | 14 | ||
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 @@ | |||
| 19 | # define _POSIX_C_SOURCE 200112L | 19 | # define _POSIX_C_SOURCE 200112L |
| 20 | #endif | 20 | #endif |
| 21 | 21 | ||
| 22 | #if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS) | ||
| 23 | # define _CRT_SECURE_NO_WARNINGS | ||
| 24 | #endif | ||
| 25 | #if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE) | ||
| 26 | # define _CRT_NONSTDC_NO_DEPRECATE | ||
| 27 | #endif | ||
| 28 | |||
| 22 | #include "zlib.h" | 29 | #include "zlib.h" |
| 23 | #include <stdio.h> | 30 | #include <stdio.h> |
| 24 | 31 | ||
| @@ -39,7 +46,7 @@ | |||
| 39 | # ifdef UNDER_CE | 46 | # ifdef UNDER_CE |
| 40 | # include <stdlib.h> | 47 | # include <stdlib.h> |
| 41 | # endif | 48 | # endif |
| 42 | # define SET_BINARY_MODE(file) _setmode(_fileno(file), O_BINARY) | 49 | # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) |
| 43 | #else | 50 | #else |
| 44 | # define SET_BINARY_MODE(file) | 51 | # define SET_BINARY_MODE(file) |
| 45 | #endif | 52 | #endif |
| @@ -58,10 +65,6 @@ | |||
| 58 | #if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os | 65 | #if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os |
| 59 | # include <unix.h> /* for fileno */ | 66 | # include <unix.h> /* for fileno */ |
| 60 | #endif | 67 | #endif |
| 61 | #ifdef WIN32 | ||
| 62 | # define fileno _fileno | ||
| 63 | # define unlink _unlink | ||
| 64 | #endif | ||
| 65 | 68 | ||
| 66 | #if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE) | 69 | #if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE) |
| 67 | #ifndef WIN32 /* unlink already in stdio.h for WIN32 */ | 70 | #ifndef WIN32 /* unlink already in stdio.h for WIN32 */ |
