mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 08:15:37 +00:00
expose version from Go bindings
This commit is contained in:
parent
86823f53da
commit
79ec6145db
|
@ -62,9 +62,14 @@ type UcOptions struct {
|
||||||
Timeout, Count uint64
|
Timeout, Count uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUnicorn(arch, mode int) (Unicorn, error) {
|
func Version() (int, int) {
|
||||||
var major, minor C.uint
|
var major, minor C.uint
|
||||||
C.uc_version(&major, &minor)
|
C.uc_version(&major, &minor)
|
||||||
|
return int(major), int(minor)
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUnicorn(arch, mode int) (Unicorn, error) {
|
||||||
|
major, minor := Version()
|
||||||
if major != C.UC_API_MAJOR || minor != C.UC_API_MINOR {
|
if major != C.UC_API_MAJOR || minor != C.UC_API_MINOR {
|
||||||
return nil, UcError(ERR_VERSION)
|
return nil, UcError(ERR_VERSION)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue