am f149b4f0: Merge "opengl emulator: fix windows build"
* commit 'f149b4f0650c1a96eb13c6c0db2b493ac57c75aa': opengl emulator: fix windows build
This commit is contained in:
@@ -6,12 +6,12 @@ $(call emugl-import,libOpenglRender event_injector)
|
|||||||
LOCAL_SRC_FILES := main.cpp
|
LOCAL_SRC_FILES := main.cpp
|
||||||
|
|
||||||
PREBUILT := $(HOST_PREBUILT_TAG)
|
PREBUILT := $(HOST_PREBUILT_TAG)
|
||||||
SDL_CONFIG ?= prebuilt/$(PREBUILT)/sdl/bin/sdl-config
|
LOCAL_SDL_CONFIG ?= prebuilt/$(PREBUILT)/sdl/bin/sdl-config
|
||||||
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
|
LOCAL_SDL_CFLAGS := $(shell $(LOCAL_SDL_CONFIG) --cflags)
|
||||||
SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs))
|
LOCAL_SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(LOCAL_SDL_CONFIG) --static-libs))
|
||||||
|
|
||||||
LOCAL_CFLAGS += $(SDL_CFLAGS) -g -O0
|
LOCAL_CFLAGS += $(LOCAL_SDL_CFLAGS) -g -O0
|
||||||
LOCAL_LDLIBS += $(SDL_LDLIBS)
|
LOCAL_LDLIBS += $(LOCAL_SDL_LDLIBS)
|
||||||
|
|
||||||
ifeq ($(HOST_OS),windows)
|
ifeq ($(HOST_OS),windows)
|
||||||
LOCAL_LDLIBS += -lws2_32
|
LOCAL_LDLIBS += -lws2_32
|
||||||
|
|||||||
@@ -164,4 +164,3 @@ static int convert_keysym(int sym)
|
|||||||
}
|
}
|
||||||
return sym;
|
return sym;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# define xxWIN32_LEAN_AND_MEAN
|
# define xxWIN32_LEAN_AND_MEAN
|
||||||
|
# define _WIN32_WINNT 0x501
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <ws2tcpip.h>
|
# include <ws2tcpip.h>
|
||||||
@@ -171,9 +172,7 @@ _errno_str(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result == NULL) {
|
if (result == NULL) {
|
||||||
result = tempstr_format(
|
result = "Unknown socket error";
|
||||||
"Unkown socket error (Winsock=0x%08x) errno=%d: %s",
|
|
||||||
winsock_error, errno, strerror(errno));
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1227,25 +1226,6 @@ int socket_init(void)
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
static void
|
|
||||||
socket_close_handler( void* _fd )
|
|
||||||
{
|
|
||||||
int fd = (int)_fd;
|
|
||||||
int ret;
|
|
||||||
char buff[64];
|
|
||||||
|
|
||||||
/* we want to drain the read side of the socket before closing it */
|
|
||||||
do {
|
|
||||||
ret = recv( fd, buff, sizeof(buff), 0 );
|
|
||||||
} while (ret < 0 && WSAGetLastError() == WSAEINTR);
|
|
||||||
|
|
||||||
if (ret < 0 && WSAGetLastError() == EWOULDBLOCK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
qemu_set_fd_handler( fd, NULL, NULL, NULL );
|
|
||||||
closesocket( fd );
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
socket_close( int fd )
|
socket_close( int fd )
|
||||||
{
|
{
|
||||||
@@ -1253,7 +1233,8 @@ socket_close( int fd )
|
|||||||
|
|
||||||
shutdown( fd, SD_BOTH );
|
shutdown( fd, SD_BOTH );
|
||||||
/* we want to drain the socket before closing it */
|
/* we want to drain the socket before closing it */
|
||||||
qemu_set_fd_handler( fd, socket_close_handler, NULL, (void*)fd );
|
//qemu_set_fd_handler( fd, socket_close_handler, NULL, (void*)fd );
|
||||||
|
closesocket(fd);
|
||||||
|
|
||||||
errno = old_errno;
|
errno = old_errno;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user