aboutsummaryrefslogtreecommitdiff
path: root/examples/zpipe.c
diff options
context:
space:
mode:
authorMark Adler <git@madler.net>2026-02-12 00:53:08 -0800
committerMark Adler <git@madler.net>2026-02-12 01:01:44 -0800
commit3f5d21e8f573a549ffc200e17dd95321db454aa1 (patch)
tree71e7bd8651e7f58416830d5fa82a5225e10fd930 /examples/zpipe.c
parentaf0aa9b66a2d123a1ca26d9bfe138695012b045b (diff)
downloadzlib-3f5d21e8f573a549ffc200e17dd95321db454aa1.tar.gz
zlib-3f5d21e8f573a549ffc200e17dd95321db454aa1.tar.bz2
zlib-3f5d21e8f573a549ffc200e17dd95321db454aa1.zip
Use underscores for Windows POSIX names in zpipe.c.
Diffstat (limited to 'examples/zpipe.c')
-rw-r--r--examples/zpipe.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/zpipe.c b/examples/zpipe.c
index 51dec474..021c8508 100644
--- a/examples/zpipe.c
+++ b/examples/zpipe.c
@@ -1,6 +1,6 @@
1/* zpipe.c: example of proper use of zlib's inflate() and deflate() 1/* zpipe.c: example of proper use of zlib's inflate() and deflate()
2 Not copyrighted -- provided to the public domain 2 Not copyrighted -- provided to the public domain
3 Version 1.4 11 December 2005 Mark Adler */ 3 Version 1.5 11 February 2026 Mark Adler */
4 4
5/* Version history: 5/* Version history:
6 1.0 30 Oct 2004 First version 6 1.0 30 Oct 2004 First version
@@ -10,12 +10,9 @@
10 1.3 6 Apr 2005 Remove incorrect assertion in inf() 10 1.3 6 Apr 2005 Remove incorrect assertion in inf()
11 1.4 11 Dec 2005 Add hack to avoid MSDOS end-of-line conversions 11 1.4 11 Dec 2005 Add hack to avoid MSDOS end-of-line conversions
12 Avoid some compiler warnings for input and output buffers 12 Avoid some compiler warnings for input and output buffers
13 1.5 11 Feb 2026 Use underscores for Windows POSIX names
13 */ 14 */
14 15
15#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE)
16# define _CRT_NONSTDC_NO_DEPRECATE
17#endif
18
19#include <stdio.h> 16#include <stdio.h>
20#include <string.h> 17#include <string.h>
21#include <assert.h> 18#include <assert.h>
@@ -24,7 +21,7 @@
24#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) 21#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
25# include <fcntl.h> 22# include <fcntl.h>
26# include <io.h> 23# include <io.h>
27# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) 24# define SET_BINARY_MODE(file) _setmode(_fileno(file), _O_BINARY)
28#else 25#else
29# define SET_BINARY_MODE(file) 26# define SET_BINARY_MODE(file)
30#endif 27#endif