diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4853736..1402932 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,10 +12,10 @@ jobs: - uses: actions/checkout@v2 # using actions/setup-go@v1 is the only way to get macos build to work. # otherwise, with v2, would get this cgo error: 'cgo-generated-wrappers:13:13: error: redefinition of 'free' as different kind of symbol' - - name: Set up Go 1.17 + - name: Set up Go 1.20 uses: actions/setup-go@v1 with: - go-version: 1.17 + go-version: 1.20 - run: make loadable - uses: actions/upload-artifact@v3 with: @@ -46,10 +46,10 @@ jobs: - uses: actions/checkout@v2 # using actions/setup-go@v1 is the only way to get macos build to work. # otherwise, with v2, would get this cgo error: 'cgo-generated-wrappers:13:13: error: redefinition of 'free' as different kind of symbol' - - name: Set up Go 1.17 + - name: Set up Go 1.20 uses: actions/setup-go@v1 with: - go-version: 1.17 + go-version: 1.20 - run: make loadable - uses: actions/upload-artifact@v3 with: @@ -81,10 +81,10 @@ jobs: - uses: actions/checkout@v2 # using actions/setup-go@v1 is the only way to get macos build to work. # otherwise, with v2, would get this cgo error: 'cgo-generated-wrappers:13:13: error: redefinition of 'free' as different kind of symbol' - - name: Set up Go 1.17 + - name: Set up Go 1.20 uses: actions/setup-go@v1 with: - go-version: 1.17 + go-version: 1.20 - run: make loadable - uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 13f1ba7..b731de3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,16 +7,15 @@ jobs: - uses: actions/checkout@v2 # using actions/setup-go@v1 is the only way to get macos build to work. # otherwise, with v2, would get this cgo error: 'cgo-generated-wrappers:13:13: error: redefinition of 'free' as different kind of symbol' - - name: Set up Go 1.17 + - name: Set up Go 1.20 uses: actions/setup-go@v1 with: - go-version: 1.17 + go-version: 1.20 - run: make loadable - uses: actions/upload-artifact@v3 with: name: sqlite-html-linux_x86 path: dist/html0.so - build-linux_x86-python: runs-on: ubuntu-20.04 needs: [build-linux_x86-extension] @@ -80,10 +79,10 @@ jobs: - uses: actions/checkout@v2 # using actions/setup-go@v1 is the only way to get macos build to work. # otherwise, with v2, would get this cgo error: 'cgo-generated-wrappers:13:13: error: redefinition of 'free' as different kind of symbol' - - name: Set up Go 1.17 + - name: Set up Go 1.20 uses: actions/setup-go@v1 with: - go-version: 1.17 + go-version: 1.20 - run: make loadable - uses: actions/upload-artifact@v3 with: @@ -154,10 +153,10 @@ jobs: - uses: actions/checkout@v2 # using actions/setup-go@v1 is the only way to get macos build to work. # otherwise, with v2, would get this cgo error: 'cgo-generated-wrappers:13:13: error: redefinition of 'free' as different kind of symbol' - - name: Set up Go 1.17 + - name: Set up Go 1.20 uses: actions/setup-go@v1 with: - go-version: 1.17 + go-version: 1.20 - run: make loadable - uses: actions/upload-artifact@v3 with: diff --git a/deno/mod.ts b/deno/mod.ts index 9ce7e12..9d36960 100644 --- a/deno/mod.ts +++ b/deno/mod.ts @@ -51,7 +51,7 @@ export function getLoadablePath(): string { /** * Entrypoint name for the sqlite-html extension. */ -export const entrypoint = "sqlite3_extension_init"; +export const entrypoint = "sqlite3_html_init"; interface Db { // after https://deno.land/x/sqlite3@0.8.0/mod.ts?s=Database#method_loadExtension_0 diff --git a/shared.no b/shared.c similarity index 87% rename from shared.no rename to shared.c index a68cb1f..0830c00 100644 --- a/shared.no +++ b/shared.c @@ -4,6 +4,9 @@ SQLITE_EXTENSION_INIT3 extern int go_sqlite3_extension_init(const char*, sqlite3*, char**); +#ifdef _WIN32 +__declspec(dllexport) +#endif int sqlite3_html_init(sqlite3* db, char** pzErrMsg, const sqlite3_api_routines *pApi) { SQLITE_EXTENSION_INIT2(pApi) return go_sqlite3_extension_init("html", db, pzErrMsg); diff --git a/shared.go b/shared.go index 449391a..b0e4567 100644 --- a/shared.go +++ b/shared.go @@ -4,12 +4,12 @@ import ( "go.riyazali.net/sqlite" ) -/// // following linker flags are needed to suppress missing symbol warning in intermediate stages -/// -/// // #cgo linux LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files -/// // #cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup -/// // #cgo windows LDFLAGS: -lsqlite3 -/// import "C" +// following linker flags are needed to suppress missing symbol warning in intermediate stages + +// #cgo linux LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files +// #cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup +// #cgo windows LDFLAGS: -Wl,--allow-multiple-definition +import "C" // Set in Makefile var ( @@ -40,7 +40,7 @@ func Register(api *sqlite.ExtensionApi) (sqlite.ErrorCode, error) { } func init() { - //sqlite.RegisterNamed("html", Register) + sqlite.RegisterNamed("html", Register) sqlite.Register(Register) }