mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
remove the winsock2 dependency
I guess it should work on linux now
This commit is contained in:
parent
c3e9f64bc2
commit
41a731967f
@ -103,7 +103,12 @@ else
|
|||||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LDFLAGS += $(LIBM) -lws2_32
|
|
||||||
|
LDFLAGS += $(LIBM)
|
||||||
|
|
||||||
|
ifeq ($(platform), win)
|
||||||
|
LDFLAGS += -lws2_32
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -O0 -g
|
CFLAGS += -O0 -g
|
||||||
@ -111,7 +116,7 @@ else
|
|||||||
CFLAGS += -O3
|
CFLAGS += -O3
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OBJECTS := retropad.o
|
OBJECTS := ../../libretro-common/net/net_compat.o ../../libretro-common/net/net_socket.o retropad.o
|
||||||
CFLAGS += -I../../libretro-common/include -Wall -pedantic $(fpic)
|
CFLAGS += -I../../libretro-common/include -Wall -pedantic $(fpic)
|
||||||
|
|
||||||
ifneq (,$(findstring qnx,$(platform)))
|
ifneq (,$(findstring qnx,$(platform)))
|
||||||
|
@ -35,9 +35,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <winsock2.h>
|
#include <net/net_compat.h>
|
||||||
#include <windows.h>
|
#include <net/net_socket.h>
|
||||||
#include <ws2tcpip.h>
|
|
||||||
|
|
||||||
#include <retro_miscellaneous.h>
|
#include <retro_miscellaneous.h>
|
||||||
|
|
||||||
@ -51,7 +50,6 @@ int s, slen=sizeof(si_other);
|
|||||||
char message[64];
|
char message[64];
|
||||||
char server[64];
|
char server[64];
|
||||||
int port;
|
int port;
|
||||||
WSADATA wsa;
|
|
||||||
int input_state = 0;
|
int input_state = 0;
|
||||||
|
|
||||||
void retro_init(void)
|
void retro_init(void)
|
||||||
@ -59,11 +57,7 @@ void retro_init(void)
|
|||||||
frame_buf = (uint16_t*)calloc(320 * 240, sizeof(uint16_t));
|
frame_buf = (uint16_t*)calloc(320 * 240, sizeof(uint16_t));
|
||||||
//Initialise winsock
|
//Initialise winsock
|
||||||
log_cb(RETRO_LOG_INFO, "Initialising sockets\n");
|
log_cb(RETRO_LOG_INFO, "Initialising sockets\n");
|
||||||
if (WSAStartup(MAKEWORD(2,2),&wsa) != 0)
|
network_init();
|
||||||
{
|
|
||||||
log_cb(RETRO_LOG_INFO, "Failed. Error Code : %d",WSAGetLastError());
|
|
||||||
}
|
|
||||||
log_cb(RETRO_LOG_INFO, "Sockets initialised.\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void retro_deinit(void)
|
void retro_deinit(void)
|
||||||
@ -245,14 +239,14 @@ bool retro_load_game(const struct retro_game_info *info)
|
|||||||
//create socket
|
//create socket
|
||||||
if ( (s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == SOCKET_ERROR)
|
if ( (s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == SOCKET_ERROR)
|
||||||
{
|
{
|
||||||
log_cb(RETRO_LOG_INFO, "socket() failed with error code : %d" , WSAGetLastError());
|
log_cb(RETRO_LOG_INFO, "socket failed");
|
||||||
}
|
}
|
||||||
//setup address structure
|
//setup address structure
|
||||||
memset((char *) &si_other, 0, sizeof(si_other));
|
memset((char *) &si_other, 0, sizeof(si_other));
|
||||||
si_other.sin_family = AF_INET;
|
si_other.sin_family = AF_INET;
|
||||||
si_other.sin_port = htons(port);
|
si_other.sin_port = htons(port);
|
||||||
si_other.sin_addr.S_un.S_addr = inet_addr(server);
|
si_other.sin_addr.S_un.S_addr = inet_addr(server);
|
||||||
log_cb(RETRO_LOG_INFO, "Server : %s" , server);
|
log_cb(RETRO_LOG_INFO, "Server IP Address: %s\n" , server);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user