Add win32 magics to example programs
Some examples lack win32 socket magic. Add it. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>libnfs-4.0.0-vitalif
parent
a5408bfa09
commit
b3c4106022
|
@ -23,6 +23,8 @@
|
|||
|
||||
#ifdef WIN32
|
||||
#include "win32_compat.h"
|
||||
#pragma comment(lib, "ws2_32.lib")
|
||||
WSADATA wsaData;
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
@ -237,6 +239,13 @@ int main(int argc _U_, char *argv[] _U_)
|
|||
struct client client;
|
||||
struct pollfd pfds[2]; /* nfs:0 mount:1 */
|
||||
|
||||
#ifdef WIN32
|
||||
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) {
|
||||
printf("Failed to start Winsock2\n");
|
||||
exit(10);
|
||||
}
|
||||
#endif
|
||||
|
||||
client.server = SERVER;
|
||||
client.export = EXPORT;
|
||||
client.is_finished = 0;
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#ifdef WIN32
|
||||
#include "win32_compat.h"
|
||||
#pragma comment(lib, "ws2_32.lib")
|
||||
WSADATA wsaData;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POLL_H
|
||||
|
@ -139,6 +141,13 @@ int main(int argc _U_, char *argv[] _U_)
|
|||
struct nfs_server_list *srvr;
|
||||
char *ptr;
|
||||
|
||||
#ifdef WIN32
|
||||
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) {
|
||||
printf("Failed to start Winsock2\n");
|
||||
exit(10);
|
||||
}
|
||||
#endif
|
||||
|
||||
rpc = rpc_init_udp_context();
|
||||
if (rpc == NULL) {
|
||||
printf("failed to init context\n");
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#ifdef WIN32
|
||||
#include "win32_compat.h"
|
||||
#pragma comment(lib, "ws2_32.lib")
|
||||
WSADATA wsaData;
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -34,6 +36,13 @@ int main(int argc _U_, char *argv[] _U_)
|
|||
struct nfs_server_list *srvrs;
|
||||
struct nfs_server_list *srv;
|
||||
|
||||
#ifdef WIN32
|
||||
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) {
|
||||
printf("Failed to start Winsock2\n");
|
||||
exit(10);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef AROS
|
||||
aros_init_socket();
|
||||
#endif
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
#ifdef WIN32
|
||||
#include "win32_compat.h"
|
||||
#pragma comment(lib, "ws2_32.lib")
|
||||
WSADATA wsaData;
|
||||
#endif
|
||||
#define SERVER "10.1.1.27"
|
||||
#define EXPORT "/shared"
|
||||
|
@ -422,6 +424,13 @@ int main(int argc _U_, char *argv[] _U_)
|
|||
struct pollfd pfd;
|
||||
struct client client;
|
||||
|
||||
#ifdef WIN32
|
||||
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) {
|
||||
printf("Failed to start Winsock2\n");
|
||||
exit(10);
|
||||
}
|
||||
#endif
|
||||
|
||||
rpc = rpc_init_context();
|
||||
if (rpc == NULL) {
|
||||
printf("failed to init context\n");
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
#ifdef WIN32
|
||||
#include "win32_compat.h"
|
||||
#pragma comment(lib, "ws2_32.lib")
|
||||
WSADATA wsaData;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POLL_H
|
||||
|
@ -343,6 +345,13 @@ int main(int argc _U_, char *argv[] _U_)
|
|||
char *getaddr3netid, *getaddr3addr, *getaddr3owner;
|
||||
char *u2t3string;
|
||||
|
||||
#ifdef WIN32
|
||||
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) {
|
||||
printf("Failed to start Winsock2\n");
|
||||
exit(10);
|
||||
}
|
||||
#endif
|
||||
|
||||
rpc = rpc_init_context();
|
||||
if (rpc == NULL) {
|
||||
printf("failed to init context\n");
|
||||
|
|
Loading…
Reference in New Issue