Ticket #32302: patch-Samples_Browser_include_SampleBrowser_OSX.h.diff

File patch-Samples_Browser_include_SampleBrowser_OSX.h.diff, 1.2 KB (added by marin.saric@…, 13 years ago)
  • Samples/Browser/include/SampleBrowser_OSX.h

    old new  
    3737
    3838#ifdef __OBJC__
    3939
     40#ifdef OGRE_STATIC_LIB
     41// HACK warning:
     42// In a static build, all of the plugin headers are #included.
     43// Unfortunately, the plugin headers have "using namespace" directives
     44// which end up pulling in some Ogre data structures whose names collide
     45// with the MacOS X Carbon API which is indirectly included by Cocoa.h.
     46// Since this part of the code does not use Carbon, we can more/less
     47// harmlessly change the names of the conflicting types.
     48
     49#define FileInfo Carbon_FileInfo
     50#define Rect ::Rect
    4051#import <Cocoa/Cocoa.h>
     52#undef FileInfo
     53#undef Rect
     54
     55#else
     56
     57// OGRE is not built statically, so there's no namespace pollution in the
     58// sample code, hence the Cocoa API and its legacy Carbon headers can be
     59// imported without special intervention.
     60
     61#import <Cocoa/Cocoa.h>
     62
     63#endif  // OGRE_STATIC_LIB
    4164
    4265// All this does is suppress some messages in the run log.  NSApplication does not
    4366// implement buttonPressed and apps without a NIB have no target for the action.