summaryrefslogtreecommitdiff
path: root/lib/libz/gzguts.h
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-02-07 20:52:25 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-02-07 20:52:25 +0000
commit04a67942c25dee420e8ebd50bac0f2156a20055b (patch)
treef27749ffa842e8759f0e49983eb7c8cf0fcef0b5 /lib/libz/gzguts.h
parent902d484a184a88a42a81608b819a3363e1c8556b (diff)
sync with upstream
Diffstat (limited to 'lib/libz/gzguts.h')
-rw-r--r--lib/libz/gzguts.h37
1 files changed, 16 insertions, 21 deletions
diff --git a/lib/libz/gzguts.h b/lib/libz/gzguts.h
index eba72085bb7..074ec84ec49 100644
--- a/lib/libz/gzguts.h
+++ b/lib/libz/gzguts.h
@@ -25,8 +25,8 @@
# include <limits.h>
#endif
-#ifndef _POSIX_SOURCE
-# define _POSIX_SOURCE
+#ifndef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 200112L
#endif
#include <fcntl.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