From 7f661af7cfca4b7857d30d598923dd2095f78ff0 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Wed, 2 May 2012 13:24:28 +0800 Subject: Fixed compilation error with new x86_64-w64-mingw32 compiler Fixed the following for the new compiler 1. android/camera/camera-capture-windows.c: Added "#include " 2. SetClassLong() is deprecated. GCL_HICON doesn't exist in _WIN64. Replacted it with SetClassLongPtr(h, GCLP_HICON, icon) 3. [v]asprintf now actually exisit in libray. Changed the prototype to match the standard ones but will remove them later for GCC 4.5 and up. 4. Renamed _set_errno to set_errno because it exists in stdlib.h. Renamed _fix_errno to fix_errno for consistency. 5. EAI_NODATA and EAI_NONAME become the same things. 6. ddk/*h don't exisit. tap-win32.c actually only needs winioctl.h which provide constants. I have make sure they got the same constants in both old and new mingw compilers 7. #undef DELETE before redefining it for KEY_CODE in hw-events.h because DELETE is defined to be a constant in standard header. The above don't break the old one (ie. /usr/bin/i586-mingw32msvc-*) Change-Id: Ic7d13fd0fd237d433f923ee01c6ce50f5c02f095 --- android/camera/camera-capture-windows.c | 1 + android/hw-events.h | 11 +++++++++++ android/main-common.c | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'android') diff --git a/android/camera/camera-capture-windows.c b/android/camera/camera-capture-windows.c index e1c5538..7f9df39 100755 --- a/android/camera/camera-capture-windows.c +++ b/android/camera/camera-capture-windows.c @@ -19,6 +19,7 @@ * This code uses capXxx API, available via capCreateCaptureWindow. */ +#include #include #include "android/camera/camera-capture.h" #include "android/camera/camera-format-converters.h" diff --git a/android/hw-events.h b/android/hw-events.h index 488c299..b8340bd 100644 --- a/android/hw-events.h +++ b/android/hw-events.h @@ -41,6 +41,17 @@ typedef enum { /* BEWARE: The following codes are defined by the Linux kernel headers. * The Android "Menu" key is KEY_SOFT1, *not* KEY_MENU */ +/* NOTE: mingw's winnt.h define DELETE to constant + i586-mingw32msvc: #define DELETE 0x00010000L + x86_64-w64-mingw32-gcc: #define DELETE (0x00010000L) + + KEY_CODE belows glues "KEY_" and "DELETE". + While KEY_0x00010000L may not mean anything, + KEY_(0x00010000L) is absolutely harmful to compiler. + Undefine DELETE below + */ +#undef DELETE + #define EVENT_KEY_LIST \ KEY_CODE(ESC ,1) \ KEY_CODE(1 ,2) \ diff --git a/android/main-common.c b/android/main-common.c index 04d200a..2d535c7 100644 --- a/android/main-common.c +++ b/android/main-common.c @@ -232,7 +232,7 @@ sdl_set_window_icon( void ) SDL_GetWMInfo(&wminfo); - SetClassLong( wminfo.window, GCL_HICON, (LONG)icon ); + SetClassLongPtr( wminfo.window, GCLP_HICON, (LONG)icon ); #else /* !_WIN32 */ unsigned icon_w, icon_h; size_t icon_bytes; -- cgit v1.1