aboutsummaryrefslogtreecommitdiff
path: root/include/stdio.h
diff options
context:
space:
mode:
authorDavid Schultz <das@FreeBSD.org>2009-03-04 03:38:51 +0000
committerDavid Schultz <das@FreeBSD.org>2009-03-04 03:38:51 +0000
commitad760e6fc9393a3c31b46c337bad4191ccf729ae (patch)
treea1df347e1257183601e8006328d2dc04e287ede2 /include/stdio.h
parent389533758b841be58705aa32b08c749f9769e119 (diff)
downloadsrc-ad760e6fc9393a3c31b46c337bad4191ccf729ae.tar.gz
src-ad760e6fc9393a3c31b46c337bad4191ccf729ae.zip
Notes
Diffstat (limited to 'include/stdio.h')
-rw-r--r--include/stdio.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 1de521e76e38..78c62e824f1d 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -345,12 +345,14 @@ char *tempnam(const char *, const char *);
ssize_t getdelim(char ** __restrict, size_t * __restrict, int,
FILE * __restrict);
int renameat(int, const char *, int, const char *);
+int vdprintf(int, const char * __restrict, __va_list);
/*
- * Every programmer and his dog wrote functions called getline()
- * before POSIX.1-2008 came along and decided to usurp the name, so we
- * don't prototype getline() by default unless one of the following is true:
- * a) the app has requested it specifically by defining _WITH_GETLINE
+ * Every programmer and his dog wrote functions called getline() and dprintf()
+ * before POSIX.1-2008 came along and decided to usurp the names, so we
+ * don't prototype them by default unless one of the following is true:
+ * a) the app has requested them specifically by defining _WITH_GETLINE or
+ * _WITH_DPRINTF, respectively
* b) the app has requested a POSIX.1-2008 environment via _POSIX_C_SOURCE
* c) the app defines a GNUism such as _BSD_SOURCE or _GNU_SOURCE
*/
@@ -368,6 +370,20 @@ int renameat(int, const char *, int, const char *);
ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
#endif
+#ifndef _WITH_DPRINTF
+#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
+#define _WITH_DPRINTF
+#elif defined(_POSIX_C_SOURCE)
+#if _POSIX_C_SOURCE > 200809
+#define _WITH_DPRINTF
+#endif
+#endif
+#endif
+
+#ifdef _WITH_DPRINTF
+int dprintf(int, const char * __restrict, ...);
+#endif
+
#endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 */
/*