Make the union nameless to reduce the complexity of the API.
authorSam Lantinga <slouken@libsdl.org>
Wed, 29 Sep 2010 21:13:52 -0700
changeset 490250d0bff24d81
parent 4901 deadc1219bea
child 4903 f50c7996d925
Make the union nameless to reduce the complexity of the API.
(Are there any compilers still in use that don't support this?)
include/SDL_syswm.h
src/video/cocoa/SDL_cocoawindow.m
src/video/win32/SDL_win32events.c
src/video/win32/SDL_win32window.c
src/video/x11/SDL_x11events.c
src/video/x11/SDL_x11window.c
     1.1 --- a/include/SDL_syswm.h	Mon Sep 27 01:30:42 2010 -0700
     1.2 +++ b/include/SDL_syswm.h	Wed Sep 29 21:13:52 2010 -0700
     1.3 @@ -133,7 +133,7 @@
     1.4              /* No Cocoa window events yet */
     1.5          } cocoa;
     1.6  #endif
     1.7 -    } msg;
     1.8 +    } /*msg*/;
     1.9  };
    1.10  
    1.11  /**
    1.12 @@ -175,7 +175,7 @@
    1.13              NSWindow *window;
    1.14          } cocoa;
    1.15  #endif
    1.16 -    } info;
    1.17 +    } /*info*/;
    1.18  };
    1.19  
    1.20  #endif /* SDL_PROTOTYPES_ONLY */
     2.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Mon Sep 27 01:30:42 2010 -0700
     2.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Wed Sep 29 21:13:52 2010 -0700
     2.3 @@ -708,7 +708,7 @@
     2.4  
     2.5      if (info->version.major <= SDL_MAJOR_VERSION) {
     2.6          info->subsystem = SDL_SYSWM_COCOA;
     2.7 -        info->info.cocoa.window = nswindow;
     2.8 +        info->cocoa.window = nswindow;
     2.9          return SDL_TRUE;
    2.10      } else {
    2.11          SDL_SetError("Application not compiled with SDL %d.%d\n",
     3.1 --- a/src/video/win32/SDL_win32events.c	Mon Sep 27 01:30:42 2010 -0700
     3.2 +++ b/src/video/win32/SDL_win32events.c	Wed Sep 29 21:13:52 2010 -0700
     3.3 @@ -114,10 +114,10 @@
     3.4  
     3.5          SDL_VERSION(&wmmsg.version);
     3.6          wmmsg.subsystem = SDL_SYSWM_WINDOWS;
     3.7 -        wmmsg.msg.win.hwnd = hwnd;
     3.8 -        wmmsg.msg.win.msg = msg;
     3.9 -        wmmsg.msg.win.wParam = wParam;
    3.10 -        wmmsg.msg.win.lParam = lParam;
    3.11 +        wmmsg.win.hwnd = hwnd;
    3.12 +        wmmsg.win.msg = msg;
    3.13 +        wmmsg.win.wParam = wParam;
    3.14 +        wmmsg.win.lParam = lParam;
    3.15          SDL_SendSysWMEvent(&wmmsg);
    3.16      }
    3.17  
     4.1 --- a/src/video/win32/SDL_win32window.c	Mon Sep 27 01:30:42 2010 -0700
     4.2 +++ b/src/video/win32/SDL_win32window.c	Wed Sep 29 21:13:52 2010 -0700
     4.3 @@ -552,7 +552,7 @@
     4.4      HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
     4.5      if (info->version.major <= SDL_MAJOR_VERSION) {
     4.6          info->subsystem = SDL_SYSWM_WINDOWS;
     4.7 -        info->info.win.window = hwnd;
     4.8 +        info->win.window = hwnd;
     4.9          return SDL_TRUE;
    4.10      } else {
    4.11          SDL_SetError("Application not compiled with SDL %d.%d\n",
     5.1 --- a/src/video/x11/SDL_x11events.c	Mon Sep 27 01:30:42 2010 -0700
     5.2 +++ b/src/video/x11/SDL_x11events.c	Wed Sep 29 21:13:52 2010 -0700
     5.3 @@ -90,7 +90,7 @@
     5.4  
     5.5          SDL_VERSION(&wmmsg.version);
     5.6          wmmsg.subsystem = SDL_SYSWM_X11;
     5.7 -        wmmsg.msg.x11.event = xevent;
     5.8 +        wmmsg.x11.event = xevent;
     5.9          SDL_SendSysWMEvent(&wmmsg);
    5.10      }
    5.11  
     6.1 --- a/src/video/x11/SDL_x11window.c	Mon Sep 27 01:30:42 2010 -0700
     6.2 +++ b/src/video/x11/SDL_x11window.c	Wed Sep 29 21:13:52 2010 -0700
     6.3 @@ -1125,8 +1125,8 @@
     6.4      if (info->version.major == SDL_MAJOR_VERSION &&
     6.5          info->version.minor == SDL_MINOR_VERSION) {
     6.6          info->subsystem = SDL_SYSWM_X11;
     6.7 -        info->info.x11.display = display;
     6.8 -        info->info.x11.window = data->xwindow;
     6.9 +        info->x11.display = display;
    6.10 +        info->x11.window = data->xwindow;
    6.11          return SDL_TRUE;
    6.12      } else {
    6.13          SDL_SetError("Application not compiled with SDL %d.%d\n",