Browse Source

add stdio.h for definition of asprintf and vasprintf

OPENBSD_5_8
kinichiro 10 years ago
committed by Brent Cook
parent
commit
9d7e230cc7
2 changed files with 31 additions and 0 deletions
  1. +1
    -0
      include/Makefile.am
  2. +30
    -0
      include/stdio.h

+ 1
- 0
include/Makefile.am View File

@ -17,5 +17,6 @@ noinst_HEADERS += stdlib.h
noinst_HEADERS += Makefile.in
noinst_HEADERS += paths.h
noinst_HEADERS += poll.h
noinst_HEADERS += stdio.h
noinst_HEADERS += time.h
noinst_HEADERS += tls.h

+ 30
- 0
include/stdio.h View File

@ -0,0 +1,30 @@
/*
* Public domain
* stdio.h compatibility shim
*/
#include_next <stdio.h>
#ifndef LIBCRYPTOCOMPAT_STDIO_H
#define LIBCRYPTOCOMPAT_STDIO_H
#ifndef HAVE_ASPRINTF
#include <stdarg.h>
int vasprintf(char **str, const char *fmt, va_list ap);
int asprintf(char **str, const char *fmt, ...);
#endif
#ifdef _WIN32
#include <errno.h>
#include <string.h>
static inline void
posix_perror(const char *s)
{
fprintf(stderr, "%s: %s\n", s, strerror(errno));
}
#define perror(errnum) posix_perror(errnum)
#endif
#endif

Loading…
Cancel
Save