Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into github_master
Browse files Browse the repository at this point in the history
  • Loading branch information
lemo-msft committed Nov 19, 2015
2 parents d161064 + ab60acf commit 9c384e0
Show file tree
Hide file tree
Showing 150 changed files with 10,088 additions and 1,419 deletions.
7 changes: 7 additions & 0 deletions Frameworks/CoreFoundation/CFArray.mm
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,13 @@ void CFArrayInsertValueAtIndex(CFMutableArrayRef array, CFIndex index, const voi
_LazyArrOffset.member(array)->addObjectAtIndex((id)value, index);
}

/**
@Status Interoperable
*/
void CFArraySetValueAtIndex(CFMutableArrayRef self,CFIndex index,const void *value) {
_LazyArrOffset.member(self)->replaceObject((id)value, index);
}

/**
@Status Interoperable
*/
Expand Down
53 changes: 51 additions & 2 deletions Frameworks/Foundation/NSAssertionHandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,56 @@
//
//******************************************************************************

#import <Foundation/Foundation.h>
#include "Starboard.h"
#import <Foundation/NSAssertionHandler.h>
#import <Foundation/NSException.h>
#import <Foundation/NSThread.h>
#import <Foundation/NSString.h>

const NSString* NSAssertionHandlerKey = @"NSAssertionHandlerKey";

@implementation NSAssertionHandler
@end

+ (NSAssertionHandler*)currentHandler {
id currentHandlerForThread = [[[NSThread currentThread] threadDictionary] objectForKey:NSAssertionHandlerKey];

if (currentHandlerForThread == nil) {
if ((currentHandlerForThread = [[[self alloc] init] autorelease]) != nil) {
[[[NSThread currentThread] threadDictionary] setObject:currentHandlerForThread forKey:NSAssertionHandlerKey];
}
}

return currentHandlerForThread;
}

- (void)handleFailureInMethod:(SEL)selector
object:(id)object
file:(NSString*)fileName
lineNumber:(NSInteger)line
description:(NSString*)format, ... {
NSLog(@"*** Assertion failure in %c[%@ %@], %@:%ld",
(object == [object class]) ? '+' : '-',
NSStringFromClass([object class]),
NSStringFromSelector(selector),
fileName,
(long)line);

va_list arguments;
va_start(arguments, format);
[NSException raise:NSInternalInconsistencyException format:format arguments:arguments];
va_end(arguments);
}

- (void)handleFailureInFunction:(NSString*)functionName
file:(NSString*)fileName
lineNumber:(NSInteger)line
description:(NSString*)format, ... {
NSLog(@"*** Assertion failure in %@, %@:%ld", functionName, fileName, (long)line);

va_list arguments;
va_start(arguments, format);
[NSException raise:NSInternalInconsistencyException format:format arguments:arguments];
va_end(arguments);
}

@end
14 changes: 12 additions & 2 deletions Frameworks/Foundation/NSBundle.mm
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,6 @@ + (NSBundle*)bundleWithPath:(NSString*)path {
}

+ (NSBundle*)bundleWithURL:(NSURL*)url {
EbrDebugLog("bundleWithURL: %s\n", [[url absoluteString] UTF8String]);

if ([url isFileURL]) {
return [[self alloc] initWithPath:[url path]];
} else {
Expand All @@ -678,6 +676,18 @@ + (NSBundle*)bundleWithURL:(NSURL*)url {
}
}

/**
@Status Interoperable
*/
- (instancetype)initWithUrl:(NSURL*)url {
if ([url isFileURL]) {
return [self initwithPath:[url path]];
}

EbrDebugLog("bad URL\n");
return nil;
}

/**
@Status Interoperable
*/
Expand Down
3 changes: 0 additions & 3 deletions Frameworks/Foundation/NSCondition.mm
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ - (BOOL)tryLock {
return pthread_mutex_trylock(&_mutex) == 0;
}

/**
@Status Interoperable
*/
- (void)lockWhenCondition:(NSInteger)condition {
int rc;

Expand Down
6 changes: 6 additions & 0 deletions Frameworks/Foundation/NSDictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
#ifndef __NSDICTIONARY_H
#define __NSDICTIONARY_H

typedef NS_ENUM(NSUInteger, NSEnumerationOptions) {
NSEnumerationConcurrent = 1,
NSEnumerationReverse
};

class __CFDictionary;
#define __CFDICTIONARY_SIZE_BYTES (0x54)
@interface NSDictionary : NSObject {
Expand Down Expand Up @@ -63,6 +68,7 @@ class __CFDictionary;
- (NSString*)stringFromQueryComponents;
- (void)getObjects:(id*)objects andKeys:(id*)keys;
- (void)enumerateKeysAndObjectsUsingBlock:(id)block;
- (void)enumerateKeysAndObjectsWithOptions:(NSEnumerationOptions)options usingBlock:(void (^)(id, id, BOOL*))block;
- (NSArray*)objectsForKeys:(NSArray*)keys notFoundMarker:(id)notFoundMarker;
+ (instancetype)dictionaryWithObjectsAndKeys:(id)firstObj, ...;
+ (instancetype)dictionaryWithObjects:(id*)vals forKeys:(id*)keys count:(unsigned)count;
Expand Down
10 changes: 9 additions & 1 deletion Frameworks/Foundation/NSDictionary.mm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static int _NSDict_SortedKeysHelper(id key1, id key2, void* context) {

@implementation NSDictionary : NSObject

+ (BOOL)automaticallyNotifiersObserversForKey:(NSString*)key {
+ (BOOL)automaticallyNotifiesObserversForKey:(NSString*)key {
// This class uses setObject:forKey: as a setter, and has no key-specific setters.
return NO;
}
Expand Down Expand Up @@ -799,6 +799,14 @@ - (void)enumerateKeysAndObjectsUsingBlock:(void (^)(id, id, BOOL*))block {
}
}

/**
@Status Caveat
@Notes enumeration options are not implemented.
*/
- (void)enumerateKeysAndObjectsWithOptions:(NSEnumerationOptions)options usingBlock:(void (^)(id, id, BOOL*))block {
[self enumerateKeysAndObjectsUsingBlock:block];
}

/**
@Status Interoperable
*/
Expand Down
53 changes: 0 additions & 53 deletions Frameworks/Foundation/NSFileManager.h

This file was deleted.

Loading

0 comments on commit 9c384e0

Please sign in to comment.