Skip to content

Instantly share code, notes, and snippets.

@resuna
Created September 14, 2016 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save resuna/5081a944b7d9898d2375ea2cb4c4da0d to your computer and use it in GitHub Desktop.
Save resuna/5081a944b7d9898d2375ea2cb4c4da0d to your computer and use it in GitHub Desktop.
// Defn of ClientData:
// #ifndef _CLIENTDATA
// # ifndef NO_VOID
// typedef void *ClientData;
// # else
// typedef int *ClientData;
// # endif
// # define _CLIENTDATA
// #endif
// swift_tcl_bridger - this is the trampoline that gets called by Tcl when invoking a created Swift command
// this declaration is the Swift equivalent of Tcl_ObjCmdProc *proc
func swift_tcl_bridger (clientData: ClientData?, interp: UnsafeMutablePointer<Tcl_Interp>?, objc: Int32, objv: UnsafePointer<UnsafeMutablePointer<Tcl_Obj>?>?) -> Int32 {
let tcb = UnsafeMutablePointer<TclCommandBlock>(clientData!).pointee
"can't invoke an initializer for type UnsafeMutablePointer<TclCommandBlock> with an argument list of type (clientData)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment