diff --git a/desmume/src/gdbstub/gdbstub.cpp b/desmume/src/gdbstub/gdbstub.cpp index ef840ae21..775055373 100644 --- a/desmume/src/gdbstub/gdbstub.cpp +++ b/desmume/src/gdbstub/gdbstub.cpp @@ -1573,7 +1573,7 @@ createStub_gdb( uint16_t port, if ( temp_sock != -1) { /* create a thread to connect to this socket */ - temp_thread = CreateThread( NULL, 0, control_creator, &temp_data, 0, &temp_threadID); + temp_thread = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)control_creator, &temp_data, 0, &temp_threadID); if ( temp_thread != INVALID_HANDLE_VALUE) { struct sockaddr_in ignore_addr; int addr_size = sizeof( ignore_addr); diff --git a/desmume/src/gdbstub/gdbstub_internal.h b/desmume/src/gdbstub/gdbstub_internal.h index 4714cce9f..eec711c68 100644 --- a/desmume/src/gdbstub/gdbstub_internal.h +++ b/desmume/src/gdbstub/gdbstub_internal.h @@ -25,13 +25,17 @@ #ifndef _GDBSTUB_INTERNAL_H_ #define _GDBSTUB_INTERNAL_H_ 1 -#ifdef WIN32 - typedef __int32 int32_t; - typedef unsigned __int32 uint32_t; - typedef __int16 int16_t; - typedef unsigned __int16 uint16_t; - typedef __int8 int8_t; - typedef unsigned __int8 uint8_t; +#if defined(_MSC_VER) + #if _MSC_VER < 1900 + typedef __int32 int32_t; + typedef unsigned __int32 uint32_t; + typedef __int16 int16_t; + typedef unsigned __int16 uint16_t; + typedef __int8 int8_t; + typedef unsigned __int8 uint8_t; + #else + #include + #endif #include #define SOCKET_TYPE SOCKET diff --git a/desmume/src/types.h b/desmume/src/types.h index 9b4838c67..1bf1075d6 100644 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -95,11 +95,14 @@ #endif #ifdef _MSC_VER -#define strcasecmp(x,y) _stricmp(x,y) -#define strncasecmp(x, y, l) strnicmp(x, y, l) -#define snprintf _snprintf + #define strcasecmp(x,y) _stricmp(x,y) + #define strncasecmp(x, y, l) strnicmp(x, y, l) + + #if _MSC_VER < 1900 + #define snprintf _snprintf + #endif #else -#define WINAPI + #define WINAPI #endif #if !defined(MAX_PATH)