diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/stdio.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/stdio.h b/include/stdio.h index 1de521e..78c62e8 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 */ /* |