]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixed a number of fatal build errors on Visual Studio 2008
authorSamuli Seppänen <samuli@openvpn.net>
Thu, 26 May 2011 13:23:02 +0000 (16:23 +0300)
committerDavid Sommerseth <davids@redhat.com>
Thu, 25 Aug 2011 18:12:37 +0000 (20:12 +0200)
Partially fixes ticket #137

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Tested-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
helper.c
socket.c
win/config.h.in
win32.h

index 266b2467c864622f794126104db913d50fe3da26..c7333f6e1518cbc35caa149ebb8a5a8cbd040236 100644 (file)
--- a/helper.c
+++ b/helper.c
@@ -143,6 +143,12 @@ helper_client_server (struct options *o)
 #if P2MP
 #if P2MP_SERVER
 
+/*
+   * Get tun/tap/null device type
+   */
+  const int dev = dev_type_enum (o->dev, o->dev_type);
+  const int topology = o->topology;
+
   /* 
    *
    * HELPER DIRECTIVE for IPv6
@@ -220,12 +226,6 @@ helper_client_server (struct options *o)
    *   push "route-gateway 10.8.0.1"
    */
 
-  /*
-   * Get tun/tap/null device type
-   */
-  const int dev = dev_type_enum (o->dev, o->dev_type);
-  const int topology = o->topology;
-
   if (o->server_defined)
     {
       int netbits = -2;
index 6b855c0843ebcde829639d9d8e94e896cf57f373..130e08e09283a0e3ee54a06aaae4b60df637228f 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -3156,6 +3156,8 @@ link_socket_write_udp_posix_sendmsg (struct link_socket *sock,
  * inet_ntop() and inet_pton() wrap-implementations using
  * WSAAddressToString() and WSAStringToAddress() functions
  */
+
+#ifndef _MSC_VER
 const char *
 inet_ntop(int af, const void *src, char *dst, socklen_t size)
 {
@@ -3204,6 +3206,8 @@ inet_pton(int af, const char *src, void *dst)
   return 0;
 }
 
+#endif
+
 int
 socket_recv_queue (struct link_socket *sock, int maxsize)
 {
index 82344a0601eff3d2381885afed38c039f32a0bb8..ec447a2d259a5fa7bc3aeb366dacca346350deec 100644 (file)
@@ -275,7 +275,7 @@ typedef unsigned long in_addr_t;
 #define inline __inline
 
 /* type to use in place of socklen_t if not defined */
-#define socklen_t unsigned int
+/*#define socklen_t unsigned int*/
 
 #ifndef __MINGW32__
 /* 32-bit unsigned type */
diff --git a/win32.h b/win32.h
index d0ecc85dcef3017b4e61a0f1ebf8f7bad127da48..ca6dd3277f9b14173fcac8f75e20eb8d20a04142 100644 (file)
--- a/win32.h
+++ b/win32.h
@@ -272,8 +272,10 @@ char *get_win_sys_path (void);
 
 /* call self in a subprocess */
 void fork_to_self (const char *cmdline);
+#ifndef _MSV_VER
 const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
 int inet_pton(int af, const char *src, void *st);
+#endif
 
 /* Find temporary directory */
 const char *win_get_tempdir();