mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
genbindings: fixes for QApplication ctor's argc/argv handling
This commit is contained in:
parent
03f4f21d16
commit
8032dc8456
@ -137,6 +137,7 @@ func emitParametersGo(params []CppParameter) string {
|
|||||||
|
|
||||||
} else if skipNext {
|
} else if skipNext {
|
||||||
// Skip this parameter, already handled
|
// Skip this parameter, already handled
|
||||||
|
skipNext = false
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Ordinary parameter
|
// Ordinary parameter
|
||||||
@ -170,10 +171,10 @@ func (gfs *goFileState) emitParametersGo2CABIForwarding(m CppMethod) (preamble s
|
|||||||
|
|
||||||
preamble += "// Convert []string to long-lived int& argc, char** argv, never call free()\n"
|
preamble += "// Convert []string to long-lived int& argc, char** argv, never call free()\n"
|
||||||
preamble += "argc := (*C.int)(C.malloc(8))\n"
|
preamble += "argc := (*C.int)(C.malloc(8))\n"
|
||||||
preamble += "*argc = len(args)\n"
|
preamble += "*argc = C.int(len(args))\n"
|
||||||
preamble += "argv := (*[0xffff]*C.char)(C.malloc(c.ulong(8 * len(args))))\n"
|
preamble += "argv := (*[0xffff]*C.char)(C.malloc(C.ulong(8 * len(args))))\n"
|
||||||
preamble += "for i := range args {\n"
|
preamble += "for i := range args {\n"
|
||||||
preamble += "argv[i] = C.CString(" + p.ParameterName + "[i])\n"
|
preamble += "argv[i] = C.CString(args[i])\n"
|
||||||
preamble += "}\n"
|
preamble += "}\n"
|
||||||
|
|
||||||
tmp = append(tmp, "argc, argv")
|
tmp = append(tmp, "argc, argv")
|
||||||
|
Loading…
Reference in New Issue
Block a user