From: Thomas Faber Date: Sun, 18 Jun 2017 16:41:23 +0000 (+0000) Subject: [LIBTIRPC] X-Git-Tag: ReactOS-0.4.6~259 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=962da983407626abd2cd739d13cbce077c4bce5c;hp=080086f7e72e7c3d1f0dc78a0f37db9530ad4d06 [LIBTIRPC] - Fix MSVC build CORE-8204 svn path=/trunk/; revision=75098 --- diff --git a/reactos/dll/win32/libtirpc/CMakeLists.txt b/reactos/dll/win32/libtirpc/CMakeLists.txt index f45fc75d72d..bf566b0875a 100644 --- a/reactos/dll/win32/libtirpc/CMakeLists.txt +++ b/reactos/dll/win32/libtirpc/CMakeLists.txt @@ -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) diff --git a/reactos/dll/win32/libtirpc/src/auth_time.c b/reactos/dll/win32/libtirpc/src/auth_time.c index ad8e5211462..35000e5cb51 100644 --- a/reactos/dll/win32/libtirpc/src/auth_time.c +++ b/reactos/dll/win32/libtirpc/src/auth_time.c @@ -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; diff --git a/reactos/dll/win32/libtirpc/src/auth_unix.c b/reactos/dll/win32/libtirpc/src/auth_unix.c index 0844aa59391..9119eede986 100644 --- a/reactos/dll/win32/libtirpc/src/auth_unix.c +++ b/reactos/dll/win32/libtirpc/src/auth_unix.c @@ -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); diff --git a/reactos/dll/win32/libtirpc/src/bindresvport.c b/reactos/dll/win32/libtirpc/src/bindresvport.c index c1f0d9b7fac..d4a0e2f0b22 100644 --- a/reactos/dll/win32/libtirpc/src/bindresvport.c +++ b/reactos/dll/win32/libtirpc/src/bindresvport.c @@ -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 diff --git a/reactos/dll/win32/libtirpc/src/clnt_vc.c b/reactos/dll/win32/libtirpc/src/clnt_vc.c index 1cbf26f5c37..bee5c32d338 100644 --- a/reactos/dll/win32/libtirpc/src/clnt_vc.c +++ b/reactos/dll/win32/libtirpc/src/clnt_vc.c @@ -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) { diff --git a/reactos/dll/win32/libtirpc/src/rpc_generic.c b/reactos/dll/win32/libtirpc/src/rpc_generic.c index 8d457d526a7..f3bbc73c461 100644 --- a/reactos/dll/win32/libtirpc/src/rpc_generic.c +++ b/reactos/dll/win32/libtirpc/src/rpc_generic.c @@ -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; }