1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
/*
* Public domain
* stdio.h compatibility shim
*/
#ifndef LIBCRYPTOCOMPAT_STDIO_H
#define LIBCRYPTOCOMPAT_STDIO_H
#ifdef _MSC_VER
#if _MSC_VER >= 1900
#include <../ucrt/stdlib.h>
#include <../ucrt/corecrt_io.h>
#include <../ucrt/stdio.h>
#else
#include <../include/stdio.h>
#endif
#else
#include_next <stdio.h>
#endif
#ifndef HAVE_GETDELIM
#include <sys/types.h>
#define getdelim libressl_getdelim
ssize_t getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp);
#endif
#ifndef HAVE_GETLINE
#include <sys/types.h>
#define getline libressl_getline
ssize_t getline(char **buf, size_t *bufsiz, FILE *fp);
#endif
#ifndef HAVE_ASPRINTF
#include <stdarg.h>
#define vasprintf libressl_vasprintf
int vasprintf(char **str, const char *fmt, va_list ap);
#define asprintf libressl_asprintf
int asprintf(char **str, const char *fmt, ...);
#endif
#ifdef _WIN32
#if defined(_MSC_VER)
#define __func__ __FUNCTION__
#endif
void posix_perror(const char *s);
FILE * posix_fopen(const char *path, const char *mode);
char * posix_fgets(char *s, int size, FILE *stream);
int posix_rename(const char *oldpath, const char *newpath);
#ifndef NO_REDEF_POSIX_FUNCTIONS
#define perror(errnum) posix_perror(errnum)
#define fopen(path, mode) posix_fopen(path, mode)
#define fgets(s, size, stream) posix_fgets(s, size, stream)
#define rename(oldpath, newpath) posix_rename(oldpath, newpath)
#endif
#if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf
#endif
#endif
#endif
|