Pārlūkot izejas kodu

fixes after ShowMessageBox changes:

- SDL_video.c (SDL_ShowMessageBox): remove C99'ism.
- SDL_os2video.c (OS2DIVE_bootstrap): add OS2_ShowMessageBox
- SDL_os2video.c (OS2VMAN_bootstrap): add OS2_ShowMessageBox
- SDL_DirectFB_video.c (DirectFB_bootstrap): NULL ShowMessageBox
- SDL_naclvideo.c (NACL_bootstrap): NULL ShowMessageBox
Ozkan Sezer 1 gadu atpakaļ
vecāks
revīzija
9e352e61db

+ 3 - 2
src/video/SDL_video.c

@@ -4445,13 +4445,14 @@ int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
     } else {
         /* It's completely fine to call this function before video is initialized */
         const char *driver_name = SDL_GetHint(SDL_HINT_VIDEODRIVER);
+        int i;
         if (driver_name && *driver_name != 0) {
             const char *driver_attempt = driver_name;
             while (driver_attempt && (*driver_attempt != 0) && (retval == -1)) {
                 const char *driver_attempt_end = SDL_strchr(driver_attempt, ',');
                 size_t driver_attempt_len = (driver_attempt_end) ? (driver_attempt_end - driver_attempt)
                                                                      : SDL_strlen(driver_attempt);
-                for (int i = 0; bootstrap[i]; ++i) {
+                for (i = 0; bootstrap[i]; ++i) {
                     if (bootstrap[i]->ShowMessageBox && (driver_attempt_len == SDL_strlen(bootstrap[i]->name)) &&
                         (SDL_strncasecmp(bootstrap[i]->name, driver_attempt, driver_attempt_len) == 0)) {
                         if (bootstrap[i]->ShowMessageBox(messageboxdata, buttonid) == 0) {
@@ -4464,7 +4465,7 @@ int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
                 driver_attempt = (driver_attempt_end) ? (driver_attempt_end + 1) : NULL;
             }
         } else {
-            for (int i = 0; bootstrap[i]; ++i) {
+            for (i = 0; bootstrap[i]; ++i) {
                 if (bootstrap[i]->ShowMessageBox && bootstrap[i]->ShowMessageBox(messageboxdata, buttonid) == 0) {
                     retval = 0;
                     break;

+ 2 - 1
src/video/directfb/SDL_DirectFB_video.c

@@ -65,7 +65,8 @@ static SDL_VideoDevice *DirectFB_CreateDevice(void);
 
 VideoBootStrap DirectFB_bootstrap = {
     "directfb", "DirectFB",
-    DirectFB_CreateDevice
+    DirectFB_CreateDevice,
+    NULL /* no ShowMessageBox implementation */
 };
 
 static const DirectFBSurfaceDrawingFlagsNames(drawing_flags);

+ 2 - 1
src/video/nacl/SDL_naclvideo.c

@@ -134,7 +134,8 @@ static SDL_VideoDevice *NACL_CreateDevice(void) {
 
 VideoBootStrap NACL_bootstrap = {
     NACLVID_DRIVER_NAME, "SDL Native Client Video Driver",
-    NACL_CreateDevice
+    NACL_CreateDevice,
+    NULL /* no ShowMessageBox implementation */
 };
 
 int NACL_VideoInit(_THIS) {

+ 5 - 2
src/video/os2/SDL_os2video.c

@@ -31,6 +31,7 @@
 #include "SDL_os2video.h"
 #include "SDL_syswm.h"
 #include "SDL_os2util.h"
+#include "SDL_os2messagebox.h"
 
 #define __MEERROR_H__
 #define  _MEERROR_H_
@@ -1683,12 +1684,14 @@ static SDL_VideoDevice *OS2VMAN_CreateDevice(void)
 VideoBootStrap OS2DIVE_bootstrap =
 {
     OS2DRIVER_NAME_DIVE, "OS/2 video driver",
-    OS2DIVE_CreateDevice
+    OS2DIVE_CreateDevice,
+    OS2_ShowMessageBox
 };
 VideoBootStrap OS2VMAN_bootstrap =
 {
     OS2DRIVER_NAME_VMAN, "OS/2 video driver",
-    OS2VMAN_CreateDevice
+    OS2VMAN_CreateDevice,
+    OS2_ShowMessageBox
 };
 
 #endif /* SDL_VIDEO_DRIVER_OS2 */