Skip to content

Commit

Permalink
Merge pull request #168 from ariel-anieli/pr-callback
Browse files Browse the repository at this point in the history
Removed have_callback_support
  • Loading branch information
ferd authored Feb 7, 2024
2 parents 20d049e + eca2d21 commit 7b7d5b5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 39 deletions.
1 change: 0 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
%% Compiler Options ============================================================
{erl_opts,
[{platform_define, "^[0-9]+", namespaced_types},
{platform_define, "^[0-9]+", have_callback_support},
{platform_define, "^2", unicode_str},
{platform_define, "^(R|1|20)", fun_stacktrace},
debug_info,
Expand Down
23 changes: 0 additions & 23 deletions src/ec_dictionary.erl
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
-type key(T) :: T.
-type value(T) :: T.

-ifdef(have_callback_support).

-callback new() -> any().
-callback has_key(key(any()), any()) -> boolean().
-callback get(key(any()), any()) -> any().
Expand All @@ -55,27 +53,6 @@
-callback from_list([{key(any()), value(any())}]) -> any().
-callback keys(any()) -> [key(any())].

-else.

%% In the case where R14 or lower is being used to compile the system
%% we need to export a behaviour info
-export([behaviour_info/1]).
-spec behaviour_info(atom()) -> [{atom(), arity()}] | undefined.
behaviour_info(callbacks) ->
[{new, 0},
{has_key, 2},
{get, 2},
{add, 3},
{remove, 2},
{has_value, 2},
{size, 1},
{to_list, 1},
{from_list, 1},
{keys, 1}];
behaviour_info(_Other) ->
undefined.
-endif.

%%%===================================================================
%%% API
%%%===================================================================
Expand Down
15 changes: 0 additions & 15 deletions src/ec_vsn.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,9 @@
%% however you should not rely on the internal representation here
-type t() :: #t{}.

-ifdef(have_callback_support).

-callback new() -> any().
-callback vsn(any()) -> {ok, string()} | {error, Reason::any()}.

-else.

%% In the case where R14 or lower is being used to compile the system
%% we need to export a behaviour info
-export([behaviour_info/1]).
-spec behaviour_info(atom()) -> [{atom(), arity()}] | undefined.
behaviour_info(callbacks) ->
[{new, 0},
{vsn, 1}];
behaviour_info(_Other) ->
undefined.
-endif.

%%%===================================================================
%%% API
%%%===================================================================
Expand Down

0 comments on commit 7b7d5b5

Please sign in to comment.