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 /examples | |
parent | ceac32f156c4d39bf991e1163223b8d910a258d3 (diff) | |
download | zlib-fd5fe8b17e27ab92dcc70ed4974915b8dbe2a553.tar.gz zlib-fd5fe8b17e27ab92dcc70ed4974915b8dbe2a553.tar.bz2 zlib-fd5fe8b17e27ab92dcc70ed4974915b8dbe2a553.zip |
Further address Microsoft deprecation warnings.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/gznorm.c | 6 | ||||
-rw-r--r-- | examples/zpipe.c | 6 |
2 files changed, 10 insertions, 2 deletions
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 @@ | |||
10 | // the data, so it is fast, but no advantage is gained from the history that | 10 | // the data, so it is fast, but no advantage is gained from the history that |
11 | // could be available across member boundaries. | 11 | // could be available across member boundaries. |
12 | 12 | ||
13 | #if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE) | ||
14 | # define _CRT_NONSTDC_NO_DEPRECATE | ||
15 | #endif | ||
16 | |||
13 | #include <stdio.h> // fread, fwrite, putc, fflush, ferror, fprintf, | 17 | #include <stdio.h> // fread, fwrite, putc, fflush, ferror, fprintf, |
14 | // vsnprintf, stdout, stderr, NULL, FILE | 18 | // vsnprintf, stdout, stderr, NULL, FILE |
15 | #include <stdlib.h> // malloc, free | 19 | #include <stdlib.h> // malloc, free |
@@ -24,7 +28,7 @@ | |||
24 | #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) | 28 | #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) |
25 | # include <fcntl.h> | 29 | # include <fcntl.h> |
26 | # include <io.h> | 30 | # include <io.h> |
27 | # define SET_BINARY_MODE(file) _setmode(_fileno(file), O_BINARY) | 31 | # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) |
28 | #else | 32 | #else |
29 | # define SET_BINARY_MODE(file) | 33 | # define SET_BINARY_MODE(file) |
30 | #endif | 34 | #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 @@ | |||
12 | Avoid some compiler warnings for input and output buffers | 12 | Avoid some compiler warnings for input and output buffers |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE) | ||
16 | # define _CRT_NONSTDC_NO_DEPRECATE | ||
17 | #endif | ||
18 | |||
15 | #include <stdio.h> | 19 | #include <stdio.h> |
16 | #include <string.h> | 20 | #include <string.h> |
17 | #include <assert.h> | 21 | #include <assert.h> |
@@ -20,7 +24,7 @@ | |||
20 | #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) | 24 | #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) |
21 | # include <fcntl.h> | 25 | # include <fcntl.h> |
22 | # include <io.h> | 26 | # include <io.h> |
23 | # define SET_BINARY_MODE(file) _setmode(_fileno(file), O_BINARY) | 27 | # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) |
24 | #else | 28 | #else |
25 | # define SET_BINARY_MODE(file) | 29 | # define SET_BINARY_MODE(file) |
26 | #endif | 30 | #endif |