mirror of
https://github.com/codecat/go-enet.git
synced 2025-12-08 05:59:47 +00:00
Function returning the enet library version in use
This commit is contained in:
parent
b00ef38743
commit
c9a7864fa2
1 changed files with 11 additions and 0 deletions
11
enetc.go
11
enetc.go
|
|
@ -5,6 +5,7 @@ package enet
|
||||||
// #cgo windows LDFLAGS: -Lenet/ -lenet -lWs2_32 -lWinmm
|
// #cgo windows LDFLAGS: -Lenet/ -lenet -lWs2_32 -lWinmm
|
||||||
// #include <enet/enet.h>
|
// #include <enet/enet.h>
|
||||||
import "C"
|
import "C"
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
// Initialize enet
|
// Initialize enet
|
||||||
func Initialize() {
|
func Initialize() {
|
||||||
|
|
@ -15,3 +16,13 @@ func Initialize() {
|
||||||
func Deinitialize() {
|
func Deinitialize() {
|
||||||
C.enet_deinitialize()
|
C.enet_deinitialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LinkedVersion returns the linked version of enet currently being used.
|
||||||
|
// Returns MAJOR.MINOR.PATCH as a string.
|
||||||
|
func LinkedVersion() string {
|
||||||
|
var version = uint32(C.enet_linked_version())
|
||||||
|
major := uint8(version >> 16)
|
||||||
|
minor := uint8(version >> 8)
|
||||||
|
patch := uint8(version)
|
||||||
|
return fmt.Sprintf("%d.%d.%d", major, minor, patch)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue