Skip to content

Commit 4a36cfc

Browse files
committed
Add support for Erlang 17.
1 parent d6b8602 commit 4a36cfc

File tree

6 files changed

+21
-5
lines changed

6 files changed

+21
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ repl_leader_eqc_data/
1111
tags
1212
dialyzer_unhandled_warnings
1313
dialyzer_warnings
14+
.rebar/

include/riak_repl.hrl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@
5757
-type(repl_np_pairs() :: [repl_np_pair()]).
5858
-type(repl_node_sites() :: {node(), [{repl_sitename(), pid()}]}).
5959
-type(ring() :: tuple()).
60-
-type(repl_config() :: dict()|undefined).
60+
61+
-ifdef(namespaced_types).
62+
-type riak_repl_dict() :: dict:dict().
63+
-else.
64+
-type riak_repl_dict() :: dict().
65+
-endif.
66+
67+
-type(repl_config() :: riak_repl_dict()|undefined).
6168
%% wire_version() is an atom that defines which wire format a binary
6269
%% encoding of one of more riak objects is packaged into. For details of
6370
%% the to_wire() and from_wire() operations, see riak_repl_util.erl.

rebar

43.8 KB
Binary file not shown.

rebar.config

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
%%-*- mode: erlang -*-
22

33
{cover_enabled, true}.
4-
{erl_opts, [debug_info, warnings_as_errors, {parse_transform, lager_transform}]}.
4+
{erl_opts, [debug_info, warnings_as_errors,
5+
{parse_transform, lager_transform},
6+
{platform_define, "^[0-9]+", namespaced_types}]}.
57
{erl_first_files, ["src/gen_leader.erl"]}.
68
{xref_checks, []}.
79
{xref_queries, [{"(XC - UC) || (XU - X - B - cluster_info : Mod)", []}]}.

src/bounded_queue.erl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@
3636
-include_lib("eunit/include/eunit.hrl").
3737
-endif.
3838

39+
-ifdef(namespaced_types).
40+
-type bounded_queue_queue() :: queue:queue().
41+
-else.
42+
-type bounded_queue_queue() :: queue().
43+
-endif.
44+
3945
-record(bq, {
4046
m=0 :: non_neg_integer(), %% maximum size of queue, in bytes.
4147
s=0 :: non_neg_integer(), %% current size of queue, in bytes.
42-
q=queue:new() :: queue(), %% underlying queue.
48+
q=queue:new() :: bounded_queue_queue(), %% underlying queue.
4349
d=0 :: non_neg_integer()} %% dropped item count
4450
).
4551

src/riak_repl_ring.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ ensure_config(Ring) ->
6060
Ring
6161
end.
6262

63-
-spec(get_repl_config/1 :: (ring()) -> dict()|undefined).
63+
-spec(get_repl_config/1 :: (ring()) -> riak_repl_dict()|undefined).
6464
%% @doc Get the replication config dictionary from Ring.
6565
get_repl_config(Ring) ->
6666
case riak_core_ring:get_meta(?MODULE, Ring) of
6767
{ok, RC} -> RC;
6868
undefined -> initial_config()
6969
end.
7070

71-
-spec(set_repl_config/2 :: (ring(), dict()) -> ring()).
71+
-spec(set_repl_config/2 :: (ring(), riak_repl_dict()) -> ring()).
7272
%% @doc Set the replication config dictionary in Ring.
7373
set_repl_config(Ring, RC) ->
7474
riak_core_ring:update_meta(?MODULE, RC, Ring).

0 commit comments

Comments
 (0)