Skip to content

Instantly share code, notes, and snippets.

@akavel
Created December 2, 2011 07:38
Show Gist options
  • Save akavel/1422214 to your computer and use it in GitHub Desktop.
Save akavel/1422214 to your computer and use it in GitHub Desktop.
sketch for Go wrapper for 8c/6c main()
int main(int argc, char** argv);
void cwrap·runmain() {
char *dummyargv[2] = {"dummyarg0", 0};
main(1, dummyargv);
}
package cwrap
func runmain() // TODO: argc, argv, retvalue
func Main() {
runmain()
}
package main
import "cwrap"
func main() {
cwrap.Main()
}
@akavel
Copy link
Author

akavel commented Dec 2, 2011

Might be possible to ditch the "package cwrap" alltogether and do everything in "package main", but I'm not sure. Anyway, that's just a sketch, May Or May Not Work For You (tm).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment