Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h
authorSam Lantinga <slouken@libsdl.org>
Mon, 28 Aug 2017 00:43:14 -0700
changeset 113836cafb5954aaf
parent 11382 2c50e79b19e0
child 11384 269bdd5aa742
Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h
src/events/SDL_events.c
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/SDL_vulkan_internal.h
src/video/android/SDL_androidvideo.c
src/video/cocoa/SDL_cocoavideo.m
src/video/directfb/SDL_DirectFB_video.c
src/video/emscripten/SDL_emscriptenvideo.c
src/video/haiku/SDL_bvideo.cc
src/video/kmsdrm/SDL_kmsdrmvideo.c
src/video/mir/SDL_mirvideo.c
src/video/nacl/SDL_naclvideo.c
src/video/pandora/SDL_pandora.c
src/video/psp/SDL_pspvideo.c
src/video/qnx/video.c
src/video/raspberry/SDL_rpivideo.c
src/video/uikit/SDL_uikitvideo.m
src/video/vivante/SDL_vivantevideo.c
src/video/wayland/SDL_waylandvideo.c
src/video/windows/SDL_windowsvideo.c
src/video/winrt/SDL_winrtvideo.cpp
src/video/x11/SDL_x11video.c
     1.1 --- a/src/events/SDL_events.c	Mon Aug 28 00:22:23 2017 -0700
     1.2 +++ b/src/events/SDL_events.c	Mon Aug 28 00:43:14 2017 -0700
     1.3 @@ -24,7 +24,6 @@
     1.4  
     1.5  #include "SDL.h"
     1.6  #include "SDL_events.h"
     1.7 -#include "SDL_syswm.h"
     1.8  #include "SDL_thread.h"
     1.9  #include "SDL_events_c.h"
    1.10  #include "../timer/SDL_timer_c.h"
    1.11 @@ -32,6 +31,7 @@
    1.12  #include "../joystick/SDL_joystick_c.h"
    1.13  #endif
    1.14  #include "../video/SDL_sysvideo.h"
    1.15 +#include "SDL_syswm.h"
    1.16  
    1.17  /*#define SDL_DEBUG_EVENTS 1*/
    1.18  
     2.1 --- a/src/video/SDL_sysvideo.h	Mon Aug 28 00:22:23 2017 -0700
     2.2 +++ b/src/video/SDL_sysvideo.h	Mon Aug 28 00:43:14 2017 -0700
     2.3 @@ -207,8 +207,8 @@
     2.4      /*
     2.5       * Window functions
     2.6       */
     2.7 -    int (*CreateWindow) (_THIS, SDL_Window * window);
     2.8 -    int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data);
     2.9 +    int (*CreateSDLWindow) (_THIS, SDL_Window * window);
    2.10 +    int (*CreateSDLWindowFrom) (_THIS, SDL_Window * window, const void *data);
    2.11      void (*SetWindowTitle) (_THIS, SDL_Window * window);
    2.12      void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon);
    2.13      void (*SetWindowPosition) (_THIS, SDL_Window * window);
     3.1 --- a/src/video/SDL_video.c	Mon Aug 28 00:22:23 2017 -0700
     3.2 +++ b/src/video/SDL_video.c	Mon Aug 28 00:43:14 2017 -0700
     3.3 @@ -52,11 +52,6 @@
     3.4  #endif
     3.5  #endif
     3.6  
     3.7 -/* On Windows, windows.h defines CreateWindow */
     3.8 -#ifdef CreateWindow
     3.9 -#undef CreateWindow
    3.10 -#endif
    3.11 -
    3.12  #ifdef __EMSCRIPTEN__
    3.13  #include <emscripten.h>
    3.14  #endif
    3.15 @@ -1479,7 +1474,7 @@
    3.16      }
    3.17      _this->windows = window;
    3.18  
    3.19 -    if (_this->CreateWindow && _this->CreateWindow(_this, window) < 0) {
    3.20 +    if (_this->CreateSDLWindow && _this->CreateSDLWindow(_this, window) < 0) {
    3.21          SDL_DestroyWindow(window);
    3.22          return NULL;
    3.23      }
    3.24 @@ -1516,7 +1511,7 @@
    3.25          SDL_UninitializedVideo();
    3.26          return NULL;
    3.27      }
    3.28 -    if (!_this->CreateWindowFrom) {
    3.29 +    if (!_this->CreateSDLWindowFrom) {
    3.30          SDL_Unsupported();
    3.31          return NULL;
    3.32      }
    3.33 @@ -1538,7 +1533,7 @@
    3.34      }
    3.35      _this->windows = window;
    3.36  
    3.37 -    if (_this->CreateWindowFrom(_this, window, data) < 0) {
    3.38 +    if (_this->CreateSDLWindowFrom(_this, window, data) < 0) {
    3.39          SDL_DestroyWindow(window);
    3.40          return NULL;
    3.41      }
    3.42 @@ -1602,8 +1597,8 @@
    3.43      window->last_fullscreen_flags = window->flags;
    3.44      window->is_destroying = SDL_FALSE;
    3.45  
    3.46 -    if (_this->CreateWindow && !(flags & SDL_WINDOW_FOREIGN)) {
    3.47 -        if (_this->CreateWindow(_this, window) < 0) {
    3.48 +    if (_this->CreateSDLWindow && !(flags & SDL_WINDOW_FOREIGN)) {
    3.49 +        if (_this->CreateSDLWindow(_this, window) < 0) {
    3.50              if (loaded_opengl) {
    3.51                  SDL_GL_UnloadLibrary();
    3.52                  window->flags &= ~SDL_WINDOW_OPENGL;
     4.1 --- a/src/video/SDL_vulkan_internal.h	Mon Aug 28 00:22:23 2017 -0700
     4.2 +++ b/src/video/SDL_vulkan_internal.h	Mon Aug 28 00:43:14 2017 -0700
     4.3 @@ -49,6 +49,7 @@
     4.4  #endif
     4.5  #if SDL_VIDEO_DRIVER_WINDOWS
     4.6  #define VK_USE_PLATFORM_WIN32_KHR
     4.7 +#include "../core/windows/SDL_windows.h"
     4.8  #endif
     4.9  #if SDL_VIDEO_DRIVER_X11
    4.10  #define VK_USE_PLATFORM_XLIB_KHR
     5.1 --- a/src/video/android/SDL_androidvideo.c	Mon Aug 28 00:22:23 2017 -0700
     5.2 +++ b/src/video/android/SDL_androidvideo.c	Mon Aug 28 00:43:14 2017 -0700
     5.3 @@ -115,7 +115,7 @@
     5.4      device->VideoQuit = Android_VideoQuit;
     5.5      device->PumpEvents = Android_PumpEvents;
     5.6  
     5.7 -    device->CreateWindow = Android_CreateWindow;
     5.8 +    device->CreateSDLWindow = Android_CreateWindow;
     5.9      device->SetWindowTitle = Android_SetWindowTitle;
    5.10      device->DestroyWindow = Android_DestroyWindow;
    5.11      device->GetWindowWMInfo = Android_GetWindowWMInfo;
     6.1 --- a/src/video/cocoa/SDL_cocoavideo.m	Mon Aug 28 00:22:23 2017 -0700
     6.2 +++ b/src/video/cocoa/SDL_cocoavideo.m	Mon Aug 28 00:43:14 2017 -0700
     6.3 @@ -81,8 +81,8 @@
     6.4      device->PumpEvents = Cocoa_PumpEvents;
     6.5      device->SuspendScreenSaver = Cocoa_SuspendScreenSaver;
     6.6  
     6.7 -    device->CreateWindow = Cocoa_CreateWindow;
     6.8 -    device->CreateWindowFrom = Cocoa_CreateWindowFrom;
     6.9 +    device->CreateSDLWindow = Cocoa_CreateWindow;
    6.10 +    device->CreateSDLWindowFrom = Cocoa_CreateWindowFrom;
    6.11      device->SetWindowTitle = Cocoa_SetWindowTitle;
    6.12      device->SetWindowIcon = Cocoa_SetWindowIcon;
    6.13      device->SetWindowPosition = Cocoa_SetWindowPosition;
     7.1 --- a/src/video/directfb/SDL_DirectFB_video.c	Mon Aug 28 00:22:23 2017 -0700
     7.2 +++ b/src/video/directfb/SDL_DirectFB_video.c	Mon Aug 28 00:43:14 2017 -0700
     7.3 @@ -109,8 +109,8 @@
     7.4      device->GetDisplayModes = DirectFB_GetDisplayModes;
     7.5      device->SetDisplayMode = DirectFB_SetDisplayMode;
     7.6      device->PumpEvents = DirectFB_PumpEventsWindow;
     7.7 -    device->CreateWindow = DirectFB_CreateWindow;
     7.8 -    device->CreateWindowFrom = DirectFB_CreateWindowFrom;
     7.9 +    device->CreateSDLWindow = DirectFB_CreateWindow;
    7.10 +    device->CreateSDLWindowFrom = DirectFB_CreateWindowFrom;
    7.11      device->SetWindowTitle = DirectFB_SetWindowTitle;
    7.12      device->SetWindowIcon = DirectFB_SetWindowIcon;
    7.13      device->SetWindowPosition = DirectFB_SetWindowPosition;
     8.1 --- a/src/video/emscripten/SDL_emscriptenvideo.c	Mon Aug 28 00:22:23 2017 -0700
     8.2 +++ b/src/video/emscripten/SDL_emscriptenvideo.c	Mon Aug 28 00:43:14 2017 -0700
     8.3 @@ -91,8 +91,7 @@
     8.4  
     8.5      device->PumpEvents = Emscripten_PumpEvents;
     8.6  
     8.7 -    device->CreateWindow = Emscripten_CreateWindow;
     8.8 -    /*device->CreateWindowFrom = Emscripten_CreateWindowFrom;*/
     8.9 +    device->CreateSDLWindow = Emscripten_CreateWindow;
    8.10      device->SetWindowTitle = Emscripten_SetWindowTitle;
    8.11      /*device->SetWindowIcon = Emscripten_SetWindowIcon;
    8.12      device->SetWindowPosition = Emscripten_SetWindowPosition;*/
     9.1 --- a/src/video/haiku/SDL_bvideo.cc	Mon Aug 28 00:22:23 2017 -0700
     9.2 +++ b/src/video/haiku/SDL_bvideo.cc	Mon Aug 28 00:43:14 2017 -0700
     9.3 @@ -68,8 +68,8 @@
     9.4      device->SetDisplayMode = BE_SetDisplayMode;
     9.5      device->PumpEvents = BE_PumpEvents;
     9.6  
     9.7 -    device->CreateWindow = BE_CreateWindow;
     9.8 -    device->CreateWindowFrom = BE_CreateWindowFrom;
     9.9 +    device->CreateSDLWindow = BE_CreateWindow;
    9.10 +    device->CreateSDLWindowFrom = BE_CreateWindowFrom;
    9.11      device->SetWindowTitle = BE_SetWindowTitle;
    9.12      device->SetWindowIcon = BE_SetWindowIcon;
    9.13      device->SetWindowPosition = BE_SetWindowPosition;
    10.1 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c	Mon Aug 28 00:22:23 2017 -0700
    10.2 +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c	Mon Aug 28 00:43:14 2017 -0700
    10.3 @@ -120,8 +120,8 @@
    10.4      device->VideoQuit = KMSDRM_VideoQuit;
    10.5      device->GetDisplayModes = KMSDRM_GetDisplayModes;
    10.6      device->SetDisplayMode = KMSDRM_SetDisplayMode;
    10.7 -    device->CreateWindow = KMSDRM_CreateWindow;
    10.8 -    device->CreateWindowFrom = KMSDRM_CreateWindowFrom;
    10.9 +    device->CreateSDLWindow = KMSDRM_CreateWindow;
   10.10 +    device->CreateSDLWindowFrom = KMSDRM_CreateWindowFrom;
   10.11      device->SetWindowTitle = KMSDRM_SetWindowTitle;
   10.12      device->SetWindowIcon = KMSDRM_SetWindowIcon;
   10.13      device->SetWindowPosition = KMSDRM_SetWindowPosition;
    11.1 --- a/src/video/mir/SDL_mirvideo.c	Mon Aug 28 00:22:23 2017 -0700
    11.2 +++ b/src/video/mir/SDL_mirvideo.c	Mon Aug 28 00:43:14 2017 -0700
    11.3 @@ -180,7 +180,7 @@
    11.4      device->GL_GetProcAddress  = MIR_GL_GetProcAddress;
    11.5  
    11.6      /* mirwindow */
    11.7 -    device->CreateWindow         = MIR_CreateWindow;
    11.8 +    device->CreateSDLWindow         = MIR_CreateWindow;
    11.9      device->DestroyWindow        = MIR_DestroyWindow;
   11.10      device->GetWindowWMInfo      = MIR_GetWindowWMInfo;
   11.11      device->SetWindowFullscreen  = MIR_SetWindowFullscreen;
   11.12 @@ -197,7 +197,7 @@
   11.13      device->SetWindowGammaRamp   = MIR_SetWindowGammaRamp;
   11.14      device->GetWindowGammaRamp   = MIR_GetWindowGammaRamp;
   11.15  
   11.16 -    device->CreateWindowFrom     = NULL;
   11.17 +    device->CreateSDLWindowFrom     = NULL;
   11.18      device->SetWindowIcon        = NULL;
   11.19      device->RaiseWindow          = NULL;
   11.20      device->SetWindowBordered    = NULL;
    12.1 --- a/src/video/nacl/SDL_naclvideo.c	Mon Aug 28 00:22:23 2017 -0700
    12.2 +++ b/src/video/nacl/SDL_naclvideo.c	Mon Aug 28 00:43:14 2017 -0700
    12.3 @@ -107,7 +107,7 @@
    12.4      device->VideoQuit = NACL_VideoQuit;
    12.5      device->PumpEvents = NACL_PumpEvents;
    12.6      
    12.7 -    device->CreateWindow = NACL_CreateWindow;
    12.8 +    device->CreateSDLWindow = NACL_CreateWindow;
    12.9      device->SetWindowTitle = NACL_SetWindowTitle;
   12.10      device->DestroyWindow = NACL_DestroyWindow;
   12.11      
    13.1 --- a/src/video/pandora/SDL_pandora.c	Mon Aug 28 00:22:23 2017 -0700
    13.2 +++ b/src/video/pandora/SDL_pandora.c	Mon Aug 28 00:43:14 2017 -0700
    13.3 @@ -102,8 +102,8 @@
    13.4      device->VideoQuit = PND_videoquit;
    13.5      device->GetDisplayModes = PND_getdisplaymodes;
    13.6      device->SetDisplayMode = PND_setdisplaymode;
    13.7 -    device->CreateWindow = PND_createwindow;
    13.8 -    device->CreateWindowFrom = PND_createwindowfrom;
    13.9 +    device->CreateSDLWindow = PND_createwindow;
   13.10 +    device->CreateSDLWindowFrom = PND_createwindowfrom;
   13.11      device->SetWindowTitle = PND_setwindowtitle;
   13.12      device->SetWindowIcon = PND_setwindowicon;
   13.13      device->SetWindowPosition = PND_setwindowposition;
    14.1 --- a/src/video/psp/SDL_pspvideo.c	Mon Aug 28 00:22:23 2017 -0700
    14.2 +++ b/src/video/psp/SDL_pspvideo.c	Mon Aug 28 00:43:14 2017 -0700
    14.3 @@ -113,8 +113,8 @@
    14.4      device->VideoQuit = PSP_VideoQuit;
    14.5      device->GetDisplayModes = PSP_GetDisplayModes;
    14.6      device->SetDisplayMode = PSP_SetDisplayMode;
    14.7 -    device->CreateWindow = PSP_CreateWindow;
    14.8 -    device->CreateWindowFrom = PSP_CreateWindowFrom;
    14.9 +    device->CreateSDLWindow = PSP_CreateWindow;
   14.10 +    device->CreateSDLWindowFrom = PSP_CreateWindowFrom;
   14.11      device->SetWindowTitle = PSP_SetWindowTitle;
   14.12      device->SetWindowIcon = PSP_SetWindowIcon;
   14.13      device->SetWindowPosition = PSP_SetWindowPosition;
    15.1 --- a/src/video/qnx/video.c	Mon Aug 28 00:22:23 2017 -0700
    15.2 +++ b/src/video/qnx/video.c	Mon Aug 28 00:43:14 2017 -0700
    15.3 @@ -330,7 +330,7 @@
    15.4      device->driverdata = NULL;
    15.5      device->VideoInit = videoInit;
    15.6      device->VideoQuit = videoQuit;
    15.7 -    device->CreateWindow = createWindow;
    15.8 +    device->CreateSDLWindow = createWindow;
    15.9      device->CreateWindowFramebuffer = createWindowFramebuffer;
   15.10      device->UpdateWindowFramebuffer = updateWindowFramebuffer;
   15.11      device->SetWindowSize = setWindowSize;
    16.1 --- a/src/video/raspberry/SDL_rpivideo.c	Mon Aug 28 00:22:23 2017 -0700
    16.2 +++ b/src/video/raspberry/SDL_rpivideo.c	Mon Aug 28 00:43:14 2017 -0700
    16.3 @@ -97,8 +97,8 @@
    16.4      device->VideoQuit = RPI_VideoQuit;
    16.5      device->GetDisplayModes = RPI_GetDisplayModes;
    16.6      device->SetDisplayMode = RPI_SetDisplayMode;
    16.7 -    device->CreateWindow = RPI_CreateWindow;
    16.8 -    device->CreateWindowFrom = RPI_CreateWindowFrom;
    16.9 +    device->CreateSDLWindow = RPI_CreateWindow;
   16.10 +    device->CreateSDLWindowFrom = RPI_CreateWindowFrom;
   16.11      device->SetWindowTitle = RPI_SetWindowTitle;
   16.12      device->SetWindowIcon = RPI_SetWindowIcon;
   16.13      device->SetWindowPosition = RPI_SetWindowPosition;
    17.1 --- a/src/video/uikit/SDL_uikitvideo.m	Mon Aug 28 00:22:23 2017 -0700
    17.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Mon Aug 28 00:43:14 2017 -0700
    17.3 @@ -91,7 +91,7 @@
    17.4          device->SetDisplayMode = UIKit_SetDisplayMode;
    17.5          device->PumpEvents = UIKit_PumpEvents;
    17.6          device->SuspendScreenSaver = UIKit_SuspendScreenSaver;
    17.7 -        device->CreateWindow = UIKit_CreateWindow;
    17.8 +        device->CreateSDLWindow = UIKit_CreateWindow;
    17.9          device->SetWindowTitle = UIKit_SetWindowTitle;
   17.10          device->ShowWindow = UIKit_ShowWindow;
   17.11          device->HideWindow = UIKit_HideWindow;
    18.1 --- a/src/video/vivante/SDL_vivantevideo.c	Mon Aug 28 00:22:23 2017 -0700
    18.2 +++ b/src/video/vivante/SDL_vivantevideo.c	Mon Aug 28 00:43:14 2017 -0700
    18.3 @@ -88,7 +88,7 @@
    18.4      device->VideoQuit = VIVANTE_VideoQuit;
    18.5      device->GetDisplayModes = VIVANTE_GetDisplayModes;
    18.6      device->SetDisplayMode = VIVANTE_SetDisplayMode;
    18.7 -    device->CreateWindow = VIVANTE_CreateWindow;
    18.8 +    device->CreateSDLWindow = VIVANTE_CreateWindow;
    18.9      device->SetWindowTitle = VIVANTE_SetWindowTitle;
   18.10      device->SetWindowPosition = VIVANTE_SetWindowPosition;
   18.11      device->SetWindowSize = VIVANTE_SetWindowSize;
    19.1 --- a/src/video/wayland/SDL_waylandvideo.c	Mon Aug 28 00:22:23 2017 -0700
    19.2 +++ b/src/video/wayland/SDL_waylandvideo.c	Mon Aug 28 00:43:14 2017 -0700
    19.3 @@ -168,7 +168,7 @@
    19.4      device->GL_GetProcAddress = Wayland_GLES_GetProcAddress;
    19.5      device->GL_DeleteContext = Wayland_GLES_DeleteContext;
    19.6  
    19.7 -    device->CreateWindow = Wayland_CreateWindow;
    19.8 +    device->CreateSDLWindow = Wayland_CreateWindow;
    19.9      device->ShowWindow = Wayland_ShowWindow;
   19.10      device->SetWindowFullscreen = Wayland_SetWindowFullscreen;
   19.11      device->MaximizeWindow = Wayland_MaximizeWindow;
    20.1 --- a/src/video/windows/SDL_windowsvideo.c	Mon Aug 28 00:22:23 2017 -0700
    20.2 +++ b/src/video/windows/SDL_windowsvideo.c	Mon Aug 28 00:43:14 2017 -0700
    20.3 @@ -137,9 +137,8 @@
    20.4      device->SetDisplayMode = WIN_SetDisplayMode;
    20.5      device->PumpEvents = WIN_PumpEvents;
    20.6  
    20.7 -#undef CreateWindow
    20.8 -    device->CreateWindow = WIN_CreateWindow;
    20.9 -    device->CreateWindowFrom = WIN_CreateWindowFrom;
   20.10 +    device->CreateSDLWindow = WIN_CreateWindow;
   20.11 +    device->CreateSDLWindowFrom = WIN_CreateWindowFrom;
   20.12      device->SetWindowTitle = WIN_SetWindowTitle;
   20.13      device->SetWindowIcon = WIN_SetWindowIcon;
   20.14      device->SetWindowPosition = WIN_SetWindowPosition;
    21.1 --- a/src/video/winrt/SDL_winrtvideo.cpp	Mon Aug 28 00:22:23 2017 -0700
    21.2 +++ b/src/video/winrt/SDL_winrtvideo.cpp	Mon Aug 28 00:43:14 2017 -0700
    21.3 @@ -140,7 +140,7 @@
    21.4      /* Set the function pointers */
    21.5      device->VideoInit = WINRT_VideoInit;
    21.6      device->VideoQuit = WINRT_VideoQuit;
    21.7 -    device->CreateWindow = WINRT_CreateWindow;
    21.8 +    device->CreateSDLWindow = WINRT_CreateWindow;
    21.9      device->SetWindowSize = WINRT_SetWindowSize;
   21.10      device->SetWindowFullscreen = WINRT_SetWindowFullscreen;
   21.11      device->DestroyWindow = WINRT_DestroyWindow;
    22.1 --- a/src/video/x11/SDL_x11video.c	Mon Aug 28 00:22:23 2017 -0700
    22.2 +++ b/src/video/x11/SDL_x11video.c	Mon Aug 28 00:43:14 2017 -0700
    22.3 @@ -231,8 +231,8 @@
    22.4      device->SuspendScreenSaver = X11_SuspendScreenSaver;
    22.5      device->PumpEvents = X11_PumpEvents;
    22.6  
    22.7 -    device->CreateWindow = X11_CreateWindow;
    22.8 -    device->CreateWindowFrom = X11_CreateWindowFrom;
    22.9 +    device->CreateSDLWindow = X11_CreateWindow;
   22.10 +    device->CreateSDLWindowFrom = X11_CreateWindowFrom;
   22.11      device->SetWindowTitle = X11_SetWindowTitle;
   22.12      device->SetWindowIcon = X11_SetWindowIcon;
   22.13      device->SetWindowPosition = X11_SetWindowPosition;