Skip to content

Commit

Permalink
Support making specs with OTP 21+
Browse files Browse the repository at this point in the history
Reverse the check for which versions of OTP to use maps vs. dicts with
to support future OTP releases (assuming no more API changes)
  • Loading branch information
nosnilmot committed Jul 13, 2018
1 parent 75343db commit b6aa9e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rebar.config
Expand Up @@ -24,7 +24,7 @@
{src_dirs, ["src"]},
{platform_define, "^(15|16|17|18)", 'HAVE_REMOTE_TYPES'},
{platform_define, "^(15|16|17)", 'HAVE_FROM_FORM0'},
{platform_define, "^(19\\.3|20)", 'USE_MAPS'}]}.
{platform_define, "^(15|16|17|18|19\\.0|19\\.1|19\\.2)", 'USE_DICT'}]}.
{port_env, [{"CFLAGS", "$CFLAGS"}, {"LDFLAGS", "$LDFLAGS"},
{"freebsd", "CFLAGS", "$CFLAGS -I/usr/local/include"},
{"freebsd","LDFLAGS", "$LDFLAGS -L/usr/local/lib"}]}.
Expand Down
10 changes: 5 additions & 5 deletions src/fxml_gen.erl
Expand Up @@ -2750,14 +2750,14 @@ t_remote(Mod, Type) ->
T.
-endif.
-ifdef(USE_MAPS).
-ifdef(USE_DICT).
dict_from_list(L) ->
maps:from_list(L).
dict:from_list(L).
dict_keys(D) ->
maps:keys(D).
dict:fetch_keys(D).
-else.
dict_from_list(L) ->
dict:from_list(L).
maps:from_list(L).
dict_keys(D) ->
dict:fetch_keys(D).
maps:keys(D).
-endif.

0 comments on commit b6aa9e3

Please sign in to comment.