aboutsummaryrefslogtreecommitdiffstats
path: root/osdep.c
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2012-05-02 13:24:28 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2012-05-02 15:08:55 +0800
commit7f661af7cfca4b7857d30d598923dd2095f78ff0 (patch)
tree8bbc848a5e89cdb395ff140762c1f8f62bf77704 /osdep.c
parent509433edf704644190bc6715adcb1272a1955da3 (diff)
downloadexternal_qemu-7f661af7cfca4b7857d30d598923dd2095f78ff0.zip
external_qemu-7f661af7cfca4b7857d30d598923dd2095f78ff0.tar.gz
external_qemu-7f661af7cfca4b7857d30d598923dd2095f78ff0.tar.bz2
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 <windows.h>" 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
Diffstat (limited to 'osdep.c')
-rw-r--r--osdep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/osdep.c b/osdep.c
index 6c402d9..a5efe92 100644
--- a/osdep.c
+++ b/osdep.c
@@ -186,10 +186,10 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
}
#ifdef WIN32
-int asprintf( char **, char *, ... );
-int vasprintf( char **, char *, va_list );
+int asprintf( char **, const char *, ... );
+int vasprintf( char **, const char *, va_list );
-int vasprintf( char **sptr, char *fmt, va_list argv )
+int vasprintf( char **sptr, const char *fmt, va_list argv )
{
int wanted = vsnprintf( *sptr = NULL, 0, fmt, argv );
if( (wanted > 0) && ((*sptr = malloc( 1 + wanted )) != NULL) )
@@ -198,7 +198,7 @@ int vasprintf( char **sptr, char *fmt, va_list argv )
return wanted;
}
-int asprintf( char **sptr, char *fmt, ... )
+int asprintf( char **sptr, const char *fmt, ... )
{
int retval;
va_list argv;