ui/app: call main from Android and iOS

Android can only run c-shared libraries which means that every
Gio program must create its window and event loop from an init
function.

The same applies to iOS but for a more benign reason: the gio tool
builds programs in c-archive mode for iOS and links the binary with
a Objective-C driver.

Allow Gio programs to run off its main function by linking to and
invoking main even from Android libraries and iOS ditto.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-22 11:17:09 +02:00
parent 4e0d820a5b
commit c080a54038
13 changed files with 87 additions and 41 deletions
+1 -3
View File
@@ -20,8 +20,6 @@ func dataDir() (string, error) {
return dataPath, nil
}
//export setDataDir
func setDataDir(cdir *C.char, len C.int) {
dir := C.GoStringN(cdir, len)
func setDataDir(dir string) {
dataDirChan <- dir
}