From 3f5d21e8f573a549ffc200e17dd95321db454aa1 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Thu, 12 Feb 2026 00:53:08 -0800 Subject: Use underscores for Windows POSIX names in zpipe.c. --- examples/zlib_how.html | 11 ++++++----- examples/zpipe.c | 9 +++------ 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'examples') diff --git a/examples/zlib_how.html b/examples/zlib_how.html index 43271b98..286308b3 100644 --- a/examples/zlib_how.html +++ b/examples/zlib_how.html @@ -4,7 +4,7 @@ zlib Usage Example - +

zlib Usage Example

@@ -21,7 +21,7 @@ Without further ado, here is the program zpipe.c:

 /* zpipe.c: example of proper use of zlib's inflate() and deflate()
    Not copyrighted -- provided to the public domain
-   Version 1.4  11 December 2005  Mark Adler */
+   Version 1.5  11 February 2026  Mark Adler */
 
 /* Version history:
    1.0  30 Oct 2004  First version
@@ -31,6 +31,7 @@ Without further ado, here is the program zpipe.c:
    1.3   6 Apr 2005  Remove incorrect assertion in inf()
    1.4  11 Dec 2005  Add hack to avoid MSDOS end-of-line conversions
                      Avoid some compiler warnings for input and output buffers
+   1.5  11 Feb 2026  Use underscores for Windows POSIX names
  */
 
We now include the header files for the required definitions. From @@ -60,7 +61,7 @@ This sets the input and output to binary which suppresses the end-of-line conver #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) # include <fcntl.h> # include <io.h> -# 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 @@ -538,8 +539,8 @@ int main(int argc, char **argv) }
-Last modified 24 January 2023
-Copyright © 2004-2023 Mark Adler

+Last modified 12 February 2026
+Copyright © 2004-2026 Mark Adler

Creative Commons License 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 @@ /* zpipe.c: example of proper use of zlib's inflate() and deflate() Not copyrighted -- provided to the public domain - Version 1.4 11 December 2005 Mark Adler */ + Version 1.5 11 February 2026 Mark Adler */ /* Version history: 1.0 30 Oct 2004 First version @@ -10,12 +10,9 @@ 1.3 6 Apr 2005 Remove incorrect assertion in inf() 1.4 11 Dec 2005 Add hack to avoid MSDOS end-of-line conversions Avoid some compiler warnings for input and output buffers + 1.5 11 Feb 2026 Use underscores for Windows POSIX names */ -#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE) -# define _CRT_NONSTDC_NO_DEPRECATE -#endif - #include #include #include @@ -24,7 +21,7 @@ #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) # include # include -# 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 -- cgit v1.2.3-55-g6feb