Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

fuse.spectranet_win32_01.diff

By: sbaldovi on Jun 18th, 2011  |  syntax: Diff  |  size: 3.38 KB  |  views: 83  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Index: peripherals/nic/w5100_internals.h
  2. ===================================================================
  3. --- peripherals/nic/w5100_internals.h   (revision 4490)
  4. +++ peripherals/nic/w5100_internals.h   (working copy)
  5. @@ -29,6 +29,10 @@
  6.  #ifndef FUSE_W5100_INTERNALS_H
  7.  #define FUSE_W5100_INTERNALS_H
  8.  
  9. +#ifdef WIN32
  10. +#include <signal.h>
  11. +#endif                         /* #ifdef WIN32 */
  12. +
  13.  typedef enum w5100_socket_mode {
  14.    W5100_SOCKET_MODE_CLOSED = 0x00,
  15.    W5100_SOCKET_MODE_TCP,
  16. Index: peripherals/nic/w5100_socket.c
  17. ===================================================================
  18. --- peripherals/nic/w5100_socket.c      (revision 4490)
  19. +++ peripherals/nic/w5100_socket.c      (working copy)
  20. @@ -29,12 +29,17 @@
  21.  #include "config.h"
  22.  
  23.  #include <errno.h>
  24. -#include <netinet/in.h>
  25.  #include <pthread.h>
  26. -#include <sys/socket.h>
  27.  #include <sys/types.h>
  28.  #include <unistd.h>
  29.  
  30. +#ifdef WIN32
  31. +#include <Winsock2.h>
  32. +#else
  33. +#include <netinet/in.h>
  34. +#include <sys/socket.h>
  35. +#endif                         /* #ifdef WIN32 */
  36. +
  37.  #include "fuse.h"
  38.  #include "ui/ui.h"
  39.  #include "w5100.h"
  40. @@ -403,7 +408,7 @@
  41.    sa.sin_family = AF_INET;
  42.    memcpy( &sa.sin_port, socket->port, 2 );
  43.    sa.sin_addr.s_addr = htonl(INADDR_ANY);
  44. -  bytes_read = recvfrom( socket->fd, buffer + 8, bytes_free - 8, 0, (struct sockaddr*)&sa, &sa_length );
  45. +  bytes_read = recvfrom( socket->fd, (char *)buffer + 8, bytes_free - 8, 0, (struct sockaddr*)&sa, &sa_length );
  46.    printf("w5100: read 0x%03x bytes from socket %d\n", (int)bytes_read, socket->id);
  47.  
  48.    if( bytes_read != -1 ) {
  49. @@ -454,7 +459,7 @@
  50.    memcpy( &sa.sin_port, socket->dport, 2 );
  51.    memcpy( &sa.sin_addr.s_addr, socket->dip, 4 );
  52.  
  53. -  bytes_sent = sendto( socket->fd, data, length, 0, (struct sockaddr*)&sa, sizeof(sa) );
  54. +  bytes_sent = sendto( socket->fd, (const char *)data, length, 0, (struct sockaddr*)&sa, sizeof(sa) );
  55.    printf("w5100: sent 0x%03x bytes of %d to socket %d\n", (int)bytes_sent, length, socket->id);
  56.  
  57.    if( bytes_sent != -1 ) {
  58. Index: peripherals/nic/w5100.c
  59. ===================================================================
  60. --- peripherals/nic/w5100.c     (revision 4490)
  61. +++ peripherals/nic/w5100.c     (working copy)
  62. @@ -29,17 +29,27 @@
  63.  #include "config.h"
  64.  
  65.  #include <errno.h>
  66. -#include <netinet/in.h>
  67.  #include <pthread.h>
  68. -#include <sys/socket.h>
  69.  #include <sys/types.h>
  70.  #include <unistd.h>
  71.  
  72. +#ifdef WIN32
  73. +#include <fcntl.h>
  74. +#include <Winsock2.h>
  75. +#else
  76. +#include <netinet/in.h>
  77. +#include <sys/socket.h>
  78. +#endif                         /* #ifdef WIN32 */
  79. +
  80.  #include "fuse.h"
  81.  #include "ui/ui.h"
  82.  #include "w5100.h"
  83.  #include "w5100_internals.h"
  84.  
  85. +#ifdef WIN32
  86. +#define pipe( fds ) _pipe( fds, 4096, _O_BINARY )
  87. +#endif                         /* #ifdef WIN32 */
  88. +
  89.  enum w5100_registers {
  90.    W5100_MR = 0x000,
  91.  
  92. Index: configure.in
  93. ===================================================================
  94. --- configure.in        (revision 4490)
  95. +++ configure.in        (working copy)
  96. @@ -110,7 +110,7 @@
  97.  AC_MSG_RESULT($win32)
  98.  if test "$win32" = yes; then
  99.    AC_CHECK_HEADER(windows.h,
  100. -                  LIBS="$LIBS -mwindows -lcomctl32 -lwinmm";
  101. +                  LIBS="$LIBS -mwindows -lcomctl32 -lwinmm -lpthread";
  102.                    AC_DEFINE([UI_WIN32], 1, [Defined if Win32 UI in use])
  103.                    AC_DEFINE([WINVER], 0x0400, [Minimal supported version of Windows is 95 or NT4])
  104.                    AC_DEFINE([_WIN32_IE], 0x400, [Internet Explorer is 4.0 or higher is required])
clone this paste RAW Paste Data