Changes between Version 1 and Version 2 of BuildingTransmissionQtWindows/transmission-2.00b1-Qt-build.diff


Ignore:
Timestamp:
Jun 4, 2010, 1:25:30 AM (12 years ago)
Author:
rb07
Comment:

Correction on bencode.c

Legend:

Unmodified
Added
Removed
Modified
  • BuildingTransmissionQtWindows/transmission-2.00b1-Qt-build.diff

    v1 v2  
    11diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/configure transmission-2.00b1/configure
    2 --- transmission-2.00b1-orig/configure  2010-05-22 20:53:18.000000000 -0500
    3 +++ transmission-2.00b1/configure       2010-05-24 13:02:11.000000000 -0500
     2--- transmission-2.00b1-orig/configure  2010-05-22 20:53:18.000000000 -0500
     3+++ transmission-2.00b1/configure       2010-05-24 13:02:11.000000000 -0500
    44@@ -19907,6 +19907,11 @@
    55   libevent_extra_libs=""
     
    1515 { $as_echo "$as_me:$LINENO: checking for evutil_vsnprintf in -levent" >&5
    1616diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/JSON_parser.h transmission-2.00b1/libtransmission/JSON_parser.h
    17 --- transmission-2.00b1-orig/libtransmission/JSON_parser.h      2010-05-22 20:49:23.000000000 -0500
    18 +++ transmission-2.00b1/libtransmission/JSON_parser.h   2010-05-24 12:46:36.000000000 -0500
     17--- transmission-2.00b1-orig/libtransmission/JSON_parser.h      2010-05-22 20:49:23.000000000 -0500
     18+++ transmission-2.00b1/libtransmission/JSON_parser.h   2010-05-24 12:46:36.000000000 -0500
    1919@@ -11,7 +11,7 @@
    2020 #include <stddef.h>
     
    2323-#ifdef _WIN32
    2424+#if defined(WIN32) && !defined(STATICLIB)
    25  #      ifdef JSON_PARSER_DLL_EXPORTS
    26  #              define JSON_PARSER_DLL_API __declspec(dllexport)
    27  #      else
     25 #      ifdef JSON_PARSER_DLL_EXPORTS
     26 #              define JSON_PARSER_DLL_API __declspec(dllexport)
     27 #      else
    2828diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/Makefile.in transmission-2.00b1/libtransmission/Makefile.in
    29 --- transmission-2.00b1-orig/libtransmission/Makefile.in        2010-05-22 20:53:20.000000000 -0500
    30 +++ transmission-2.00b1/libtransmission/Makefile.in     2010-05-24 12:46:36.000000000 -0500
     29--- transmission-2.00b1-orig/libtransmission/Makefile.in        2010-05-22 20:53:20.000000000 -0500
     30+++ transmission-2.00b1/libtransmission/Makefile.in     2010-05-24 12:46:36.000000000 -0500
    3131@@ -93,7 +93,7 @@
    3232 bencode_test_OBJECTS = $(am_bencode_test_OBJECTS)
    3333 am__DEPENDENCIES_1 = ./libtransmission.a \
    34         $(top_builddir)/third-party/miniupnp/libminiupnp.a \
    35 -       $(top_builddir)/third-party/libnatpmp/libnatpmp.a
    36 +       $(top_builddir)/third-party/libnatpmp/libnatpmp.a
     34        $(top_builddir)/third-party/miniupnp/libminiupnp.a \
     35-       $(top_builddir)/third-party/libnatpmp/libnatpmp.a
     36+       $(top_builddir)/third-party/libnatpmp/libnatpmp.a
    3737 bencode_test_DEPENDENCIES = $(am__DEPENDENCIES_1)
    3838 AM_V_lt = $(am__v_lt_$(V))
     
    4747     @LIBCURL_LIBS@ \
    4848diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/bencode.c transmission-2.00b1/libtransmission/bencode.c
    49 --- transmission-2.00b1-orig/libtransmission/bencode.c  2010-05-22 20:49:23.000000000 -0500
    50 +++ transmission-2.00b1/libtransmission/bencode.c       2010-05-24 13:06:07.000000000 -0500
     49--- transmission-2.00b1-orig/libtransmission/bencode.c  2010-05-22 20:49:23.000000000 -0500
     50+++ transmission-2.00b1/libtransmission/bencode.c       2010-06-01 19:47:41.000000000 -0500
    5151@@ -17,6 +17,11 @@
    5252 #include <stdio.h>
     
    5454 #include <string.h>
    5555+#ifdef WIN32
    56 + #define mkstemp       mktemp
    57 + #define fsync         _commit
     56+ #include <fcntl.h>
     57+ #define fsync         _commit
    5858+ static char *realpath();
    5959+#endif
     
    6161 #include <sys/types.h> /* stat() */
    6262 #include <sys/stat.h> /* stat() */
    63 @@ -1710,3 +1715,17 @@
     63@@ -1629,7 +1634,12 @@
     64         filename = buf;
     65 
     66     /* if the file already exists, try to move it out of the way & keep it as a backup */
     67+#ifdef WIN32
     68+    tmp = tr_strdup_printf( "%s_tmp.XXXXXX", filename );
     69+    #define mkstemp(t) open(mktemp(t), O_CREAT | O_EXCL | O_RDWR, 0600);
     70+#else
     71     tmp = tr_strdup_printf( "%s.tmp.XXXXXX", filename );
     72+#endif
     73     fd = mkstemp( tmp );
     74     if( fd >= 0 )
     75     {
     76@@ -1653,21 +1663,21 @@
     77                 else
     78                 {
     79                     err = errno;
     80-                    tr_err( _( "Couldn't save file \"%1$s\": %2$s" ), filename, tr_strerror( err ) );
     81+                    tr_err( _( "Couldn't save file \"%s\": %s" ), filename, tr_strerror( err ) );
     82                     unlink( tmp );
     83                 }
     84             }
     85             else
     86             {
     87                 err = errno;
     88-                tr_err( _( "Couldn't save file \"%1$s\": %2$s" ), filename, tr_strerror( err ) );
     89+                tr_err( _( "Couldn't save file \"%s\": %s" ), filename, tr_strerror( err ) );
     90                 unlink( tmp );
     91             }
     92         }
     93         else
     94         {
     95             err = errno;
     96-            tr_err( _( "Couldn't save temporary file \"%1$s\": %2$s" ), tmp, tr_strerror( err ) );
     97+            tr_err( _( "Couldn't save temporary file \"%s\": %s" ), tmp, tr_strerror( err ) );
     98             close( fd );
     99             unlink( tmp );
     100         }
     101@@ -1677,7 +1687,7 @@
     102     else
     103     {
     104         err = errno;
     105-        tr_err( _( "Couldn't save temporary file \"%1$s\": %2$s" ), tmp, tr_strerror( err ) );
     106+        tr_err( _( "Couldn't save temporary file \"%s\": %s" ), tmp, tr_strerror( err ) );
     107     }
     108 
     109     tr_free( tmp );
     110@@ -1710,3 +1720,16 @@
    64111     tr_free( content );
    65112     return err;
     
    73120+char *realpath(const char *path, char *resolved_path)
    74121+{
    75 +    char *pszFilePart;
    76 +    if (GetFullPathNameA(path, TR_PATH_MAX, resolved_path, &pszFilePart) == 0)
     122+    if (GetFullPathNameA(path, TR_PATH_MAX, resolved_path, NULL) == 0)
    77123+        return NULL;
    78124+    return resolved_path;
     
    80126+#endif
    81127diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/net.c transmission-2.00b1/libtransmission/net.c
    82 --- transmission-2.00b1-orig/libtransmission/net.c      2010-05-22 20:49:23.000000000 -0500
    83 +++ transmission-2.00b1/libtransmission/net.c   2010-05-24 12:46:36.000000000 -0500
     128--- transmission-2.00b1-orig/libtransmission/net.c      2010-05-22 20:49:23.000000000 -0500
     129+++ transmission-2.00b1/libtransmission/net.c   2010-05-24 12:46:36.000000000 -0500
    84130@@ -32,8 +32,9 @@
    85131 #include <sys/types.h>
     
    88134- #include <winsock2.h> /* inet_addr */
    89135- #include <WS2tcpip.h>
    90 + #define _WIN32_WINNT  0x0501
     136+ #define _WIN32_WINNT  0x0501
    91137+ #include <ws2tcpip.h>
    92 + #define EADDRINUSE    WSAEADDRINUSE
     138+ #define EADDRINUSE    WSAEADDRINUSE
    93139 #else
    94140  #include <sys/socket.h>
    95141  #include <netinet/in.h>
    96142diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/net.h transmission-2.00b1/libtransmission/net.h
    97 --- transmission-2.00b1-orig/libtransmission/net.h      2010-05-22 20:49:23.000000000 -0500
    98 +++ transmission-2.00b1/libtransmission/net.h   2010-05-24 12:46:36.000000000 -0500
     143--- transmission-2.00b1-orig/libtransmission/net.h      2010-05-22 20:49:23.000000000 -0500
     144+++ transmission-2.00b1/libtransmission/net.h   2010-05-24 12:46:36.000000000 -0500
    99145@@ -31,8 +31,7 @@
    100146 
     
    108154  #include <sys/types.h>
    109155diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/peer-mgr.c transmission-2.00b1/libtransmission/peer-mgr.c
    110 --- transmission-2.00b1-orig/libtransmission/peer-mgr.c 2010-05-22 20:49:23.000000000 -0500
    111 +++ transmission-2.00b1/libtransmission/peer-mgr.c      2010-05-24 12:46:36.000000000 -0500
     156--- transmission-2.00b1-orig/libtransmission/peer-mgr.c 2010-05-22 20:49:23.000000000 -0500
     157+++ transmission-2.00b1/libtransmission/peer-mgr.c      2010-05-24 12:46:36.000000000 -0500
    112158@@ -15,6 +15,9 @@
    113159 #include <stdlib.h> /* qsort */
     
    121167 #include "announcer.h"
    122168diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/platform.c transmission-2.00b1/libtransmission/platform.c
    123 --- transmission-2.00b1-orig/libtransmission/platform.c 2010-05-22 20:49:23.000000000 -0500
    124 +++ transmission-2.00b1/libtransmission/platform.c      2010-05-24 13:08:18.000000000 -0500
     169--- transmission-2.00b1-orig/libtransmission/platform.c 2010-05-22 20:49:23.000000000 -0500
     170+++ transmission-2.00b1/libtransmission/platform.c      2010-05-24 13:08:18.000000000 -0500
    125171@@ -436,7 +436,7 @@
    126172             s = tr_buildPath( getHomeDir( ), "Library", "Application Support",
     
    132178             s = tr_buildPath( appdata, appname, NULL );
    133179 #elif defined( __HAIKU__ )
     180diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/platform.h transmission-2.00b1/libtransmission/platform.h
     181--- transmission-2.00b1-orig/libtransmission/platform.h 2010-05-22 20:49:23.000000000 -0500
     182+++ transmission-2.00b1/libtransmission/platform.h      2010-06-01 17:11:30.000000000 -0500
     183@@ -26,8 +26,8 @@
     184 #endif
     185 
     186 #ifdef WIN32
     187- #include <windows.h> /* MAX_PATH */
     188- #define TR_PATH_MAX MAX_PATH
     189+ #include <windef.h> /* MAX_PATH */
     190+ #define TR_PATH_MAX (MAX_PATH + 1)
     191 #else
     192  #include <limits.h> /* PATH_MAX */
     193  #ifdef PATH_MAX
    134194diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/torrent.c transmission-2.00b1/libtransmission/torrent.c
    135 --- transmission-2.00b1-orig/libtransmission/torrent.c  2010-05-22 20:49:23.000000000 -0500
    136 +++ transmission-2.00b1/libtransmission/torrent.c       2010-05-24 17:17:03.000000000 -0500
     195--- transmission-2.00b1-orig/libtransmission/torrent.c  2010-05-22 20:49:23.000000000 -0500
     196+++ transmission-2.00b1/libtransmission/torrent.c       2010-05-24 17:17:03.000000000 -0500
    137197@@ -1670,6 +1670,19 @@
    138198     tr_torrentSetRatioLimitHitCallback( torrent, NULL, NULL );
     
    140200 
    141201+#ifdef WIN32
    142 +#include <pthread.h>   /* asctime_r(), ctime_r(), localtime_r() */
     202+#include <pthread.h>   /* asctime_r(), ctime_r(), localtime_r() */
    143203+
    144204+static void
     
    156216 torrentCallScript( tr_torrent * tor, const char * script )
    157217diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/tr-dht.c transmission-2.00b1/libtransmission/tr-dht.c
    158 --- transmission-2.00b1-orig/libtransmission/tr-dht.c   2010-05-22 20:49:23.000000000 -0500
    159 +++ transmission-2.00b1/libtransmission/tr-dht.c        2010-05-24 12:46:36.000000000 -0500
     218--- transmission-2.00b1-orig/libtransmission/tr-dht.c   2010-05-22 20:49:23.000000000 -0500
     219+++ transmission-2.00b1/libtransmission/tr-dht.c        2010-05-24 12:46:36.000000000 -0500
    160220@@ -25,13 +25,19 @@
    161221 #include <stdio.h>
     
    171231+#ifdef WIN32
    172232+  #include <inttypes.h>
    173 +  #define _WIN32_WINNT  0x0501 /* freeaddrinfo(),getaddrinfo(),getnameinfo() */
     233+  #define _WIN32_WINNT  0x0501 /* freeaddrinfo(),getaddrinfo(),getnameinfo() */
    174234+  #include <ws2tcpip.h>
    175235+#else
     
    183243 #include <event.h>
    184244diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/tr-lpd.c transmission-2.00b1/libtransmission/tr-lpd.c
    185 --- transmission-2.00b1-orig/libtransmission/tr-lpd.c   2010-05-22 20:49:23.000000000 -0500
    186 +++ transmission-2.00b1/libtransmission/tr-lpd.c        2010-05-24 16:39:03.000000000 -0500
     245--- transmission-2.00b1-orig/libtransmission/tr-lpd.c   2010-05-22 20:49:23.000000000 -0500
     246+++ transmission-2.00b1/libtransmission/tr-lpd.c        2010-05-24 16:39:03.000000000 -0500
    187247@@ -25,14 +25,22 @@
    188248 #include <stdio.h>
     
    293353         /* enable non-blocking operation */
    294354+#ifdef WIN32
    295 +       unsigned long flags= 1;
    296 +       if (ioctlsocket(lpd_socket, FIONBIO, &flags) == SOCKET_ERROR)
     355+       unsigned long flags= 1;
     356+       if (ioctlsocket(lpd_socket, FIONBIO, &flags) == SOCKET_ERROR)
    297357+#else
    298358         if( lpd_configureSocket( lpd_socket, O_NONBLOCK ) < 0 )
     
    306366         /* enable non-blocking operation */
    307367+#ifdef WIN32
    308 +       unsigned long flags= 1;
    309 +       if (ioctlsocket(lpd_socket, FIONBIO, &flags) == SOCKET_ERROR)
     368+       unsigned long flags= 1;
     369+       if (ioctlsocket(lpd_socket, FIONBIO, &flags) == SOCKET_ERROR)
    310370+#else
    311371         if( lpd_configureSocket( lpd_socket2, O_NONBLOCK ) < 0 )
     
    315375         /* configure outbound multicast TTL */
    316376diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/trevent.c transmission-2.00b1/libtransmission/trevent.c
    317 --- transmission-2.00b1-orig/libtransmission/trevent.c  2010-05-22 20:49:23.000000000 -0500
    318 +++ transmission-2.00b1/libtransmission/trevent.c       2010-05-24 12:46:36.000000000 -0500
     377--- transmission-2.00b1-orig/libtransmission/trevent.c  2010-05-22 20:49:23.000000000 -0500
     378+++ transmission-2.00b1/libtransmission/trevent.c       2010-05-24 12:46:36.000000000 -0500
    319379@@ -26,7 +26,7 @@
    320380 
     
    327387 pgpipe( int handles[2] )
    328388diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/utils.c transmission-2.00b1/libtransmission/utils.c
    329 --- transmission-2.00b1-orig/libtransmission/utils.c    2010-05-22 20:49:23.000000000 -0500
    330 +++ transmission-2.00b1/libtransmission/utils.c 2010-05-24 12:46:36.000000000 -0500
     389--- transmission-2.00b1-orig/libtransmission/utils.c    2010-05-22 20:49:23.000000000 -0500
     390+++ transmission-2.00b1/libtransmission/utils.c 2010-05-24 12:46:36.000000000 -0500
    331391@@ -34,6 +34,9 @@
    332392 #include <sys/types.h>
     
    352412     {
    353413diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/libtransmission/web.c transmission-2.00b1/libtransmission/web.c
    354 --- transmission-2.00b1-orig/libtransmission/web.c      2010-05-22 20:49:23.000000000 -0500
    355 +++ transmission-2.00b1/libtransmission/web.c   2010-05-24 12:46:36.000000000 -0500
     414--- transmission-2.00b1-orig/libtransmission/web.c      2010-05-22 20:49:23.000000000 -0500
     415+++ transmission-2.00b1/libtransmission/web.c   2010-05-24 12:46:36.000000000 -0500
    356416@@ -10,7 +10,9 @@
    357417  * $Id: web.c 10535 2010-04-28 00:32:43Z charles $
     
    365425 #include <event.h>
    366426diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/qt/app.cc transmission-2.00b1/qt/app.cc
    367 --- transmission-2.00b1-orig/qt/app.cc  2010-05-22 20:49:25.000000000 -0500
    368 +++ transmission-2.00b1/qt/app.cc       2010-05-26 12:10:07.000000000 -0500
     427--- transmission-2.00b1-orig/qt/app.cc  2010-05-22 20:49:25.000000000 -0500
     428+++ transmission-2.00b1/qt/app.cc       2010-05-26 12:10:07.000000000 -0500
    369429@@ -14,6 +14,9 @@
    370430 #include <ctime>
     
    378438 #include <QDBusMessage>
    379439diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/qt/dbus-adaptor.cc transmission-2.00b1/qt/dbus-adaptor.cc
    380 --- transmission-2.00b1-orig/qt/dbus-adaptor.cc 2010-05-22 20:49:25.000000000 -0500
    381 +++ transmission-2.00b1/qt/dbus-adaptor.cc      2010-05-26 12:17:26.000000000 -0500
     440--- transmission-2.00b1-orig/qt/dbus-adaptor.cc 2010-05-22 20:49:25.000000000 -0500
     441+++ transmission-2.00b1/qt/dbus-adaptor.cc      2010-05-26 12:17:26.000000000 -0500
    382442@@ -10,6 +10,10 @@
    383443  * $Id:$
     
    392452 
    393453diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/qt/dbus-adaptor.h transmission-2.00b1/qt/dbus-adaptor.h
    394 --- transmission-2.00b1-orig/qt/dbus-adaptor.h  2010-05-22 20:49:25.000000000 -0500
    395 +++ transmission-2.00b1/qt/dbus-adaptor.h       2010-05-26 12:13:23.000000000 -0500
     454--- transmission-2.00b1-orig/qt/dbus-adaptor.h  2010-05-22 20:49:25.000000000 -0500
     455+++ transmission-2.00b1/qt/dbus-adaptor.h       2010-05-26 12:13:23.000000000 -0500
    396456@@ -13,6 +13,10 @@
    397457 #ifndef QTR_DBUS_ADAPTOR_H
     
    406466 #include <QDBusAbstractAdaptor>
    407467diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/qt/qtr.pro transmission-2.00b1/qt/qtr.pro
    408 --- transmission-2.00b1-orig/qt/qtr.pro 2010-05-22 20:49:25.000000000 -0500
    409 +++ transmission-2.00b1/qt/qtr.pro      2010-05-27 12:57:14.000000000 -0500
     468--- transmission-2.00b1-orig/qt/qtr.pro 2010-05-22 20:49:25.000000000 -0500
     469+++ transmission-2.00b1/qt/qtr.pro      2010-05-27 12:57:14.000000000 -0500
    410470@@ -1,7 +1,7 @@
    411471 TARGET = qtr
     
    442502+win32:RC_FILE = qtr.rc
    443503diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/qt/qtr.rc transmission-2.00b1/qt/qtr.rc
    444 --- transmission-2.00b1-orig/qt/qtr.rc  1969-12-31 18:00:00.000000000 -0600
    445 +++ transmission-2.00b1/qt/qtr.rc       2010-05-24 12:46:36.000000000 -0500
     504--- transmission-2.00b1-orig/qt/qtr.rc  1969-12-31 18:00:00.000000000 -0600
     505+++ transmission-2.00b1/qt/qtr.rc       2010-05-24 12:46:36.000000000 -0500
    446506@@ -0,0 +1 @@
    447 +IDI_ICON1      ICON    DISCARDABLE "qtr.ico"
     507+IDI_ICON1      ICON    DISCARDABLE "qtr.ico"
     508diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/qt/session.cc transmission-2.00b1/qt/session.cc
     509--- transmission-2.00b1-orig/qt/session.cc      2010-05-22 20:49:25.000000000 -0500
     510+++ transmission-2.00b1/qt/session.cc   2010-06-01 16:49:14.000000000 -0500
     511@@ -142,6 +142,7 @@
     512         case Prefs :: DOWNLOAD_DIR:
     513         case Prefs :: DSPEED:
     514         case Prefs :: DSPEED_ENABLED:
     515+        case Prefs :: ENCRYPTION:
     516         case Prefs :: INCOMPLETE_DIR:
     517         case Prefs :: INCOMPLETE_DIR_ENABLED:
     518         case Prefs :: LPD_ENABLED:
    448519diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/qt/utils.cc transmission-2.00b1/qt/utils.cc
    449 --- transmission-2.00b1-orig/qt/utils.cc        2010-05-22 20:49:25.000000000 -0500
    450 +++ transmission-2.00b1/qt/utils.cc     2010-05-24 12:50:47.000000000 -0500
     520--- transmission-2.00b1-orig/qt/utils.cc        2010-05-22 20:49:25.000000000 -0500
     521+++ transmission-2.00b1/qt/utils.cc     2010-05-24 12:50:47.000000000 -0500
    451522@@ -56,12 +56,12 @@
    452523         else if( size < (int64_t)GIGABYTE_FACTOR )
     
    465536 
    466537diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00b1-orig/third-party/dht/dht.c transmission-2.00b1/third-party/dht/dht.c
    467 --- transmission-2.00b1-orig/third-party/dht/dht.c      2010-05-22 20:50:10.000000000 -0500
    468 +++ transmission-2.00b1/third-party/dht/dht.c   2010-05-24 12:46:36.000000000 -0500
     538--- transmission-2.00b1-orig/third-party/dht/dht.c      2010-05-22 20:50:10.000000000 -0500
     539+++ transmission-2.00b1/third-party/dht/dht.c   2010-05-24 12:46:36.000000000 -0500
    469540@@ -39,10 +39,18 @@
    470541 #include <unistd.h>
     
    479550+#define WINVER  WindowsXP       /* freeaddrinfo(),getaddrinfo(),getnameinfo() */
    480551+#include <ws2tcpip.h>
    481 +#define random rand            /* int rand() since no long random() */
     552+#define random rand            /* int rand() since no long random() */
    482553+const char *inet_ntop(int, const void *, char *, socklen_t);
    483554+#define EAFNOSUPPORT            WSAEAFNOSUPPORT
     
    508579         rc = fcntl(s, F_SETFL, (rc | O_NONBLOCK));
    509580+#else
    510 +       rc = ioctlsocket(s, FIONBIO, &flags);
     581+       rc = ioctlsocket(s, FIONBIO, &flags);
    511582+#endif
    512583         if(rc < 0)