comparison util.c @ 1950:417e0fc958cc

Fix non-Windows build break from Windows compat changes
author Michael Pavone <pavone@retrodev.com>
date Thu, 30 Apr 2020 23:18:50 -0700
parents 5a76a7373823
children cd163b230cf9
comparison
equal deleted inserted replaced
1949:5a76a7373823 1950:417e0fc958cc
439 } 439 }
440 va_end(args); 440 va_end(args);
441 exit(1); 441 exit(1);
442 } 442 }
443 443
444 #ifndef _WIN32
445 #include <unistd.h>
446 #endif
447
444 void warning(char *format, ...) 448 void warning(char *format, ...)
445 { 449 {
446 va_list args; 450 va_list args;
447 va_start(args, format); 451 va_start(args, format);
448 #ifndef _WIN32 452 #ifndef _WIN32
720 return WSAGetLastError() == WSAEWOULDBLOCK; 724 return WSAGetLastError() == WSAEWOULDBLOCK;
721 } 725 }
722 726
723 #else 727 #else
724 #include <fcntl.h> 728 #include <fcntl.h>
725 #include <unistd.h>
726 729
727 void socket_init(void) 730 void socket_init(void)
728 { 731 {
729 } 732 }
730 733
731 int socket_blocking(int sock, int should_block) 734 int socket_blocking(int sock, int should_block)
732 { 735 {
733 if (fcntl(listen_sock, F_SETFL, should_block ? 0 : O_NONBLOCK)) { 736 if (fcntl(sock, F_SETFL, should_block ? 0 : O_NONBLOCK)) {
734 return errno; 737 return errno;
735 } 738 }
736 return 0; 739 return 0;
737 } 740 }
738 741