2014-11-19 14:43:07 +01:00
|
|
|
/*
|
|
|
|
* Public domain
|
|
|
|
* stdio.h compatibility shim
|
|
|
|
*/
|
|
|
|
|
2014-07-29 02:26:15 +02:00
|
|
|
#ifndef LIBCRYPTOCOMPAT_STDIO_H
|
|
|
|
#define LIBCRYPTOCOMPAT_STDIO_H
|
|
|
|
|
2014-07-11 05:06:10 +02:00
|
|
|
#ifdef _MSC_VER
|
2015-09-08 22:00:09 +02:00
|
|
|
#if _MSC_VER >= 1900
|
|
|
|
#include <../ucrt/stdlib.h>
|
|
|
|
#include <../ucrt/corecrt_io.h>
|
|
|
|
#include <../ucrt/stdio.h>
|
|
|
|
#else
|
2014-07-11 05:06:10 +02:00
|
|
|
#include <../include/stdio.h>
|
2015-09-08 22:00:09 +02:00
|
|
|
#endif
|
2014-07-11 05:06:10 +02:00
|
|
|
#else
|
|
|
|
#include_next <stdio.h>
|
|
|
|
#endif
|
|
|
|
|
2014-10-29 21:44:36 +01:00
|
|
|
#ifndef HAVE_ASPRINTF
|
2014-08-12 10:21:48 +02:00
|
|
|
#include <stdarg.h>
|
2014-07-29 02:26:15 +02:00
|
|
|
int vasprintf(char **str, const char *fmt, va_list ap);
|
|
|
|
int asprintf(char **str, const char *fmt, ...);
|
|
|
|
#endif
|
|
|
|
|
2014-11-20 14:32:15 +01:00
|
|
|
#ifdef _WIN32
|
|
|
|
|
2015-06-05 11:31:56 +02:00
|
|
|
void posix_perror(const char *s);
|
|
|
|
FILE * posix_fopen(const char *path, const char *mode);
|
|
|
|
int posix_rename(const char *oldpath, const char *newpath);
|
2014-11-20 14:32:15 +01:00
|
|
|
|
2015-06-05 11:31:56 +02:00
|
|
|
#ifndef NO_REDEF_POSIX_FUNCTIONS
|
2014-11-20 14:32:15 +01:00
|
|
|
#define perror(errnum) posix_perror(errnum)
|
2015-06-05 10:31:28 +02:00
|
|
|
#define fopen(path, mode) posix_fopen(path, mode)
|
2015-06-05 11:31:56 +02:00
|
|
|
#define rename(oldpath, newpath) posix_rename(oldpath, newpath)
|
|
|
|
#endif
|
2015-06-05 10:31:28 +02:00
|
|
|
|
2014-07-11 05:06:10 +02:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define snprintf _snprintf
|
|
|
|
#endif
|
|
|
|
|
2014-11-20 14:32:15 +01:00
|
|
|
#endif
|
|
|
|
|
2014-07-29 02:26:15 +02:00
|
|
|
#endif
|