diff --git a/tools/emulator/opengl/tests/emulator_test_renderer/Android.mk b/tools/emulator/opengl/tests/emulator_test_renderer/Android.mk index 12a09f128..52a1c8e97 100644 --- a/tools/emulator/opengl/tests/emulator_test_renderer/Android.mk +++ b/tools/emulator/opengl/tests/emulator_test_renderer/Android.mk @@ -6,12 +6,12 @@ $(call emugl-import,libOpenglRender event_injector) LOCAL_SRC_FILES := main.cpp PREBUILT := $(HOST_PREBUILT_TAG) -SDL_CONFIG ?= prebuilt/$(PREBUILT)/sdl/bin/sdl-config -SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) -SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs)) +LOCAL_SDL_CONFIG ?= prebuilt/$(PREBUILT)/sdl/bin/sdl-config +LOCAL_SDL_CFLAGS := $(shell $(LOCAL_SDL_CONFIG) --cflags) +LOCAL_SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(LOCAL_SDL_CONFIG) --static-libs)) -LOCAL_CFLAGS += $(SDL_CFLAGS) -g -O0 -LOCAL_LDLIBS += $(SDL_LDLIBS) +LOCAL_CFLAGS += $(LOCAL_SDL_CFLAGS) -g -O0 +LOCAL_LDLIBS += $(LOCAL_SDL_LDLIBS) ifeq ($(HOST_OS),windows) LOCAL_LDLIBS += -lws2_32 diff --git a/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp b/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp index c0b553502..7eb3d0424 100644 --- a/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp +++ b/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp @@ -164,4 +164,3 @@ static int convert_keysym(int sym) } return sym; } - diff --git a/tools/emulator/opengl/tests/event_injector/sockets.c b/tools/emulator/opengl/tests/event_injector/sockets.c index 93dde3012..a2cc334a5 100644 --- a/tools/emulator/opengl/tests/event_injector/sockets.c +++ b/tools/emulator/opengl/tests/event_injector/sockets.c @@ -33,6 +33,7 @@ #ifdef _WIN32 # define xxWIN32_LEAN_AND_MEAN +# define _WIN32_WINNT 0x501 # include # include # include @@ -171,9 +172,7 @@ _errno_str(void) } if (result == NULL) { - result = tempstr_format( - "Unkown socket error (Winsock=0x%08x) errno=%d: %s", - winsock_error, errno, strerror(errno)); + result = "Unknown socket error"; } return result; } @@ -1227,25 +1226,6 @@ int socket_init(void) #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 socket_close( int fd ) { @@ -1253,7 +1233,8 @@ socket_close( int fd ) shutdown( fd, SD_BOTH ); /* 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; }