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:
Nick Mathewson 2010-09-02 11:10:50 -04:00
parent acc4aca49e
commit e50c0fcc85
2 changed files with 8 additions and 6 deletions

View File

@ -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

View File

@ -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