]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxObjCID instead of "struct objc_object*" to fix clang build.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 May 2012 20:29:50 +0000 (20:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 May 2012 20:29:50 +0000 (20:29 +0000)
Clang doesn't accept "struct objc_object*" as synonym for "id" in Objective-C
code, so use the real "id" for it while still using the struct pointer for C++
code where "id" is not defined.

Closes #13565.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/private/objcid.h [new file with mode: 0644]
include/wx/osx/webview_webkit.h
include/wx/osx/webviewhistoryitem_webkit.h

diff --git a/include/wx/osx/private/objcid.h b/include/wx/osx/private/objcid.h
new file mode 100644 (file)
index 0000000..59d044d
--- /dev/null
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        osx/private/objcid.h
+// Purpose:     Define wxObjCID working in both C++ and Objective-C.
+// Author:      Vadim Zeitlin
+// Created:     2012-05-20
+// RCS-ID:      $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
+// Copyright:   (c) 2012 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_OSX_PRIVATE_OBJCID_H_
+#define _WX_OSX_PRIVATE_OBJCID_H_
+
+// ----------------------------------------------------------------------------
+// wxObjCID: Equivalent of Objective-C "id" that works in C++ code.
+// ----------------------------------------------------------------------------
+
+#ifdef __OBJC__
+    #define wxObjCID id
+#else
+    typedef struct objc_object* wxObjCID;
+#endif
+
+#endif // _WX_OSX_PRIVATE_OBJCID_H_
index aa937a93db39166ba693a016d9a13a843b7838d9..76b66e19ae42d77b1db8ad87ad41e9c682c95900 100644 (file)
@@ -21,6 +21,8 @@
 #include "wx/control.h"
 #include "wx/webview.h"
 
+#include "wx/osx/private/objcid.h"
+
 // ----------------------------------------------------------------------------
 // Web Kit Control
 // ----------------------------------------------------------------------------
@@ -149,7 +151,7 @@ private:
     wxWindowID m_windowID;
     wxString m_pageTitle;
 
-    struct objc_object *m_webView;
+    wxObjCID m_webView;
 
     // we may use this later to setup our own mouse events,
     // so leave it in for now.
index a136f235dd81ed010987dbd6bfb1a340edc5d976..13cddf5f3053743795b32a532a2529b7b5b373f1 100644 (file)
@@ -15,6 +15,8 @@
 #if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && (defined(__WXOSX_COCOA__) \
                                           ||  defined(__WXOSX_CARBON__))
 
+#include "wx/osx/private/objcid.h"
+
 class WXDLLIMPEXP_WEBVIEW wxWebViewHistoryItem
 {
 public:
@@ -27,7 +29,7 @@ public:
 
 private:
     wxString m_url, m_title;
-    struct objc_object *m_histItem;
+    wxObjCID m_histItem;
 };
 
 #endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT