[LIBTIRPC]

- Fix MSVC build
CORE-8204

svn path=/trunk/; revision=75098
This commit is contained in:
Thomas Faber
2017-06-18 16:41:23 +00:00
parent 080086f7e7
commit 962da98340
6 changed files with 36 additions and 5 deletions
+3 -4
View File
@@ -1,6 +1,6 @@
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
add_definitions(-DUNICODE -D_WIN32 -DPORTMAP)
add_definitions(-DUNICODE -D_WIN32 -DPORTMAP -Dstrdup=_strdup)
include_directories(${REACTOS_SOURCE_DIR}/dll/win32/libtirpc/tirpc)
@@ -94,11 +94,10 @@ add_library(libtirpc SHARED
if(MSVC)
else()
# FIXME: Tons of warnings.
replace_compile_flags("-Werror" " ")
add_target_compile_flags(libtirpc "-w")
endif()
set_module_type(libtirpc win32dll)
target_link_libraries(libtirpc user32 advapi32)
add_importlibs(libtirpc kernel32 kernel32_vista ws2_32 msvcrt)
add_importlibs(libtirpc user32 advapi32 kernel32_vista ws2_32 msvcrt kernel32 ntdll)
add_delay_importlibs(libtirpc secur32)
add_cd_file(TARGET libtirpc DESTINATION reactos/system32 FOR all)
@@ -248,7 +248,9 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
char ut[64], ipuaddr[64];
endpoint teps[32];
nis_server tsrv;
#ifndef __REACTOS__
void (*oldsig)() = NULL; /* old alarm handler */
#endif
struct sockaddr_in sin;
SOCKET s = RPC_ANYSOCK;
socklen_t len;
@@ -376,10 +376,21 @@ marshal_new_auth(auth)
}
static bool_t
#ifndef __REACTOS__
authunix_wrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args, u_int seq)
#else
authunix_wrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args)
#endif
{
return ((*func)(xdrs, args));
}
#ifdef __REACTOS__
static bool_t
authunix_unwrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args, u_int seq)
{
return ((*func)(xdrs, args));
}
#endif
static struct auth_ops *
authunix_ops()
@@ -397,7 +408,11 @@ authunix_ops()
ops.ah_refresh = authunix_refresh;
ops.ah_destroy = authunix_destroy;
ops.ah_wrap = authunix_wrap;
#ifndef __REACTOS__
ops.ah_unwrap = authunix_wrap;
#else
ops.ah_unwrap = authunix_unwrap;
#endif
}
mutex_unlock(&ops_lock);
return (&ops);
@@ -186,7 +186,9 @@ bindresvport_sa(sd, sa)
#ifdef _WIN32
memset(sa, 0, salen);
if (error = getsockopt(sd, SOL_SOCKET, SO_PROTOCOL_INFO, (char *)&proto_info, &proto_info_size) == SOCKET_ERROR) {
#ifndef __REACTOS__
int sockerr = WSAGetLastError();
#endif
return -1;
}
af = proto_info.iAddressFamily;
@@ -244,7 +246,9 @@ bindresvport_sa(sd, sa)
error = bind(sd, sa, salen);
if (error) {
#ifndef __REACTOS__
int err = WSAGetLastError();
#endif
}
#ifdef IPV6_PORTRANGE
+8 -1
View File
@@ -1025,17 +1025,24 @@ read_vc(ctp, buf, len)
}
static int
#ifndef __REACTOS__
write_vc(ctp, buf, len)
#else
write_vc(ctp, ptr, len)
#endif
void *ctp;
#ifndef __REACTOS__
char *buf;
#else
void *buf;
void *ptr;
#endif
int len;
{
struct ct_data *ct = (struct ct_data *)ctp;
int i = 0, cnt;
#ifdef __REACTOS__
char *buf = ptr;
#endif
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
if ((i = send(ct->ct_fd, buf, (size_t)cnt, 0)) == SOCKET_ERROR) {
@@ -488,7 +488,9 @@ __rpc_fd2sockinfo(SOCKET fd, struct __rpc_sockinfo *sip)
WSAPROTOCOL_INFO proto_info;
int proto_info_size = sizeof(proto_info);
if (getsockopt(fd, SOL_SOCKET, SO_PROTOCOL_INFO, (char *)&proto_info, &proto_info_size) == SOCKET_ERROR) {
#ifndef __REACTOS__
int err = WSAGetLastError();
#endif
return 0;
}
len = proto_info.iMaxSockAddr;
@@ -503,7 +505,9 @@ __rpc_fd2sockinfo(SOCKET fd, struct __rpc_sockinfo *sip)
len = sizeof type;
if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&type, &len) == SOCKET_ERROR) {
#ifndef __REACTOS__
int err = WSAGetLastError();
#endif
return 0;
}