aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/gznorm.c6
-rw-r--r--examples/zpipe.c6
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