NSView and NSWindow

In REALplugin.h we have:

#if defined(COCOA) && COCOA #if defined(__OBJC__) #import <Cocoa/Cocoa.h> #else struct NSWindow; struct NSView; #endif #define TARGET_COCOA 1 #endif

In REALplugin_deprecated.h we have:

[code]#if TARGET_COCOA
REAL_DEPRECATED NSView *REALGetControlHandle(REALcontrolInstance control);
#elif TARGET_WIN32
REAL_DEPRECATED HWND REALGetControlHandle(REALcontrolInstance control);
#elif X_WINDOW
REAL_DEPRECATED unsigned long REALGetControlHandle(REALcontrolInstance control);
#endif

#if TARGET_COCOA
REAL_DEPRECATED NSWindow *REALGetWindowHandle(REALwindow window);
#endif
[/code]

Can this be changed to:

#if defined(COCOA) && COCOA #if defined(__OBJC__) #import <Cocoa/Cocoa.h> #define TARGET_COCOA 1 #endif

and

[code]#if TARGET_COCOA
#if defined(OBJC)
REAL_DEPRECATED NSView *REALGetControlHandle(REALcontrolInstance control);
#endif
#elif TARGET_WIN32
REAL_DEPRECATED HWND REALGetControlHandle(REALcontrolInstance control);
#elif X_WINDOW
REAL_DEPRECATED unsigned long REALGetControlHandle(REALcontrolInstance control);
#endif

#if TARGET_COCOA
#if defined(OBJC)
REAL_DEPRECATED NSWindow *REALGetWindowHandle(REALwindow window);
#endif
#endif
[/code]

If a c-file can only be compiled as C, not C++, the compiler will tell that in REALplugin_deprecated.h NSView* and NSWindow* need to be called with a tag. It suggests to precede the call with struct, but that does not cut it. Since NSView, NSWindow have no meaning without being in OBJC, why not make these changes?

Seems like a reasonable enough change. Is there a feedback case for this?

in my prefix file I have:

#ifdef __OBJC__ #import <Foundation/Foundation.h> #import <CoreFoundation/CoreFoundation.h> #import <Cocoa/Cocoa.h> #import <Quartz/Quartz.h> #import <QuartzCore/QuartzCore.h> #import <WebKit/WebKit.h> #else typedef struct _NSWindow* NSWindow; typedef struct _NSView* NSView; #endif

Here it is: feedback://showreport?report_id=46646

I made these changes and it does not break any code in the various plugins we made.