Skip to content

Commit

Permalink
Use explicit init on DLL
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Jan 28, 2025
1 parent 0b1bda4 commit d56e04c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/adbc_dll_loader_nif.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ defmodule Adbc.DLLLoaderNif do
# @on_load the order is not guaranteed in a release.
@moduledoc false

@on_load :load_nif
def load_nif do
def init do
case :os.type() do
{:win32, _} ->
priv_dir = :code.priv_dir(:adbc)
Expand Down
2 changes: 1 addition & 1 deletion lib/adbc_nif.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Adbc.Nif do

@on_load :load_nif
def load_nif do
:ok = Adbc.DLLLoaderNif.add_dll_directory()
:ok = Adbc.DLLLoaderNif.init()
nif_file = ~c"#{:code.priv_dir(:adbc)}/adbc_nif"

case :erlang.load_nif(nif_file, 0) do
Expand Down

0 comments on commit d56e04c

Please sign in to comment.