Created
December 2, 2011 07:38
-
-
Save akavel/1422214 to your computer and use it in GitHub Desktop.
sketch for Go wrapper for 8c/6c main()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char** argv); | |
void cwrap·runmain() { | |
char *dummyargv[2] = {"dummyarg0", 0}; | |
main(1, dummyargv); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cwrap | |
func runmain() // TODO: argc, argv, retvalue | |
func Main() { | |
runmain() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "cwrap" | |
func main() { | |
cwrap.Main() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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).