Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
fat-fellow committed Jun 27, 2024
1 parent 776873d commit 4599e10
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ install-all: \
install-darwin-arm64 \
install-windows-amd64

install-all-debug: \
install-debug-all: \
install-debug-linux-amd64-musl \
install-debug-android-arm \
install-debug-android-386 \
Expand Down
1 change: 0 additions & 1 deletion go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ all:
build-verify:
CGO_LDFLAGS='-static' GOOS="windows" GOARCH="amd64" CGO_ENABLED="1" CC="x86_64-w64-mingw32-gcc" go build -v main.go
CGO_LDFLAGS='-static' GOOS="linux" GOARCH="amd64" CGO_ENABLED="1" CC="x86_64-linux-musl-gcc" go build -v main.go
//add
CGO_ENABLED="1" gomobile bind -v -target=android -androidapi 26 -o lib.aar github.com/anyproto/tantivy-go/go/tantivy/gomobile
CGO_ENABLED="1" gomobile bind -v -target=ios -o Lib.xcframework github.com/anyproto/tantivy-go/go/tantivy/gomobile
2 changes: 1 addition & 1 deletion go/tantivy/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (i *Index) Search(query string, docsLimit uintptr, withHighlights bool, fie
C.uintptr_t(len(fieldNames)),
cQuery,
&errBuffer,
C.ulong(docsLimit),
pointerCType(docsLimit),
C.bool(withHighlights),
)
if ptr == nil {
Expand Down
2 changes: 1 addition & 1 deletion go/tantivy/schemabuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (b *SchemaBuilder) AddTextField(
cName,
C._Bool(stored),
C._Bool(isText),
C.ulong(indexRecordOption),
pointerCType(indexRecordOption),
cTokenizer,
&errBuffer,
)
Expand Down
8 changes: 8 additions & 0 deletions go/tantivy/typedef_unix32.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build arm || 386

package tantivy

import "C"

type pointerCType = C.uint
type pointerGoType = uint64
8 changes: 8 additions & 0 deletions go/tantivy/typedef_unix64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build (amd64 || arm64) && unix

package tantivy

import "C"

type pointerCType = C.ulong
type pointerGoType = uint64
8 changes: 8 additions & 0 deletions go/tantivy/typedef_win64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build windows

package tantivy

import "C"

type pointerCType = C.ulonglong
type pointerGoType = uint64

0 comments on commit 4599e10

Please sign in to comment.