DECLARE_WXCOCOA_OBJC_CLASS now declares types as struct objc_object* so that
they are exactly the same type for C++ and Objective-C++ code. This allows them to be used as arguments to functions, especially virtuals, because the C++ name mangling will be the same. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20162 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1898,17 +1898,13 @@ typedef ControlHandle WXWidget;
|
|||||||
|
|
||||||
#ifdef __WXCOCOA__
|
#ifdef __WXCOCOA__
|
||||||
|
|
||||||
#if defined(__OBJC__)
|
// NOTE: typedef struct objc_object *id;
|
||||||
#include <objc/objc.h>
|
// IOW, we're declaring these using the id type without using that name,
|
||||||
#define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
|
// since "id" is used extensively not only within wxWindows itself, but
|
||||||
@class klass; typedef klass *WX_##klass
|
// also in wxWindows application code. The following works fine when
|
||||||
#elif defined(wxI_LIKE_OBJC_ID)
|
// compiling C++ code, and works without typesafety for Obj-C++ code
|
||||||
#define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
|
#define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
|
||||||
typedef id WX_##klass
|
typedef struct objc_object *WX_##klass
|
||||||
#else // the goal is to get rid of this secion at some time!
|
|
||||||
#define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
|
|
||||||
typedef void *WX_##klass
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DECLARE_WXCOCOA_OBJC_CLASS(NSApplication);
|
DECLARE_WXCOCOA_OBJC_CLASS(NSApplication);
|
||||||
DECLARE_WXCOCOA_OBJC_CLASS(NSBox);
|
DECLARE_WXCOCOA_OBJC_CLASS(NSBox);
|
||||||
|
Reference in New Issue
Block a user