Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Modified the erlang module to load `emtn_drv` instead of `emtn`; euni…

…t test passes.
  • Loading branch information...
commit 2e7eed36ebbff39681a85860fc5fdcedda58fe1b 1 parent bbf35f6
@lenards lenards authored
View
0  c_src/emtn_nif.c → c_src/emtn.c
File renamed without changes
View
4 rebar.config
@@ -1,4 +1,4 @@
-{port_specs, [{"priv/emtn_drv.so",["c_src/emtn_nif.c"]}]}.
+{erl_opts, [debug_info, warnings_as_errors]}.
{port_env, [{"DRV_CFLAGS", "$DRV_CFLAGS -O3 -Wall -Wextra -I c_src/mutton"},
{"DRV_LDFLAGS", "$DRV_LDFLAGS c_src/mutton/build/lib/libmutton.a"},
@@ -6,5 +6,7 @@
%% Make sure to link -lstdc++ on Linux, FreeBSD, or Solaris
{"(linux|freebsd|solaris)", "LDFLAGS", "$LDFLAGS -lstdc++"}]}.
+{port_specs, [{"priv/emtn.so",["c_src/*.c"]}]}.
+
{pre_hooks, [{compile, "c_src/build_deps.sh"}]}.
{post_hooks, [{clean, "c_src/build_deps.sh clean"}]}.
View
3  src/emtn.erl
@@ -5,6 +5,7 @@
-on_load(init/0).
+-define(SHAREDLIB, "emtn_drv").
-define(nif_stub, nif_stub_error(?LINE)).
nif_stub_error(Line) ->
erlang:nif_error({nif_not_loaded,module,?MODULE,line,Line}).
@@ -22,7 +23,7 @@ init() ->
Path ->
Path
end,
- erlang:load_nif(filename:join(PrivDir, ?MODULE), 0).
+ erlang:load_nif(filename:join(PrivDir, ?SHAREDLIB), 0).
new() ->
?nif_stub.
Please sign in to comment.
Something went wrong with that request. Please try again.