(main) [_WIN32]: Upgrade to winsock version 2.
Remove version 1.1 include files.
This commit is contained in:
parent
59c8e97797
commit
1a539f9128
6 changed files with 5 additions and 10 deletions
|
@ -42,8 +42,6 @@
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
|
||||||
#include <winsock.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <winsock.h>
|
|
||||||
#endif
|
#endif
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winsock.h>
|
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -78,6 +77,7 @@ int
|
||||||
main(int ac, char **av)
|
main(int ac, char **av)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
WORD wVersionRequested;
|
||||||
WSADATA WsaData;
|
WSADATA WsaData;
|
||||||
int err;
|
int err;
|
||||||
fd_set readfds;
|
fd_set readfds;
|
||||||
|
@ -117,9 +117,10 @@ main(int ac, char **av)
|
||||||
* after each prompt is required.
|
* after each prompt is required.
|
||||||
*/
|
*/
|
||||||
setvbuf(stdout, NULL, _IOLBF, 4096);
|
setvbuf(stdout, NULL, _IOLBF, 4096);
|
||||||
err = WSAStartup(0x0101, &WsaData);
|
wVersionRequested = MAKEWORD(2, 0);
|
||||||
if (err == SOCKET_ERROR) {
|
err = WSAStartup(wVersionRequested, &WsaData);
|
||||||
printf("WSAStartup Failed\n");
|
if (err != 0) {
|
||||||
|
printf("WSAStartup Failed, error code %d\n", err);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winsock.h>
|
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
#include <winsock.h>
|
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
#include <winsock.h>
|
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue