Skip to content

Commit

Permalink
upgrade zlib C files to C11 (#8485)
Browse files Browse the repository at this point in the history
upgrade zlib C files to C11

Signed-off-by: Luís Ferreira <[email protected]>
Signed-off-by: Razvan Nitu <[email protected]>
Merged-on-behalf-of: Razvan Nitu <[email protected]>
  • Loading branch information
WalterBright authored Jul 5, 2022
1 parent c84fc81 commit 38243e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions etc/c/zlib/gzguts.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,17 @@
# endif
#endif

/* C11 no longer allows implicit declaration of functions */
#if defined(__DMC__)
#include <io.h>
#elif defined(_MSC_VER)
#include <io.h>
#else
ssize_t read(int, void*, size_t);
ssize_t write(int, const void*, size_t);
int close(int);
#endif

/* provide prototypes for these when building zlib without LFS */
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
Expand Down
2 changes: 1 addition & 1 deletion posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ endif
OUTFILEFLAG = -o
NODEFAULTLIB=-defaultlib= -debuglib=
ifeq (,$(findstring win,$(OS)))
CFLAGS=$(MODEL_FLAG) -fPIC -DHAVE_UNISTD_H
CFLAGS=$(MODEL_FLAG) -fPIC -std=c11 -DHAVE_UNISTD_H
NODEFAULTLIB += -L-lpthread -L-lm
ifeq ($(BUILD),debug)
CFLAGS += -g
Expand Down

0 comments on commit 38243e3

Please sign in to comment.