fee71e7740
Feature/postprocessing * tests * passtest * fixshorttests * mosttests * improvingbasedockerfile * testspeeds * testing * host * canparallel * clean * passfullsuite * singlepagemax * test * findfeatures * findstables * tbls * tablestoo * tablestoo * lateraltests * tableloc * cleanup * inlinetable * childids * cleanup * tests
24 lines
395 B
Go
24 lines
395 B
Go
//go:build (!cgo || nocgo) && darwin
|
|
|
|
package fitz
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/ebitengine/purego"
|
|
)
|
|
|
|
const (
|
|
libname = "libmupdf.dylib"
|
|
)
|
|
|
|
// loadLibrary loads the so and panics on error.
|
|
func loadLibrary() uintptr {
|
|
handle, err := purego.Dlopen(libname, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
|
if err != nil {
|
|
panic(fmt.Errorf("cannot load library: %w", err))
|
|
}
|
|
|
|
return uintptr(handle)
|
|
}
|