mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Avoid compilation warnings on 10.6
This commit is contained in:
@@ -42,7 +42,12 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface DBPrefsWindowController : NSWindowController {
|
||||
@interface DBPrefsWindowController : NSWindowController
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5)
|
||||
// 10.6 has turned delegate messages into formal protocols
|
||||
<NSAnimationDelegate, NSToolbarDelegate>
|
||||
#endif
|
||||
{
|
||||
NSMutableArray *toolbarIdentifiers;
|
||||
NSMutableDictionary *toolbarViews;
|
||||
NSMutableDictionary *toolbarItems;
|
||||
|
||||
@@ -1927,6 +1927,13 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// HACK: fileAttributesAtPath was deprecated in 10.5
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4)
|
||||
#define MM_fileAttributes(fm,p) [fm attributesOfItemAtPath:p error:NULL]
|
||||
#else
|
||||
#define MM_fileAttributes(fm,p) [fm fileAttributesAtPath:p traverseLink:YES]
|
||||
#endif
|
||||
- (NSDate *)rcFilesModificationDate
|
||||
{
|
||||
// Check modification dates for ~/.vimrc and ~/.gvimrc and return the
|
||||
@@ -1938,20 +1945,20 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
|
||||
NSString *path = [@"~/.vimrc" stringByExpandingTildeInPath];
|
||||
NSDictionary *attr = [fm fileAttributesAtPath:path traverseLink:YES];
|
||||
NSDictionary *attr = MM_fileAttributes(fm, path);
|
||||
if (!attr) {
|
||||
path = [@"~/_vimrc" stringByExpandingTildeInPath];
|
||||
attr = [fm fileAttributesAtPath:path traverseLink:YES];
|
||||
attr = MM_fileAttributes(fm, path);
|
||||
}
|
||||
NSDate *modDate = [attr objectForKey:NSFileModificationDate];
|
||||
if (modDate)
|
||||
date = modDate;
|
||||
|
||||
path = [@"~/.gvimrc" stringByExpandingTildeInPath];
|
||||
attr = [fm fileAttributesAtPath:path traverseLink:YES];
|
||||
attr = MM_fileAttributes(fm, path);
|
||||
if (!attr) {
|
||||
path = [@"~/_gvimrc" stringByExpandingTildeInPath];
|
||||
attr = [fm fileAttributesAtPath:path traverseLink:YES];
|
||||
attr = MM_fileAttributes(fm, path);
|
||||
}
|
||||
modDate = [attr objectForKey:NSFileModificationDate];
|
||||
if (modDate)
|
||||
@@ -1959,6 +1966,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
return date;
|
||||
}
|
||||
#undef MM_fileAttributes
|
||||
|
||||
- (BOOL)openVimControllerWithArguments:(NSDictionary *)arguments
|
||||
{
|
||||
|
||||
@@ -20,7 +20,12 @@
|
||||
|
||||
|
||||
|
||||
@interface MMVimController : NSObject {
|
||||
@interface MMVimController : NSObject
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5)
|
||||
// 10.6 has turned delegate messages into formal protocols
|
||||
<NSToolbarDelegate, NSOpenSavePanelDelegate>
|
||||
#endif
|
||||
{
|
||||
unsigned identifier;
|
||||
BOOL isInitialized;
|
||||
MMWindowController *windowController;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
*/
|
||||
|
||||
#import "MMAppController.h"
|
||||
#import "MMAtsuiTextView.h"
|
||||
#import "MMFindReplaceController.h"
|
||||
#import "MMTextView.h"
|
||||
#import "MMVimController.h"
|
||||
|
||||
@@ -414,7 +414,12 @@ enum {
|
||||
identifier:(long)ident
|
||||
{
|
||||
MMScroller *scroller = [self scrollbarForIdentifier:ident index:NULL];
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4)
|
||||
[scroller setDoubleValue:val];
|
||||
[scroller setKnobProportion:prop];
|
||||
#else
|
||||
[scroller setFloatValue:val knobProportion:prop];
|
||||
#endif
|
||||
[scroller setEnabled:prop != 1.f];
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
@class MMVimController;
|
||||
@class MMVimView;
|
||||
|
||||
@interface MMWindowController : NSWindowController {
|
||||
@interface MMWindowController : NSWindowController
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5)
|
||||
// 10.6 has turned delegate messages into formal protocols
|
||||
<NSWindowDelegate>
|
||||
#endif
|
||||
{
|
||||
MMVimController *vimController;
|
||||
MMVimView *vimView;
|
||||
BOOL setupDone;
|
||||
|
||||
@@ -18,6 +18,18 @@
|
||||
#define MM_ENABLE_PLUGINS
|
||||
|
||||
|
||||
// Taken from /usr/include/AvailabilityMacros.h
|
||||
#ifndef MAC_OS_X_VERSION_10_4
|
||||
# define MAC_OS_X_VERSION_10_4 1040
|
||||
#endif
|
||||
#ifndef MAC_OS_X_VERSION_10_5
|
||||
# define MAC_OS_X_VERSION_10_5 1050
|
||||
#endif
|
||||
#ifndef MAC_OS_X_VERSION_10_6
|
||||
# define MAC_OS_X_VERSION_10_6 1060
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
// This is the protocol MMBackend implements.
|
||||
|
||||
@@ -113,8 +113,10 @@ static int MMPlugInArchMinorVersion = 0;
|
||||
NSString *errstr = nil;
|
||||
id res = [vimController evaluateVimExpressionCocoa:vimExpression
|
||||
errorString:&errstr];
|
||||
if (!res)
|
||||
[NSException raise:@"VimEvaluationException" format:errstr];
|
||||
if (!res) {
|
||||
// Setting format to %@ instead of just passing errstr avoids warning.
|
||||
[NSException raise:@"VimEvaluationException" format:@"%@", errstr];
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user