Skip to content

Commit

Permalink
introduce version switch, to make dialyzer rather happy
Browse files Browse the repository at this point in the history
  • Loading branch information
kuenishi committed Apr 25, 2014
1 parent 2c9bd52 commit de68a10
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions rebar.config.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
case erlang:system_info(otp_release) of

[$R|_] ->
%% Rxx < 17.0, not border inclusive
HashDefine = [{d,pre17}],
case lists:keysearch(erl_opts, 1, CONFIG) of
{value, {erl_opts, Opts}} ->
lists:keyreplace(erl_opts,1,CONFIG,{erl_opts,Opts++HashDefine});
false ->
CONFIG ++ [{erl_opts, HashDefine}]
end;

_ ->
%% "17", our future with map
CONFIG

end.
6 changes: 6 additions & 0 deletions src/riak_pb_kv_codec.erl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@
-type quorum() :: symbolic_quorum() | non_neg_integer().
-type symbolic_quorum() :: one | quorum | all | default.
-type value() :: binary().

-ifdef(pre17).
-type metadata() :: dict().
-else.
-type metadata() :: dict:dict(binary(), binary()).
-endif.

-type contents() :: [{metadata(), value()}].

%% @doc Convert a list of object {MetaData,Value} pairs to protocol
Expand Down

0 comments on commit de68a10

Please sign in to comment.