[gtk+/gtk-2-24-quartz] Quartz, Bug 655057: Eliminate Compiler Warning



commit 2da286755530042009b70c265a7bf71ea1a12e70
Author: Alex Corrado <alexander corrado gmail com>
Date:   Sun Oct 9 09:52:14 2011 -0700

    Quartz, Bug 655057: Eliminate Compiler Warning
    
    When compiled with older SDKs, the original change for this bug caused a
    compiler warning about NSWindow not being able to handle a setStyleMask
    message. This tricks the compiler into thinking that it can.

 gdk/quartz/gdkwindow-quartz.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 0c8a19c..a637b07 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2592,6 +2592,14 @@ gdk_window_get_frame_extents (GdkWindow    *window,
   rect->height = ns_rect.size.height;
 }
 
+/* Fake protocol to make gcc think that it's OK to call setStyleMask
+   even if it isn't. We check to make sure before actually calling
+   it. */
+
+ protocol CanSetStyleMask
+- (void)setStyleMask:(int)mask;
+ end
+
 void
 gdk_window_set_decorations (GdkWindow       *window,
 			    GdkWMDecoration  decorations)
@@ -2651,7 +2659,7 @@ gdk_window_set_decorations (GdkWindow       *window,
        */
       if ([impl->toplevel respondsToSelector:@selector(setStyleMask:)])
         {
-          [impl->toplevel setStyleMask:new_mask];
+          [(id<CanSetStyleMask>)impl->toplevel setStyleMask:new_mask];
         }
       else
         {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]