am f149b4f0: Merge "opengl emulator: fix windows build"

* commit 'f149b4f0650c1a96eb13c6c0db2b493ac57c75aa':
  opengl emulator: fix windows build
This commit is contained in:
David Turner
2011-08-13 16:10:51 -07:00
committed by Android Git Automerger
3 changed files with 9 additions and 29 deletions

View File

@@ -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

View File

@@ -164,4 +164,3 @@ static int convert_keysym(int sym)
}
return sym;
}

View File

@@ -33,6 +33,7 @@
#ifdef _WIN32
# define xxWIN32_LEAN_AND_MEAN
# define _WIN32_WINNT 0x501
# include <windows.h>
# include <winsock2.h>
# include <ws2tcpip.h>
@@ -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;
}