aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2017-01-16 10:36:05 -0600
committerBrent Cook <busterb@gmail.com>2017-01-16 10:59:24 -0600
commit3b2560feb355e708a59ecfb224932810687a75ad (patch)
tree0854a5907ad6c5a545864ef964e14f53bd5ea5a8
parent4cb675e2d9e17d7727c5268d4f7ccab70bd27aed (diff)
downloadportable-3b2560feb355e708a59ecfb224932810687a75ad.tar.gz
portable-3b2560feb355e708a59ecfb224932810687a75ad.tar.bz2
portable-3b2560feb355e708a59ecfb224932810687a75ad.zip
MSVSC fixes
-rw-r--r--crypto/compat/posix_win.c2
-rw-r--r--include/compat/fcntl.h6
-rw-r--r--include/compat/stdio.h4
-rw-r--r--include/compat/win32netcompat.h4
4 files changed, 9 insertions, 7 deletions
diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c
index 331f88e..f8121d8 100644
--- a/crypto/compat/posix_win.c
+++ b/crypto/compat/posix_win.c
@@ -44,7 +44,7 @@ int
44posix_open(const char *path, ...) 44posix_open(const char *path, ...)
45{ 45{
46 va_list ap; 46 va_list ap;
47 mode_t mode = 0; 47 int mode = 0;
48 int flags; 48 int flags;
49 49
50 va_start(ap, path); 50 va_start(ap, path);
diff --git a/include/compat/fcntl.h b/include/compat/fcntl.h
index edc468a..99c2d58 100644
--- a/include/compat/fcntl.h
+++ b/include/compat/fcntl.h
@@ -29,10 +29,4 @@
29#define FD_CLOEXEC 1 29#define FD_CLOEXEC 1
30#endif 30#endif
31 31
32int posix_open(const char *path, ...);
33
34#ifndef NO_REDEF_POSIX_FUNCTIONS
35#define open(path, ...) posix_open(path, __VA_ARGS__)
36#endif
37
38#endif 32#endif
diff --git a/include/compat/stdio.h b/include/compat/stdio.h
index a0dda6f..d5725c9 100644
--- a/include/compat/stdio.h
+++ b/include/compat/stdio.h
@@ -26,6 +26,10 @@ int asprintf(char **str, const char *fmt, ...);
26 26
27#ifdef _WIN32 27#ifdef _WIN32
28 28
29#if defined(_MSC_VER)
30#define __func__ __FUNCTION__
31#endif
32
29void posix_perror(const char *s); 33void posix_perror(const char *s);
30FILE * posix_fopen(const char *path, const char *mode); 34FILE * posix_fopen(const char *path, const char *mode);
31char * posix_fgets(char *s, int size, FILE *stream); 35char * posix_fgets(char *s, int size, FILE *stream);
diff --git a/include/compat/win32netcompat.h b/include/compat/win32netcompat.h
index 933f083..eabebe9 100644
--- a/include/compat/win32netcompat.h
+++ b/include/compat/win32netcompat.h
@@ -26,7 +26,10 @@
26 26
27int posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); 27int posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
28 28
29int posix_open(const char *path, ...);
30
29int posix_close(int fd); 31int posix_close(int fd);
32
30ssize_t posix_read(int fd, void *buf, size_t count); 33ssize_t posix_read(int fd, void *buf, size_t count);
31 34
32ssize_t posix_write(int fd, const void *buf, size_t count); 35ssize_t posix_write(int fd, const void *buf, size_t count);
@@ -39,6 +42,7 @@ int posix_setsockopt(int sockfd, int level, int optname,
39 42
40#ifndef NO_REDEF_POSIX_FUNCTIONS 43#ifndef NO_REDEF_POSIX_FUNCTIONS
41#define connect(sockfd, addr, addrlen) posix_connect(sockfd, addr, addrlen) 44#define connect(sockfd, addr, addrlen) posix_connect(sockfd, addr, addrlen)
45#define open(path, ...) posix_open(path, __VA_ARGS__)
42#define close(fd) posix_close(fd) 46#define close(fd) posix_close(fd)
43#define read(fd, buf, count) posix_read(fd, buf, count) 47#define read(fd, buf, count) posix_read(fd, buf, count)
44#define write(fd, buf, count) posix_write(fd, buf, count) 48#define write(fd, buf, count) posix_write(fd, buf, count)