revel / cmd

Command line tools for Revel.
MIT License
62 stars 101 forks source link

fixed import "C" #163

Closed kumakichi closed 6 years ago

kumakichi commented 6 years ago

simple to test,

revel new -a my-app -r

edit my-app/app/controllers/app.go with code:


package controllers

// typedef int (*intFunc) ();
//
// int
// bridge_int_func(intFunc f)
// {
//      return f();
// }
//
// int fortytwo()
// {
//      return 42;
// }
import "C"

import (
    "github.com/revel/revel"
)

type App struct {
    *revel.Controller
}

func (c App) Index() revel.Result {
    f := C.intFunc(C.fortytwo)
    revel.AppLog.Debugf("cgo test : %d\n", int(C.bridge_int_func(f)))
    return c.Render()
}
notzippy commented 6 years ago

I'll catch your changes, I just need to get develop branch caught up with master first thanks

kumakichi commented 6 years ago

i just wanna close this pr,and re-pull one based on develop branch