# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1300002053 0 # Node ID d5e49ef8f541a06c41ce01d5a48ea54549875b08 # Parent 002f33d4439da4089773facda3e54fa69dfd4332 Updated the #if for Snow Leopard/Leopard builds to handle them not being defined properly. diff -r 002f33d4439d -r d5e49ef8f541 mac/dw.m --- a/mac/dw.m Sun Mar 13 05:47:02 2011 +0000 +++ b/mac/dw.m Sun Mar 13 07:40:53 2011 +0000 @@ -17,6 +17,11 @@ #include #include +/* Create a define to let us know to include Snow Leopard specific features */ +#if defined(MAC_OS_X_VERSION_10_6) && ((defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6) || !defined(MAC_OS_X_VERSION_MIN_REQUIRED)) +#define BUILDING_FOR_SNOW_LEOPARD +#endif + /* Macros to protect access to thread unsafe classes */ #define DW_MUTEX_LOCK { \ if(DWThread != (DWTID)-1 && pthread_self() != DWThread && pthread_self() != _dw_mutex_locked) { \ @@ -390,7 +395,7 @@ /* Subclass for a box type */ @interface DWBox : NSView -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD #endif { @@ -577,7 +582,7 @@ /* Subclass for a Notebook control type */ @interface DWNotebook : NSTabView -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD #endif { @@ -652,7 +657,7 @@ /* Subclass for a splitbar type */ @interface DWSplitBar : NSSplitView -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD #endif { @@ -830,7 +835,7 @@ /* Subclass for a Container/List type */ @interface DWContainer : NSTableView -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD #endif { @@ -1064,7 +1069,7 @@ /* Subclass for a Tree type */ @interface DWTree : NSOutlineView -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD #endif { @@ -1243,7 +1248,7 @@ /* Subclass for a Combobox type */ @interface DWComboBox : NSComboBox -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD #endif { @@ -1299,7 +1304,7 @@ /* Subclass for a Spinbutton type */ @interface DWSpinButton : NSView -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD #endif { @@ -1798,7 +1803,7 @@ NSString *applicationName = nil; /* This only works on 10.6 so we have a backup method */ -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD applicationName = [[NSRunningApplication currentApplication] localizedName]; #endif if(applicationName == nil) @@ -2139,7 +2144,7 @@ { NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD [pasteboard clearContents]; #endif @@ -5464,7 +5469,7 @@ [window setContentView:view]; [window setDelegate:view]; [window makeKeyAndOrderFront:nil]; -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD [window setAllowsConcurrentViewDrawing:NO]; #endif [view release]; @@ -5621,7 +5626,7 @@ if([object isMemberOfClass:[NSWindow class]]) { -#if MAC_OS_X_VERSION_10_6 > MAC_OS_X_VERSION_MAX_ALLOWED +#ifdef BUILDING_FOR_SNOW_LEOPARD NSWindow *window = object; int currentstyle = (int)[window styleMask]; int tmp;