adds vendor directory

vendors dependencies in standard `vendor` directory, managed by glide
This commit is contained in:
Jon Chen
2017-05-14 19:35:03 -07:00
parent 070aa50762
commit 737231705f
2173 changed files with 2312028 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
#include <unistd.h>
typedef void (*callback)(void*);
static void call_later(int delay, callback cb, void* data) {
sleep(delay);
cb(data);
}

29
vendor/github.com/mattn/go-pointer/_example/main.go generated vendored Normal file
View File

@@ -0,0 +1,29 @@
package main
/*
#include "callback.h"
void call_later_go_cb(void*);
*/
import "C"
import (
"fmt"
"unsafe"
"github.com/mattn/go-pointer"
)
type Foo struct {
v int
}
func main() {
f := &Foo{123}
C.call_later(3, C.callback(C.call_later_go_cb), pointer.Save(f))
}
//export call_later_go_cb
func call_later_go_cb(data unsafe.Pointer) {
f := pointer.Restore(data).(*Foo)
fmt.Println(f.v)
}