endforeach()
endif()
+if(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
+ list(APPEND _picky "-Wno-arith-conversion") # Avoid warnings in DJGPP's built-in FD_SET() macro
+endif()
+
if(_picky_nocheck OR _picky)
set(_picky_tmp "${_picky_nocheck}" "${_picky}")
string(REPLACE ";" " " _picky_tmp "${_picky_tmp}")
#
fi
+case $host in
+ *msdosdjgpp)
+ if test "$compiler_num" -ge "1000"; then
+ dnl Avoid warnings in DJGPP's built-in FD_SET() macro
+ CFLAGS="$CFLAGS -Wno-arith-conversion"
+ fi
+ ;;
+esac
+
CURL_CFLAG_EXTRAS=""
if test "$want_werror" = "yes"; then
CURL_CFLAG_EXTRAS="-Werror"
*/
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wsign-conversion"
-#ifdef __DJGPP__
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
#elif defined(_MSC_VER)
#pragma warning(disable:4127) /* conditional expression is constant */
#endif
curl_socket_t sock = ps.sockets[i];
if(!FDSET_SOCK(sock))
continue;
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
if(ps.actions[i] & CURL_POLL_IN)
FD_SET(sock, read_fd_set);
if(ps.actions[i] & CURL_POLL_OUT)
FD_SET(sock, write_fd_set);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if((ps.actions[i] & (CURL_POLL_OUT | CURL_POLL_IN)) &&
((int)sock > *maxfd))
*maxfd = (int)sock;
if(!FDSET_SOCK(ps.sockets[i]))
/* pretend it does not exist */
continue;
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
if(ps.actions[i] & CURL_POLL_IN)
FD_SET(ps.sockets[i], read_fd_set);
if(ps.actions[i] & CURL_POLL_OUT)
FD_SET(ps.sockets[i], write_fd_set);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if((int)ps.sockets[i] > this_max_fd)
this_max_fd = (int)ps.sockets[i];
}
timeout.tv_usec = (int)((waitms % 1000) * 1000);
FD_ZERO(&bits);
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(fd, &bits);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if(!select(fd + 1, &bits, NULL, NULL, &timeout))
return TRUE; /* timeout */
return FALSE;
{
int i;
for(i = 0; i < sockets->count; ++i) {
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(sockets->sockets[i], fdset);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if(*maxFd < sockets->sockets[i] + 1) {
*maxFd = sockets->sockets[i] + 1;
}
{
int i;
for(i = 0; i < sockets->count; ++i) {
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(sockets->sockets[i], fdset);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if(*maxFd < sockets->sockets[i] + 1) {
*maxFd = sockets->sockets[i] + 1;
}
{
int i;
for(i = 0; i < sockets->count; ++i) {
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(sockets->sockets[i], fdset);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if(*maxFd < sockets->sockets[i] + 1) {
*maxFd = sockets->sockets[i] + 1;
}
FD_ZERO(&fds_err);
/* there is always a socket to wait for */
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(sockfd, &fds_read);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
do {
/* select() blocking behavior call on blocking descriptors please */
FD_ZERO(&fds_write);
FD_ZERO(&fds_err);
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET((curl_socket_t)fileno(stdin), &fds_read);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
switch(*mode) {
/* server mode */
sockfd = listenfd;
/* there is always a socket to wait for */
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(sockfd, &fds_read);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
maxfd = (int)sockfd;
break;
}
else {
/* there is always a socket to wait for */
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(sockfd, &fds_read);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
maxfd = (int)sockfd;
}
break;
sockfd = *sockfdp;
/* sockfd turns CURL_SOCKET_BAD when our connection has been closed */
if(CURL_SOCKET_BAD != sockfd) {
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(sockfd, &fds_read);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
maxfd = (int)sockfd;
}
else {
FD_ZERO(&fds_err);
/* there is always a socket to wait for */
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(sockfd, &fds_read);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
for(i = 0; i < 2; i++) {
if(c[i].used) {
curl_socket_t fd = c[i].clientfd;
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(fd, &fds_read);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if((int)fd > maxfd)
maxfd = (int)fd;
fd = c[i].remotefd;
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(fd, &fds_read);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if((int)fd > maxfd)
maxfd = (int)fd;
}
FD_ZERO(&input);
FD_ZERO(&output);
got = 0;
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(sock, &input);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
do {
logmsg("Wait until readable");
rc = select((int)sock + 1, &input, &output, NULL, &timeout);
timeout.tv_sec = 1; /* 1000 ms */
FD_ZERO(&output);
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(serverfd, &output);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
while(1) {
rc = select((int)serverfd + 1, NULL, &output, NULL, &timeout);
if(rc < 0 && SOCKERRNO != SOCKEINTR)
/* listener socket is monitored to allow client to establish
secondary tunnel only when this tunnel is not established
and primary one is fully operational */
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(rootfd, &input);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
maxfd = rootfd;
}
if(clientfd[i] != CURL_SOCKET_BAD) {
if(poll_client_rd[i]) {
/* unless told not to do so, monitor readability */
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(clientfd[i], &input);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if(clientfd[i] > maxfd)
maxfd = clientfd[i];
}
if(poll_client_wr[i] && toc[i]) {
/* unless told not to do so, monitor writability
if there is data ready to be sent to client */
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(clientfd[i], &output);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if(clientfd[i] > maxfd)
maxfd = clientfd[i];
}
if(serverfd[i] != CURL_SOCKET_BAD) {
if(poll_server_rd[i]) {
/* unless told not to do so, monitor readability */
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(serverfd[i], &input);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if(serverfd[i] > maxfd)
maxfd = serverfd[i];
}
if(poll_server_wr[i] && tos[i]) {
/* unless told not to do so, monitor writability
if there is data ready to be sent to server */
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(serverfd[i], &output);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if(serverfd[i] > maxfd)
maxfd = serverfd[i];
}
for(socket_idx = 0; socket_idx < num_sockets; ++socket_idx) {
/* Listen on all sockets */
-#ifdef __DJGPP__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warith-conversion"
-#endif
FD_SET(all_sockets[socket_idx], &input);
-#ifdef __DJGPP__
-#pragma GCC diagnostic pop
-#endif
if(all_sockets[socket_idx] > maxfd)
maxfd = all_sockets[socket_idx];
}