mirror of https://github.com/madler/zlib
Assume no snprintf() or vsnprintf() if C89/90 in gzguts.h.
Those functions were introduced in C99. However it is assumed that they are there if under Windows, since Visual C claims C89/90, but does have those functions, or variants.
This commit is contained in:
parent
915a3d5b7b
commit
e342bb3dae
33
gzguts.h
33
gzguts.h
|
@ -72,33 +72,28 @@
|
|||
#endif
|
||||
|
||||
#ifndef HAVE_VSNPRINTF
|
||||
# ifdef MSDOS
|
||||
# if !defined(NO_vsnprintf) && \
|
||||
(defined(MSDOS) || defined(__TURBOC__) || defined(__SASC) || \
|
||||
defined(VMS) || defined(__OS400) || defined(__MVS__))
|
||||
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
|
||||
but for now we just assume it doesn't. */
|
||||
# define NO_vsnprintf
|
||||
# endif
|
||||
# ifdef __TURBOC__
|
||||
# define NO_vsnprintf
|
||||
# endif
|
||||
# ifdef WIN32
|
||||
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
|
||||
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
|
||||
# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
|
||||
# define vsnprintf _vsnprintf
|
||||
# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
|
||||
# ifndef vsnprintf
|
||||
# define vsnprintf _vsnprintf
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __SASC
|
||||
# define NO_vsnprintf
|
||||
# endif
|
||||
# ifdef VMS
|
||||
# define NO_vsnprintf
|
||||
# endif
|
||||
# ifdef __OS400__
|
||||
# define NO_vsnprintf
|
||||
# endif
|
||||
# ifdef __MVS__
|
||||
# define NO_vsnprintf
|
||||
# elif !defined(__STDC_VERSION__) || __STDC_VERSION__-0 < 199901L
|
||||
/* Otherwise if C89/90, assume no C99 snprintf() or vsnprintf() */
|
||||
# ifndef NO_snprintf
|
||||
# define NO_snprintf
|
||||
# endif
|
||||
# ifndef NO_vsnprintf
|
||||
# define NO_vsnprintf
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue