summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2016-03-14 20:43:03 +0000
committermillert <millert@openbsd.org>2016-03-14 20:43:03 +0000
commitabd93d17ae546bb127b92d0cbb0af69373727d6d (patch)
treea4f5736631b0e0d11f513b567b9d473c8323b294
parentReplace an ad-hoc implementation of opendev(), with said function and (diff)
downloadwireguard-openbsd-abd93d17ae546bb127b92d0cbb0af69373727d6d.tar.xz
wireguard-openbsd-abd93d17ae546bb127b92d0cbb0af69373727d6d.zip
Expose snprintf() and vsnprintf() for XPG 5. It predates C99 but
still specified snprintf() and vsnprintf() based on earlier drafts. Allows snprintf() and vsnprintf() to be used when _XOPEN_SOURCE is defined as 500. OK guenther@
-rw-r--r--include/stdio.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 2d9f351619a..315e8f9fce4 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdio.h,v 1.50 2015/01/20 22:09:50 tedu Exp $ */
+/* $OpenBSD: stdio.h,v 1.51 2016/03/14 20:43:03 millert Exp $ */
/* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */
/*-
@@ -278,21 +278,24 @@ int vsprintf(char *, const char *, __va_list);
int vdprintf(int, const char * __restrict, __va_list);
#endif
-#if __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE
+#if __ISO_C_VISIBLE >= 1999 || __XPG_VISIBLE >= 500 || __BSD_VISIBLE
int snprintf(char *, size_t, const char *, ...)
__attribute__((__format__ (printf, 3, 4)))
__attribute__((__nonnull__ (3)))
__attribute__((__bounded__ (__string__,1,2)));
+int vsnprintf(char *, size_t, const char *, __va_list)
+ __attribute__((__format__ (printf, 3, 0)))
+ __attribute__((__nonnull__ (3)))
+ __attribute__((__bounded__(__string__,1,2)));
+#endif /* __ISO_C_VISIBLE >= 1999 || __XPG_VISIBLE >= 500 || __BSD_VISIBLE */
+
+#if __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE
int vfscanf(FILE *, const char *, __va_list)
__attribute__((__format__ (scanf, 2, 0)))
__attribute__((__nonnull__ (2)));
int vscanf(const char *, __va_list)
__attribute__((__format__ (scanf, 1, 0)))
__attribute__((__nonnull__ (1)));
-int vsnprintf(char *, size_t, const char *, __va_list)
- __attribute__((__format__ (printf, 3, 0)))
- __attribute__((__nonnull__ (3)))
- __attribute__((__bounded__(__string__,1,2)));
int vsscanf(const char *, const char *, __va_list)
__attribute__((__format__ (scanf, 2, 0)))
__attribute__((__nonnull__ (2)));