Skip to content

Commit

Permalink
hibari >> GH36 - Update for Erlang/OTP 17.x.
Browse files Browse the repository at this point in the history
- Conditionally use namespaced dict and queue types.
- Add "17" to {require_otp_vsn, _}.
  • Loading branch information
tatsuya6502 committed Oct 14, 2014
1 parent 7e79d72 commit 033194a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
14 changes: 9 additions & 5 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
%%% -*- mode: erlang -*-

%% Require OTP version R13B04, R14, R15, or R16
{require_otp_vsn, "R13B04|R14|R15|R16"}.
%% Require OTP version R13B04, R14, R15, R16, or 17
{require_otp_vsn, "R13B04|R14|R15|R16|17"}.

%% Depends
{deps_dir, "../"}.
{deps, [{lager, ".*"}]}.

%% Erlang compiler options
{erl_opts, [debug_info, warnings_as_errors
, {parse_transform, lager_transform}
, {i, "../gmt_util/include/"}
{erl_opts, [%% In Erlang releases after 17, use dict:dict()
%% and queue:queue() for dict() and queue() types.
{platform_define, "^[0-9]+", namespaced_dict_and_queue},
debug_info,
warnings_as_errors,
{parse_transform, lager_transform},
{i, "../gmt_util/include/"}
]}.

%% EUnit options
Expand Down
8 changes: 7 additions & 1 deletion src/congestion_watcher_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).

-ifdef(namespaced_dict_and_queue).
-type cw_dict() :: dict:dict().
-else.
-type cw_dict() :: dict().
-endif.

-record(state, {
config :: string(),
timer_list :: list({ok, reference()}),
hlw_state = dict:new() :: dict()
hlw_state = dict:new() :: cw_dict()
}).

-record(winfo, {
Expand Down

0 comments on commit 033194a

Please sign in to comment.