mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Use the _func() replacements for open, fstat, etc in evutil.c on win32
Remember that in a fit of ANSI C compliance, Microsoft decided to screw portability by renaming basically all the functions in unistd.h to get prefixed with an understore. For some reason, mingw didn't seem to mind, but at least some people's compilers did: see bug 3044490.
This commit is contained in:
parent
acc4aca49e
commit
e50c0fcc85
6
evdns.c
6
evdns.c
@ -124,12 +124,6 @@
|
||||
#define u16 ev_uint16_t
|
||||
#define u8 ev_uint8_t
|
||||
|
||||
#ifdef WIN32
|
||||
#define open _open
|
||||
#define read _read
|
||||
#define close _close
|
||||
#endif
|
||||
|
||||
/* maximum number of addresses from a single packet */
|
||||
/* that we bother recording */
|
||||
#define MAX_V4_ADDRS 32
|
||||
|
8
evutil.c
8
evutil.c
@ -78,6 +78,14 @@
|
||||
#include "strlcpy-internal.h"
|
||||
#include "ipv6-internal.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#define open _open
|
||||
#define read _read
|
||||
#define close _close
|
||||
#define fstat _fstat
|
||||
#define stat _stat
|
||||
#endif
|
||||
|
||||
/**
|
||||
Read the contents of 'filename' into a newly allocated NUL-terminated
|
||||
string. Set *content_out to hold this string, and *len_out to hold its
|
||||
|
Loading…
x
Reference in New Issue
Block a user