Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: peripherals/nic/w5100_internals.h
- ===================================================================
- --- peripherals/nic/w5100_internals.h (revision 4490)
- +++ peripherals/nic/w5100_internals.h (working copy)
- @@ -29,6 +29,10 @@
- #ifndef FUSE_W5100_INTERNALS_H
- #define FUSE_W5100_INTERNALS_H
- +#ifdef WIN32
- +#include <signal.h>
- +#endif /* #ifdef WIN32 */
- +
- typedef enum w5100_socket_mode {
- W5100_SOCKET_MODE_CLOSED = 0x00,
- W5100_SOCKET_MODE_TCP,
- Index: peripherals/nic/w5100_socket.c
- ===================================================================
- --- peripherals/nic/w5100_socket.c (revision 4490)
- +++ peripherals/nic/w5100_socket.c (working copy)
- @@ -29,12 +29,17 @@
- #include "config.h"
- #include <errno.h>
- -#include <netinet/in.h>
- #include <pthread.h>
- -#include <sys/socket.h>
- #include <sys/types.h>
- #include <unistd.h>
- +#ifdef WIN32
- +#include <Winsock2.h>
- +#else
- +#include <netinet/in.h>
- +#include <sys/socket.h>
- +#endif /* #ifdef WIN32 */
- +
- #include "fuse.h"
- #include "ui/ui.h"
- #include "w5100.h"
- @@ -403,7 +408,7 @@
- sa.sin_family = AF_INET;
- memcpy( &sa.sin_port, socket->port, 2 );
- sa.sin_addr.s_addr = htonl(INADDR_ANY);
- - bytes_read = recvfrom( socket->fd, buffer + 8, bytes_free - 8, 0, (struct sockaddr*)&sa, &sa_length );
- + bytes_read = recvfrom( socket->fd, (char *)buffer + 8, bytes_free - 8, 0, (struct sockaddr*)&sa, &sa_length );
- printf("w5100: read 0x%03x bytes from socket %d\n", (int)bytes_read, socket->id);
- if( bytes_read != -1 ) {
- @@ -454,7 +459,7 @@
- memcpy( &sa.sin_port, socket->dport, 2 );
- memcpy( &sa.sin_addr.s_addr, socket->dip, 4 );
- - bytes_sent = sendto( socket->fd, data, length, 0, (struct sockaddr*)&sa, sizeof(sa) );
- + bytes_sent = sendto( socket->fd, (const char *)data, length, 0, (struct sockaddr*)&sa, sizeof(sa) );
- printf("w5100: sent 0x%03x bytes of %d to socket %d\n", (int)bytes_sent, length, socket->id);
- if( bytes_sent != -1 ) {
- Index: peripherals/nic/w5100.c
- ===================================================================
- --- peripherals/nic/w5100.c (revision 4490)
- +++ peripherals/nic/w5100.c (working copy)
- @@ -29,17 +29,27 @@
- #include "config.h"
- #include <errno.h>
- -#include <netinet/in.h>
- #include <pthread.h>
- -#include <sys/socket.h>
- #include <sys/types.h>
- #include <unistd.h>
- +#ifdef WIN32
- +#include <fcntl.h>
- +#include <Winsock2.h>
- +#else
- +#include <netinet/in.h>
- +#include <sys/socket.h>
- +#endif /* #ifdef WIN32 */
- +
- #include "fuse.h"
- #include "ui/ui.h"
- #include "w5100.h"
- #include "w5100_internals.h"
- +#ifdef WIN32
- +#define pipe( fds ) _pipe( fds, 4096, _O_BINARY )
- +#endif /* #ifdef WIN32 */
- +
- enum w5100_registers {
- W5100_MR = 0x000,
- Index: configure.in
- ===================================================================
- --- configure.in (revision 4490)
- +++ configure.in (working copy)
- @@ -110,7 +110,7 @@
- AC_MSG_RESULT($win32)
- if test "$win32" = yes; then
- AC_CHECK_HEADER(windows.h,
- - LIBS="$LIBS -mwindows -lcomctl32 -lwinmm";
- + LIBS="$LIBS -mwindows -lcomctl32 -lwinmm -lpthread";
- AC_DEFINE([UI_WIN32], 1, [Defined if Win32 UI in use])
- AC_DEFINE([WINVER], 0x0400, [Minimal supported version of Windows is 95 or NT4])
- AC_DEFINE([_WIN32_IE], 0x400, [Internet Explorer is 4.0 or higher is required])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement