Portable build framework for OpenNTPD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
514 B

  1. /*
  2. * Public domain
  3. * stdio.h compatibility shim
  4. */
  5. #include_next <stdio.h>
  6. #ifndef LIBCRYPTOCOMPAT_STDIO_H
  7. #define LIBCRYPTOCOMPAT_STDIO_H
  8. #ifndef HAVE_ASPRINTF
  9. #include <stdarg.h>
  10. int vasprintf(char **str, const char *fmt, va_list ap);
  11. int asprintf(char **str, const char *fmt, ...);
  12. #endif
  13. #ifdef _WIN32
  14. #include <errno.h>
  15. #include <string.h>
  16. static inline void
  17. posix_perror(const char *s)
  18. {
  19. fprintf(stderr, "%s: %s\n", s, strerror(errno));
  20. }
  21. #define perror(errnum) posix_perror(errnum)
  22. #endif
  23. #endif