diff --git a/Examples/HelloPlaydate/Sources/HelloPlaydate/Game.swift b/Examples/HelloPlaydate/Sources/HelloPlaydate/Game.swift index 4ea054a..e1bb792 100644 --- a/Examples/HelloPlaydate/Sources/HelloPlaydate/Game.swift +++ b/Examples/HelloPlaydate/Sources/HelloPlaydate/Game.swift @@ -8,7 +8,7 @@ import CPlaydate import PlaydateKit -@_cdecl("eventHandler") +@c(eventHandler) public func eventHandler( pointer: UnsafeMutableRawPointer, event: PDSystemEvent, diff --git a/README.md b/README.md index ba18b27..650947e 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,13 @@ targets: [ ## Getting started -A Playdate application or game has a single C entry point, `eventHandler`. Export it with `@_cdecl`, initialize the binding on the first event, and install an update callback: +A Playdate application or game has a single C entry point, `eventHandler`. Export it with `@c`, initialize the binding on the first event, and install an update callback: ```swift import CPlaydate import PlaydateKit -@_cdecl("eventHandler") +@c(eventHandler) func eventHandler( pointer: UnsafeMutableRawPointer, event: PDSystemEvent, diff --git a/Sources/PlaydateKit/PlaydateKit.docc/GettingStarted.md b/Sources/PlaydateKit/PlaydateKit.docc/GettingStarted.md index fa13c5f..b4408a1 100644 --- a/Sources/PlaydateKit/PlaydateKit.docc/GettingStarted.md +++ b/Sources/PlaydateKit/PlaydateKit.docc/GettingStarted.md @@ -6,14 +6,14 @@ Bootstrap the bindings from your game's entry point and drive a frame loop. A Playdate game has a single C entry point, `eventHandler`, which the firmware calls with a `PlaydateAPI*` and an event code. Export it with -`@_cdecl`, call ``Playdate/initialize(with:)`` on the first event, and +`@c`, call ``Playdate/initialize(with:)`` on the first event, and install an update callback: ```swift import CPlaydate import PlaydateKit -@_cdecl("eventHandler") +@c(eventHandler) func eventHandler( pointer: UnsafeMutableRawPointer, event: PDSystemEvent, diff --git a/Sources/PlaydateKit/Support.swift b/Sources/PlaydateKit/Support.swift index 7098972..2b2be21 100644 --- a/Sources/PlaydateKit/Support.swift +++ b/Sources/PlaydateKit/Support.swift @@ -73,7 +73,7 @@ extension String { /// The pointer is later released with plain `free`, so it cannot be offset /// to adjust alignment; the firmware allocator's natural alignment has to /// satisfy the request, which the precondition asserts. -@_cdecl("posix_memalign") +@c(posix_memalign) public func posix_memalign( _ memptr: UnsafeMutablePointer, _ alignment: Int,