Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed have_callback_support #168

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading