diff --git a/configure.ac b/configure.ac index 1fe20b6bc..7972ffdc2 100644 --- a/configure.ac +++ b/configure.ac @@ -275,8 +275,6 @@ if test "$ENABLEGROUP" != ""; then AC_SUBST([INSTALLGROUP], [$ENABLEGROUP]) fi -ERLANG_DEPRECATED_TYPES_CHECK - if test "$sqlite" = "true"; then AX_LIB_SQLITE3([3.6.19]) if test "x$SQLITE3_VERSION" = "x"; then diff --git a/include/type_compat.hrl b/include/type_compat.hrl deleted file mode 100644 index bd5129c41..000000000 --- a/include/type_compat.hrl +++ /dev/null @@ -1,35 +0,0 @@ -%%%---------------------------------------------------------------------- -%%% -%%% ejabberd, Copyright (C) 2002-2018 ProcessOne -%%% -%%% This program is free software; you can redistribute it and/or -%%% modify it under the terms of the GNU General Public License as -%%% published by the Free Software Foundation; either version 2 of the -%%% License, or (at your option) any later version. -%%% -%%% This program is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -%%% General Public License for more details. -%%% -%%% You should have received a copy of the GNU General Public License along -%%% with this program; if not, write to the Free Software Foundation, Inc., -%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -%%% -%%%---------------------------------------------------------------------- - --ifdef(ERL_DEPRECATED_TYPES). - --define(TDICT, dict()). --define(TGB_TREE, gb_tree()). --define(TGB_SET, gb_set()). --define(TQUEUE, queue()). - --else. - --define(TDICT, dict:dict()). --define(TGB_TREE, gb_trees:tree()). --define(TGB_SET, gb_sets:set()). --define(TQUEUE, queue:queue()). - --endif. diff --git a/m4/erlang-extra.m4 b/m4/erlang-extra.m4 index f658057b5..4a7311bad 100644 --- a/m4/erlang-extra.m4 +++ b/m4/erlang-extra.m4 @@ -84,20 +84,3 @@ EOF AC_MSG_RESULT([ok]) fi ]) dnl ERLANG_VERSION_CHECK - -AC_DEFUN([ERLANG_DEPRECATED_TYPES_CHECK], -[ AC_MSG_CHECKING([whether Erlang is using deprecated types]) - cat > conftest.erl < /dev/null 2>&1; then - AC_MSG_RESULT([no]) - AC_SUBST(erlang_deprecated_types, false) - else - AC_MSG_RESULT([yes]) - AC_SUBST(erlang_deprecated_types, true) - fi -]) diff --git a/rebar.config b/rebar.config index 928d4b403..f4a697038 100644 --- a/rebar.config +++ b/rebar.config @@ -96,7 +96,6 @@ {if_var_true, roster_gateway_workaround, {d, 'ROSTER_GATWAY_WORKAROUND'}}, {if_var_match, db_type, mssql, {d, 'mssql'}}, {if_var_true, elixir, {d, 'ELIXIR_ENABLED'}}, - {if_var_true, erlang_deprecated_types, {d, 'ERL_DEPRECATED_TYPES'}}, {if_have_fun, {crypto, strong_rand_bytes, 1}, {d, 'STRONG_RAND_BYTES'}}, {if_have_fun, {rand, uniform, 1}, {d, 'RAND_UNIFORM'}}, {if_have_fun, {gb_sets, iterator_from, 2}, {d, 'GB_SETS_ITERATOR_FROM'}}, diff --git a/src/ejabberd_bosh.erl b/src/ejabberd_bosh.erl index b1519aedb..7423211ba 100644 --- a/src/ejabberd_bosh.erl +++ b/src/ejabberd_bosh.erl @@ -44,7 +44,6 @@ handle_sync_event/4, handle_info/3, terminate/3, code_change/4]). --include("type_compat.hrl"). -include("logger.hrl"). -include("xmpp.hrl"). -include("ejabberd_http.hrl"). @@ -100,8 +99,8 @@ prev_key = <<"">> :: binary(), prev_poll :: erlang:timestamp() | undefined, max_concat = unlimited :: unlimited | non_neg_integer(), - responses = gb_trees:empty() :: ?TGB_TREE, - receivers = gb_trees:empty() :: ?TGB_TREE, + responses = gb_trees:empty() :: gb_trees:tree(), + receivers = gb_trees:empty() :: gb_trees:tree(), shaped_receivers :: p1_queue:queue(), ip :: inet:ip_address(), max_requests = 1 :: non_neg_integer()}). diff --git a/src/eldap.erl b/src/eldap.erl index 1f2926f4d..fc3b8a29d 100644 --- a/src/eldap.erl +++ b/src/eldap.erl @@ -65,7 +65,6 @@ -behaviour(p1_fsm). --include("type_compat.hrl"). -include("logger.hrl"). %% External exports @@ -139,8 +138,8 @@ passwd = <<"">> :: binary(), id = 0 :: non_neg_integer(), bind_timer = make_ref() :: reference(), - dict = dict:new() :: ?TDICT, - req_q = queue:new() :: ?TQUEUE}). + dict = dict:new() :: dict:dict(), + req_q = queue:new() :: queue:queue()}). %%%---------------------------------------------------------------------- %%% API diff --git a/src/mod_delegation.erl b/src/mod_delegation.erl index 690d41b2f..45e44c497 100644 --- a/src/mod_delegation.erl +++ b/src/mod_delegation.erl @@ -40,13 +40,12 @@ disco_local_features/5, disco_sm_features/5, disco_local_identity/5, disco_sm_identity/5]). --include("type_compat.hrl"). -include("logger.hrl"). -include("xmpp.hrl"). -type disco_acc() :: {error, stanza_error()} | {result, [binary()]} | empty. -record(state, {server_host = <<"">> :: binary(), - delegations = dict:new() :: ?TDICT}). + delegations = dict:new() :: dict:dict()}). -type state() :: #state{}. %%%=================================================================== @@ -222,7 +221,7 @@ code_change(_OldVsn, State, _Extra) -> %%%=================================================================== %%% Internal functions %%%=================================================================== --spec get_delegations(binary()) -> ?TDICT. +-spec get_delegations(binary()) -> dict:dict(). get_delegations(Host) -> Proc = gen_mod:get_module_proc(Host, ?MODULE), try gen_server:call(Proc, get_delegations) of diff --git a/src/mod_irc_connection.erl b/src/mod_irc_connection.erl index 78b50a1b9..a2837f527 100644 --- a/src/mod_irc_connection.erl +++ b/src/mod_irc_connection.erl @@ -39,7 +39,6 @@ handle_sync_event/4, handle_info/3, terminate/3, code_change/4]). --include("type_compat.hrl"). -include("logger.hrl"). -include("xmpp.hrl"). @@ -57,7 +56,7 @@ ident = <<"">> :: binary(), realname = <<"">> :: binary(), nick = <<"">> :: binary(), - channels = dict:new() :: ?TDICT, + channels = dict:new() :: dict:dict(), nickchannel :: binary() | undefined, webirc_password :: binary(), mod = mod_irc :: atom(), diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index a1cab2236..edddd13cf 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -83,10 +83,10 @@ -callback set_affiliation(binary(), binary(), binary(), jid(), affiliation(), binary()) -> ok | {error, any()}. -callback set_affiliations(binary(), binary(), binary(), - ?TDICT) -> ok | {error, any()}. + dict:dict()) -> ok | {error, any()}. -callback get_affiliation(binary(), binary(), binary(), binary(), binary()) -> {ok, affiliation()} | {error, any()}. --callback get_affiliations(binary(), binary(), binary()) -> {ok, ?TDICT} | {error, any()}. +-callback get_affiliations(binary(), binary(), binary()) -> {ok, dict:dict()} | {error, any()}. -callback search_affiliation(binary(), binary(), binary(), affiliation()) -> {ok, [{ljid(), {affiliation(), binary()}}]} | {error, any()}. @@ -1106,7 +1106,7 @@ close_room_if_temporary_and_empty(StateData1) -> _ -> {next_state, normal_state, StateData1} end. --spec get_users_and_subscribers(state()) -> ?TDICT. +-spec get_users_and_subscribers(state()) -> dict:dict(). get_users_and_subscribers(StateData) -> OnlineSubscribers = ?DICT:fold( fun(LJID, _, Acc) -> @@ -1291,7 +1291,7 @@ set_affiliation_fallback(JID, Affiliation, StateData, Reason) -> end, StateData#state{affiliations = Affiliations}. --spec set_affiliations(?TDICT, state()) -> state(). +-spec set_affiliations(dict:dict(), state()) -> state(). set_affiliations(Affiliations, #state{config = #config{persistent = false}} = StateData) -> set_affiliations_fallback(Affiliations, StateData); @@ -1307,7 +1307,7 @@ set_affiliations(Affiliations, StateData) -> set_affiliations_fallback(Affiliations, StateData) end. --spec set_affiliations_fallback(?TDICT, state()) -> state(). +-spec set_affiliations_fallback(dict:dict(), state()) -> state(). set_affiliations_fallback(Affiliations, StateData) -> StateData#state{affiliations = Affiliations}. @@ -1370,7 +1370,7 @@ do_get_affiliation_fallback(JID, StateData) -> end end. --spec get_affiliations(state()) -> ?TDICT. +-spec get_affiliations(state()) -> dict:dict(). get_affiliations(#state{config = #config{persistent = false}} = StateData) -> get_affiliations_callback(StateData); get_affiliations(StateData) -> @@ -1385,7 +1385,7 @@ get_affiliations(StateData) -> Affiliations end. --spec get_affiliations_callback(state()) -> ?TDICT. +-spec get_affiliations_callback(state()) -> dict:dict(). get_affiliations_callback(StateData) -> StateData#state.affiliations. @@ -4385,7 +4385,7 @@ wrap(From, To, Packet, Node) -> %% JIDs = [ User#user.jid || {_, User} <- ?DICT:to_list(Users)], %% ejabberd_router_multicast:route_multicast(From, Server, JIDs, Packet). --spec send_wrapped_multiple(jid(), ?TDICT, stanza(), binary(), state()) -> ok. +-spec send_wrapped_multiple(jid(), dict:dict(), stanza(), binary(), state()) -> ok. send_wrapped_multiple(From, Users, Packet, Node, State) -> lists:foreach( fun({_, #user{jid = To}}) -> diff --git a/src/mod_privilege.erl b/src/mod_privilege.erl index 2188169f2..5f2fa3297 100644 --- a/src/mod_privilege.erl +++ b/src/mod_privilege.erl @@ -39,12 +39,11 @@ roster_access/2, process_message/1, process_presence_out/1, process_presence_in/1]). --include("type_compat.hrl"). -include("logger.hrl"). -include("xmpp.hrl"). -record(state, {server_host = <<"">> :: binary(), - permissions = dict:new() :: ?TDICT}). + permissions = dict:new() :: dict:dict()}). %%%=================================================================== %%% API diff --git a/vars.config.in b/vars.config.in index 44dd40c1c..9878ee2b4 100644 --- a/vars.config.in +++ b/vars.config.in @@ -24,7 +24,6 @@ {db_type, @db_type@}. {debug, @debug@}. {hipe, @hipe@}. -{erlang_deprecated_types, @erlang_deprecated_types@}. {new_sql_schema, @new_sql_schema@}. %% Ad-hoc directories with source files