[gtk/wip/chergert/quartz4u] macos: add type checks



commit 95366f33275d4ad7e51aab8800c58a5a98904836
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 29 14:28:53 2020 -0700

    macos: add type checks

 gdk/macos/GdkMacosBaseView.h  | 2 ++
 gdk/macos/GdkMacosCairoView.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gdk/macos/GdkMacosBaseView.h b/gdk/macos/GdkMacosBaseView.h
index 03510db3b5..5e2768a89a 100644
--- a/gdk/macos/GdkMacosBaseView.h
+++ b/gdk/macos/GdkMacosBaseView.h
@@ -27,6 +27,8 @@
 #include "gdkmacosdisplay.h"
 #include "gdkmacossurface.h"
 
+#define GDK_IS_MACOS_BASE_VIEW(obj) ((obj) && [obj isKindOfClass:[GdkMacosBaseView class]])
+
 @interface GdkMacosBaseView : NSView
 {
   NSTrackingArea *trackingArea;
diff --git a/gdk/macos/GdkMacosCairoView.h b/gdk/macos/GdkMacosCairoView.h
index c66e8b730a..647500987a 100644
--- a/gdk/macos/GdkMacosCairoView.h
+++ b/gdk/macos/GdkMacosCairoView.h
@@ -23,7 +23,7 @@
 
 #import "GdkMacosBaseView.h"
 
-#define GDK_IS_MACOS_CAIRO_VIEW(obj) ([obj isKindOfClass:[GdkMacosCairoView class]])
+#define GDK_IS_MACOS_CAIRO_VIEW(obj) ((obj) && [obj isKindOfClass:[GdkMacosCairoView class]])
 
 @interface GdkMacosCairoView : GdkMacosBaseView
 {


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