From 363f4907a563095ac4a7d633260bb7c3d7c50834 Mon Sep 17 00:00:00 2001 From: Wengier Date: Tue, 22 Jun 2021 15:41:37 -0400 Subject: [PATCH] fix for HX build --- vs2015/sdl/include/SDL_platform.h | 2 ++ vs2015/sdl/include/SDL_syswm.h | 2 ++ vs2015/sdl/src/video/wincommon/SDL_lowvideo.h | 2 ++ vs2015/sdl/src/video/wincommon/SDL_sysevents.c | 2 ++ vs2015/sdl/src/video/wincommon/SDL_syswm.c | 2 ++ vs2015/sdl/src/video/wincommon/SDL_syswm_c.h | 3 ++- vs2015/sdl/src/video/windib/SDL_dibvideo.c | 2 ++ vs2015/sdl/src/video/windx5/SDL_dx5video.c | 2 ++ 8 files changed, 16 insertions(+), 1 deletion(-) diff --git a/vs2015/sdl/include/SDL_platform.h b/vs2015/sdl/include/SDL_platform.h index a97b6d44c..87b3620fe 100644 --- a/vs2015/sdl/include/SDL_platform.h +++ b/vs2015/sdl/include/SDL_platform.h @@ -105,7 +105,9 @@ #if defined(WIN32) || defined(_WIN32) #undef __WIN32__ #define __WIN32__ 1 +#if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) #define ENABLE_IM_EVENT 1 #endif +#endif #endif /* _SDL_platform_h */ diff --git a/vs2015/sdl/include/SDL_syswm.h b/vs2015/sdl/include/SDL_syswm.h index 831b3af05..ac4c93738 100644 --- a/vs2015/sdl/include/SDL_syswm.h +++ b/vs2015/sdl/include/SDL_syswm.h @@ -159,6 +159,7 @@ typedef struct SDL_SysWMinfo { HGLRC hglrc; /**< The OpenGL context, if any */ } SDL_SysWMinfo; +#if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) /* The windows custom input method information structure */ typedef struct SDL_SysIMinfo { SDL_version version; @@ -171,6 +172,7 @@ typedef struct SDL_SysIMinfo { } win; } info; } SDL_SysIMinfo; +#endif #elif defined(SDL_VIDEO_DRIVER_RISCOS) diff --git a/vs2015/sdl/src/video/wincommon/SDL_lowvideo.h b/vs2015/sdl/src/video/wincommon/SDL_lowvideo.h index feb4ba2e9..60a5d1aa4 100644 --- a/vs2015/sdl/src/video/wincommon/SDL_lowvideo.h +++ b/vs2015/sdl/src/video/wincommon/SDL_lowvideo.h @@ -88,6 +88,7 @@ extern HINSTANCE SDL_Instance; extern HWND SDL_Window; extern BOOL SDL_windowid; +#if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) typedef struct { HIMC SDL_IMC; union { @@ -107,6 +108,7 @@ typedef struct { } _IM_Context; extern _IM_Context IM_Context; +#endif /* Variables and functions exported to other parts of the native video subsystem (SDL_sysevents.c) diff --git a/vs2015/sdl/src/video/wincommon/SDL_sysevents.c b/vs2015/sdl/src/video/wincommon/SDL_sysevents.c index 552e8a0e9..32851c370 100644 --- a/vs2015/sdl/src/video/wincommon/SDL_sysevents.c +++ b/vs2015/sdl/src/video/wincommon/SDL_sysevents.c @@ -96,7 +96,9 @@ DEVMODE SDL_fullscreen_mode; #endif WORD *gamma_saved = NULL; +#if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) _IM_Context IM_Context; /* patched */ +#endif /* Functions called by the message processing function */ LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL; diff --git a/vs2015/sdl/src/video/wincommon/SDL_syswm.c b/vs2015/sdl/src/video/wincommon/SDL_syswm.c index 6f86a106c..ef79506ea 100644 --- a/vs2015/sdl/src/video/wincommon/SDL_syswm.c +++ b/vs2015/sdl/src/video/wincommon/SDL_syswm.c @@ -305,6 +305,7 @@ int WIN_GetWMInfo(_THIS, SDL_SysWMinfo *info) } } +#if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) int WIN_GetIMInfo(_THIS, SDL_SysIMinfo *info) { if ( info->version.major <= SDL_MAJOR_VERSION ) { @@ -331,3 +332,4 @@ int WIN_GetIMInfo(_THIS, SDL_SysIMinfo *info) return(-1); } } +#endif diff --git a/vs2015/sdl/src/video/wincommon/SDL_syswm_c.h b/vs2015/sdl/src/video/wincommon/SDL_syswm_c.h index 44567e027..ae91f5c1b 100644 --- a/vs2015/sdl/src/video/wincommon/SDL_syswm_c.h +++ b/vs2015/sdl/src/video/wincommon/SDL_syswm_c.h @@ -32,6 +32,7 @@ extern void WIN_SetWMCaption(_THIS, const char *title, const char *icon); extern int WIN_IconifyWindow(_THIS); extern SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode); extern int WIN_GetWMInfo(_THIS, SDL_SysWMinfo *info); - +#if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) /* Functions to IM */ extern int WIN_GetIMInfo(_THIS, SDL_SysIMinfo *info); +#endif diff --git a/vs2015/sdl/src/video/windib/SDL_dibvideo.c b/vs2015/sdl/src/video/windib/SDL_dibvideo.c index a81932f11..b2532997d 100644 --- a/vs2015/sdl/src/video/windib/SDL_dibvideo.c +++ b/vs2015/sdl/src/video/windib/SDL_dibvideo.c @@ -237,7 +237,9 @@ static SDL_VideoDevice *DIB_CreateDevice(int devindex) device->SetIMValues = DIB_SetIMValues; device->GetIMValues = DIB_GetIMValues; device->FlushIMString = DIB_FlushIMString; +#if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) device->GetIMInfo = WIN_GetIMInfo; +#endif device->free = DIB_DeleteDevice; /* We're finally ready */ diff --git a/vs2015/sdl/src/video/windx5/SDL_dx5video.c b/vs2015/sdl/src/video/windx5/SDL_dx5video.c index 34cfac1e0..7daa176dd 100644 --- a/vs2015/sdl/src/video/windx5/SDL_dx5video.c +++ b/vs2015/sdl/src/video/windx5/SDL_dx5video.c @@ -722,7 +722,9 @@ static SDL_VideoDevice *DX5_CreateDevice(int devindex) device->SetIMValues = DX5_SetIMValues; device->GetIMValues = DX5_GetIMValues; device->FlushIMString = DX5_FlushIMString; +#if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) device->GetIMInfo = WIN_GetIMInfo; +#endif device->free = DX5_DeleteDevice; /* We're finally ready */