From b75d6f1429edf41cd15772a8d9d3a96f84a21862 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Wed, 7 May 2014 20:21:11 +0800 Subject: [PATCH] Remove obsolete reference to ddk; Fixes for -Werror Bug: 14416410 1. The new mingw-w64 toolchain x86_64-w64-mingw32-4.8 has ddk in x86_64-w64-mingw32/include/ddk 2. Add -Wno-error=cpp to suppress a warning that turns into error thanks to -Werror: Please include winsock2.h before windows.h 3. Cast GetLastError() return type DWORD to "int" 4. Include direct.h for _mkdir 5. Include stdint.h for uint8_t on Windows Change-Id: I4bec0587f6573692f08c760da6c98ae551b8b5eb --- adb/Android.mk | 4 +--- adb/commandline.c | 1 + adb/sysdeps.h | 1 + adb/sysdeps_win32.c | 2 +- fastboot/Android.mk | 2 -- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/adb/Android.mk b/adb/Android.mk index 44c32151e..3643aa57b 100644 --- a/adb/Android.mk +++ b/adb/Android.mk @@ -39,13 +39,11 @@ ifeq ($(HOST_OS),windows) ifneq ($(strip $(USE_CYGWIN)),) # Pure cygwin case LOCAL_LDLIBS += -lpthread -lgdi32 - LOCAL_C_INCLUDES += /usr/include/w32api/ddk endif ifneq ($(strip $(USE_MINGW)),) # MinGW under Linux case LOCAL_LDLIBS += -lws2_32 -lgdi32 USE_SYSDEPS_WIN32 := 1 - LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk endif LOCAL_C_INCLUDES += development/host/windows/usb/api/ endif @@ -74,7 +72,7 @@ else LOCAL_SRC_FILES += fdevent.c endif -LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter -Werror +LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter -Wno-error=cpp -Werror LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE LOCAL_MODULE := adb LOCAL_MODULE_TAGS := debug diff --git a/adb/commandline.c b/adb/commandline.c index 51c039efc..05b4ef6fc 100644 --- a/adb/commandline.c +++ b/adb/commandline.c @@ -15,6 +15,7 @@ */ #include +#include #include #include #include diff --git a/adb/sysdeps.h b/adb/sysdeps.h index ba4306f8c..ac9415cd0 100644 --- a/adb/sysdeps.h +++ b/adb/sysdeps.h @@ -35,6 +35,7 @@ #include #include #include +#include #define OS_PATH_SEPARATOR '\\' #define OS_PATH_SEPARATOR_STR "\\" diff --git a/adb/sysdeps_win32.c b/adb/sysdeps_win32.c index 29f58ec08..19043252e 100644 --- a/adb/sysdeps_win32.c +++ b/adb/sysdeps_win32.c @@ -1549,7 +1549,7 @@ _wait_for_all(HANDLE* handles, int handles_count) * reset" event that will remain set once it was set. */ main_event = CreateEvent(NULL, TRUE, FALSE, NULL); if (main_event == NULL) { - D("Unable to create main event. Error: %d", GetLastError()); + D("Unable to create main event. Error: %d", (int)GetLastError()); free(threads); return (int)WAIT_FAILED; } diff --git a/fastboot/Android.mk b/fastboot/Android.mk index 252db6cb4..e11691fb8 100644 --- a/fastboot/Android.mk +++ b/fastboot/Android.mk @@ -40,13 +40,11 @@ ifeq ($(HOST_OS),windows) ifneq ($(strip $(USE_CYGWIN)),) # Pure cygwin case LOCAL_LDLIBS += -lpthread - LOCAL_C_INCLUDES += /usr/include/w32api/ddk endif ifneq ($(strip $(USE_MINGW)),) # MinGW under Linux case LOCAL_LDLIBS += -lws2_32 USE_SYSDEPS_WIN32 := 1 - LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk endif LOCAL_C_INCLUDES += development/host/windows/usb/api endif