From 85e53533595f03905955382d612636e1e9f0a5f9 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Wed, 30 Sep 2009 23:04:12 +0200 Subject: [PATCH] Add missing defines to Tiger CGFloat and NS[U]Integer were introduced in 10.5, make sure they are defined when compiling for 10.4. --- src/MacVim/MMTextStorage.h | 2 +- src/MacVim/MMWindow.h | 2 +- src/MacVim/MMWindowController.m | 12 ------------ src/MacVim/MacVim.h | 16 ++++++++++++++-- src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h | 12 ++++++++++++ 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/MacVim/MMTextStorage.h b/src/MacVim/MMTextStorage.h index c87d6b33..1d72ab52 100644 --- a/src/MacVim/MMTextStorage.h +++ b/src/MacVim/MMTextStorage.h @@ -8,7 +8,7 @@ * See README.txt for an overview of the Vim source code. */ -#import +#import "MacVim.h" #define MM_USE_ROW_CACHE 1 diff --git a/src/MacVim/MMWindow.h b/src/MacVim/MMWindow.h index 24665637..89a62f90 100644 --- a/src/MacVim/MMWindow.h +++ b/src/MacVim/MMWindow.h @@ -8,7 +8,7 @@ * See README.txt for an overview of the Vim source code. */ -#import +#import "MacVim.h" diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index ea14f506..220f0601 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -99,18 +99,6 @@ @interface NSWindow (NSLeopardOnly) // Note: These functions are Leopard-only, use -[NSObject respondsToSelector:] // before calling them to make sure everything works on Tiger too. - -#ifndef CGFLOAT_DEFINED - // On Leopard, CGFloat is float on 32bit and double on 64bit. On Tiger, - // we can't use this anyways, so it's just here to keep the compiler happy. - // However, when we're compiling for Tiger and running on Leopard, we - // might need the correct typedef, so this piece is copied from ATSTypes.h -# ifdef __LP64__ - typedef double CGFloat; -# else - typedef float CGFloat; -# endif -#endif - (void)setAutorecalculatesContentBorderThickness:(BOOL)b forEdge:(NSRectEdge)e; - (void)setContentBorderThickness:(CGFloat)b forEdge:(NSRectEdge)e; @end diff --git a/src/MacVim/MacVim.h b/src/MacVim/MacVim.h index c0dec580..cedb1873 100644 --- a/src/MacVim/MacVim.h +++ b/src/MacVim/MacVim.h @@ -31,7 +31,6 @@ #endif - // // This is the protocol MMBackend implements. // @@ -298,7 +297,7 @@ extern NSString *VimPBoardType; -#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 +#ifndef NSINTEGER_DEFINED // NSInteger was introduced in 10.5 # if __LP64__ || NS_BUILD_32_LIKE_64 typedef long NSInteger; @@ -307,12 +306,25 @@ typedef unsigned long NSUInteger; typedef int NSInteger; typedef unsigned int NSUInteger; # endif +# define NSINTEGER_DEFINED 1 #endif #ifndef NSAppKitVersionNumber10_4 // Needed for pre-10.5 SDK # define NSAppKitVersionNumber10_4 824 #endif +#ifndef CGFLOAT_DEFINED + // On Leopard, CGFloat is float on 32bit and double on 64bit. On Tiger, + // we can't use this anyways, so it's just here to keep the compiler happy. + // However, when we're compiling for Tiger and running on Leopard, we + // might need the correct typedef, so this piece is copied from ATSTypes.h +# ifdef __LP64__ + typedef double CGFloat; +# else + typedef float CGFloat; +# endif +#endif + // Logging related functions and macros. // diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h index 727b92b3..f797804a 100644 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h +++ b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h @@ -12,6 +12,18 @@ #import +#ifndef NSINTEGER_DEFINED +// NSInteger was introduced in 10.5 +# if __LP64__ || NS_BUILD_32_LIKE_64 +typedef long NSInteger; +typedef unsigned long NSUInteger; +# else +typedef int NSInteger; +typedef unsigned int NSUInteger; +# endif +# define NSINTEGER_DEFINED 1 +#endif + #define kPSMTabBarControlHeight 22 // internal cell border #define MARGIN_X 6 -- 2.11.4.GIT