MSVSC fixes
This commit is contained in:
parent
4cb675e2d9
commit
3b2560feb3
@ -44,7 +44,7 @@ int
|
||||
posix_open(const char *path, ...)
|
||||
{
|
||||
va_list ap;
|
||||
mode_t mode = 0;
|
||||
int mode = 0;
|
||||
int flags;
|
||||
|
||||
va_start(ap, path);
|
||||
|
@ -29,10 +29,4 @@
|
||||
#define FD_CLOEXEC 1
|
||||
#endif
|
||||
|
||||
int posix_open(const char *path, ...);
|
||||
|
||||
#ifndef NO_REDEF_POSIX_FUNCTIONS
|
||||
#define open(path, ...) posix_open(path, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -26,6 +26,10 @@ int asprintf(char **str, const char *fmt, ...);
|
||||
|
||||
#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);
|
||||
|
@ -26,7 +26,10 @@
|
||||
|
||||
int posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
|
||||
|
||||
int posix_open(const char *path, ...);
|
||||
|
||||
int posix_close(int fd);
|
||||
|
||||
ssize_t posix_read(int fd, void *buf, size_t count);
|
||||
|
||||
ssize_t posix_write(int fd, const void *buf, size_t count);
|
||||
@ -39,6 +42,7 @@ int posix_setsockopt(int sockfd, int level, int optname,
|
||||
|
||||
#ifndef NO_REDEF_POSIX_FUNCTIONS
|
||||
#define connect(sockfd, addr, addrlen) posix_connect(sockfd, addr, addrlen)
|
||||
#define open(path, ...) posix_open(path, __VA_ARGS__)
|
||||
#define close(fd) posix_close(fd)
|
||||
#define read(fd, buf, count) posix_read(fd, buf, count)
|
||||
#define write(fd, buf, count) posix_write(fd, buf, count)
|
||||
|
Loading…
Reference in New Issue
Block a user