mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 17:31:46 -05:00
warnless: add wrapper function for read and write on Windows
This commit is contained in:
parent
dc0f8c04ec
commit
6239146e93
@ -400,6 +400,20 @@ curl_socket_t curlx_sitosk(int i)
|
|||||||
|
|
||||||
#endif /* USE_WINSOCK */
|
#endif /* USE_WINSOCK */
|
||||||
|
|
||||||
|
#if defined(WIN32) || defined(_WIN32)
|
||||||
|
|
||||||
|
ssize_t curlx_read(int fd, void *buf, size_t count)
|
||||||
|
{
|
||||||
|
return (ssize_t)read(fd, buf, curlx_uztoui(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
ssize_t curlx_write(int fd, const void *buf, size_t count)
|
||||||
|
{
|
||||||
|
return (ssize_t)write(fd, buf, curlx_uztoui(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* WIN32 || _WIN32 */
|
||||||
|
|
||||||
#if defined(__INTEL_COMPILER) && defined(__unix__)
|
#if defined(__INTEL_COMPILER) && defined(__unix__)
|
||||||
|
|
||||||
int curlx_FD_ISSET(int fd, fd_set *fdset)
|
int curlx_FD_ISSET(int fd, fd_set *fdset)
|
||||||
|
@ -60,6 +60,21 @@ curl_socket_t curlx_sitosk(int i);
|
|||||||
|
|
||||||
#endif /* USE_WINSOCK */
|
#endif /* USE_WINSOCK */
|
||||||
|
|
||||||
|
#if defined(WIN32) || defined(_WIN32)
|
||||||
|
|
||||||
|
ssize_t curlx_read(int fd, void *buf, size_t count);
|
||||||
|
|
||||||
|
ssize_t curlx_write(int fd, const void *buf, size_t count);
|
||||||
|
|
||||||
|
#ifndef BUILDING_WARNLESS_C
|
||||||
|
# undef read
|
||||||
|
# define read(fd, buf, count) curlx_read(fd, buf, count)
|
||||||
|
# undef write
|
||||||
|
# define write(fd, buf, count) curlx_write(fd, buf, count)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* WIN32 || _WIN32 */
|
||||||
|
|
||||||
#if defined(__INTEL_COMPILER) && defined(__unix__)
|
#if defined(__INTEL_COMPILER) && defined(__unix__)
|
||||||
|
|
||||||
int curlx_FD_ISSET(int fd, fd_set *fdset);
|
int curlx_FD_ISSET(int fd, fd_set *fdset);
|
||||||
|
@ -13,7 +13,8 @@ CURLX_ONES = \
|
|||||||
../lib/strtoofft.c \
|
../lib/strtoofft.c \
|
||||||
../lib/strdup.c \
|
../lib/strdup.c \
|
||||||
../lib/rawstr.c \
|
../lib/rawstr.c \
|
||||||
../lib/nonblock.c
|
../lib/nonblock.c \
|
||||||
|
../lib/warnless.c
|
||||||
|
|
||||||
CURL_CFILES = \
|
CURL_CFILES = \
|
||||||
tool_binmode.c \
|
tool_binmode.c \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user