Ticket #137: 0001-Fixed-a-number-of-fatal-build-errors-on-Visual-Studi.patch

File 0001-Fixed-a-number-of-fatal-build-errors-on-Visual-Studi.patch, 2.4 KB (added by Samuli Seppänen, 14 years ago)

Patch fixing a number of these build errors

  • helper.c

    From e0acba6ae2822c92388691043bab62294eda48b4 Mon Sep 17 00:00:00 2001
    From: Samuli Seppänen <samuli@openvpn.net>
    Date: Fri, 20 May 2011 09:12:45 -0700
    Subject: [PATCH] Fixed a number of fatal build errors on Visual Studio 2008
    
    Partially fixes ticket #137
    ---
     helper.c        |   12 ++++++------
     socket.c        |    4 ++++
     win/config.h.in |    2 +-
     win32.h         |    2 ++
     4 files changed, 13 insertions(+), 7 deletions(-)
    
    diff --git a/helper.c b/helper.c
    index 266b246..c7333f6 100644
    a b helper_client_server (struct options *o) 
    143143#if P2MP
    144144#if P2MP_SERVER
    145145
     146/*
     147   * Get tun/tap/null device type
     148   */
     149  const int dev = dev_type_enum (o->dev, o->dev_type);
     150  const int topology = o->topology;
     151
    146152  /*
    147153   *
    148154   * HELPER DIRECTIVE for IPv6
    helper_client_server (struct options *o) 
    220226   *   push "route-gateway 10.8.0.1"
    221227   */
    222228
    223   /*
    224    * Get tun/tap/null device type
    225    */
    226   const int dev = dev_type_enum (o->dev, o->dev_type);
    227   const int topology = o->topology;
    228 
    229229  if (o->server_defined)
    230230    {
    231231      int netbits = -2;
  • socket.c

    diff --git a/socket.c b/socket.c
    index 6b855c0..3d4801f 100644
    a b link_socket_write_udp_posix_sendmsg (struct link_socket *sock, 
    31563156 * inet_ntop() and inet_pton() wrap-implementations using
    31573157 * WSAAddressToString() and WSAStringToAddress() functions
    31583158 */
     3159
     3160/*
    31593161const char *
    31603162inet_ntop(int af, const void *src, char *dst, socklen_t size)
    31613163{
    inet_pton(int af, const char *src, void *dst) 
    32043206  return 0;
    32053207}
    32063208
     3209*/
     3210
    32073211int
    32083212socket_recv_queue (struct link_socket *sock, int maxsize)
    32093213{
  • win/config.h.in

    diff --git a/win/config.h.in b/win/config.h.in
    index 82344a0..ec447a2 100644
    a b typedef unsigned long in_addr_t; 
    275275#define inline __inline
    276276
    277277/* type to use in place of socklen_t if not defined */
    278 #define socklen_t unsigned int
     278/*#define socklen_t unsigned int*/
    279279
    280280#ifndef __MINGW32__
    281281/* 32-bit unsigned type */
  • win32.h

    diff --git a/win32.h b/win32.h
    index d0ecc85..3b26bb1 100644
    a b char *get_win_sys_path (void); 
    272272
    273273/* call self in a subprocess */
    274274void fork_to_self (const char *cmdline);
     275#ifdef _MSV_VER
    275276const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
    276277int inet_pton(int af, const char *src, void *st);
     278#endif
    277279
    278280/* Find temporary directory */
    279281const char *win_get_tempdir();