[LIBTIRPC]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 18 Jun 2017 16:41:23 +0000 (16:41 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 18 Jun 2017 16:41:23 +0000 (16:41 +0000)
- Fix MSVC build
CORE-8204

svn path=/trunk/; revision=75098

reactos/dll/win32/libtirpc/CMakeLists.txt
reactos/dll/win32/libtirpc/src/auth_time.c
reactos/dll/win32/libtirpc/src/auth_unix.c
reactos/dll/win32/libtirpc/src/bindresvport.c
reactos/dll/win32/libtirpc/src/clnt_vc.c
reactos/dll/win32/libtirpc/src/rpc_generic.c

index f45fc75..bf566b0 100644 (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)
index ad8e521..35000e5 100644 (file)
@@ -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;
index 0844aa5..9119eed 100644 (file)
@@ -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);
index c1f0d9b..d4a0e2f 100644 (file)
@@ -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
index 1cbf26f..bee5c32 100644 (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) {
index 8d457d5..f3bbc73 100644 (file)
@@ -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;
        }