Files
swift-mirror/stdlib/public/SDK/GameplayKit/GameplayKit.mm
John McCall 50d58b2732 Add a lot of calling-convention annotations to the standard library / runtime.
The general rule here is that something needs to be SWIFT_CC(swift)
if it's just declared in Swift code using _silgen_name, as opposed to
importing something via a header.

Of course, SWIFT_CC(swift) expands to nothing by default for now, and
I haven't made an effort yet to add the indirect-result / context
parameter ABI attributes.  This is just a best-effort first pass.

I also took the opportunity to shift a few files to just implement
their shims header and to demote a few things to be private stdlib
interfaces.
2016-05-04 10:31:23 -07:00

36 lines
1.2 KiB
Plaintext

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#import <GameplayKit/GameplayKit.h>
#include "swift/Runtime/Config.h"
extern "C" SWIFT_CC(swift) NS_RETURNS_RETAINED GKComponent * __nullable
GK_Swift_GKEntity_componentForClass(
id NS_RELEASES_ARGUMENT __nonnull self_,
Class __nonnull componentClass) {
GKEntity *entity = self_;
id component = [[entity componentForClass:componentClass] retain];
[self_ release];
return component;
}
extern "C" SWIFT_CC(swift) NS_RETURNS_RETAINED GKState * __nullable
GK_Swift_GKStateMachine_stateForClass(
id NS_RELEASES_ARGUMENT __nonnull self_,
Class __nonnull stateClass) {
GKStateMachine *stateMachine = self_;
id state = [[stateMachine stateForClass:stateClass] retain];
[self_ release];
return state;
}