Code now runs on Linux for local files
I still need to add the support for message broadcasting tho, it should not be that hard
This commit is contained in:
@@ -51,6 +51,9 @@ func Init(f Reader) (*IBT, error) {
|
||||
return nil, fmt.Errorf("Failed to open memory mapped file: %v", err)
|
||||
}
|
||||
ibt.LiveData = true
|
||||
|
||||
// Here we also need to open the broadcast message thing and the
|
||||
// thing to check if the game is open
|
||||
}
|
||||
|
||||
// Read the file headers
|
||||
|
||||
@@ -81,13 +81,13 @@ type shmi struct {
|
||||
name string
|
||||
fd C.int
|
||||
v unsafe.Pointer
|
||||
size int32
|
||||
size uint32
|
||||
parent bool
|
||||
}
|
||||
|
||||
// create shared memory. return shmi object.
|
||||
// name should not be more than 31 bytes.
|
||||
func create(name string, size int32) (*shmi, error) {
|
||||
func create(name string, size uint32) (*shmi, error) {
|
||||
name = "/" + name
|
||||
|
||||
fd := C.Create(C.CString(name), C.int(size))
|
||||
@@ -106,7 +106,7 @@ func create(name string, size int32) (*shmi, error) {
|
||||
|
||||
// open shared memory. return shmi object.
|
||||
// name should not be more than 31 bytes.
|
||||
func open(name string, size int32) (*shmi, error) {
|
||||
func open(name string, size uint32) (*shmi, error) {
|
||||
name = "/" + name
|
||||
|
||||
fd := C.Open(C.CString(name), C.int(size))
|
||||
|
||||
@@ -74,12 +74,12 @@ type shmi struct {
|
||||
name string
|
||||
fd C.int
|
||||
v unsafe.Pointer
|
||||
size int32
|
||||
size uint32
|
||||
parent bool
|
||||
}
|
||||
|
||||
// create shared memory. return shmi object.
|
||||
func create(name string, size int32) (*shmi, error) {
|
||||
func create(name string, size uint32) (*shmi, error) {
|
||||
name = "/" + name
|
||||
|
||||
fd := C.Create(C.CString(name), C.int(size))
|
||||
@@ -97,7 +97,7 @@ func create(name string, size int32) (*shmi, error) {
|
||||
}
|
||||
|
||||
// open shared memory. return shmi object.
|
||||
func open(name string, size int32) (*shmi, error) {
|
||||
func open(name string, size uint32) (*shmi, error) {
|
||||
name = "/" + name
|
||||
|
||||
fd := C.Open(C.CString(name), C.int(size))
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build windows && cgo
|
||||
// +build windows,cgo
|
||||
|
||||
package sharedMem
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build windows && cgo
|
||||
// +build windows,cgo
|
||||
|
||||
package winutils
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user