Skip to content

Commit

Permalink
Create nif path using function instead of concatenation.
Browse files Browse the repository at this point in the history
  • Loading branch information
msantos committed Mar 9, 2010
1 parent af1470c commit 0507a43
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/crypt.erl
Expand Up @@ -32,14 +32,19 @@

-export([crypt/2]).

-define(NIF, "priv/crypt").

-on_load(on_load/0).


on_load() ->
Lib = filename:dirname(code:which(?MODULE)) ++ "/../" ++ ?NIF,
Lib = filename:join([
filename:dirname(code:which(?MODULE)),
"..",
"priv",
?MODULE
]),
erlang:load_nif(Lib, 0).

crypt(_,_) ->
erlang:error(not_implemented).


0 comments on commit 0507a43

Please sign in to comment.