]> granicus.if.org Git - ejabberd/commitdiff
Do not check for deprecated types
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Thu, 14 Jun 2018 15:58:35 +0000 (18:58 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Thu, 14 Jun 2018 15:58:35 +0000 (18:58 +0300)
Since we support only Erlang >= OTP-17.5, the check for old-style
dict/queue/etc types is no longer needed

configure.ac
include/type_compat.hrl [deleted file]
m4/erlang-extra.m4
rebar.config
src/ejabberd_bosh.erl
src/eldap.erl
src/mod_delegation.erl
src/mod_irc_connection.erl
src/mod_muc_room.erl
src/mod_privilege.erl
vars.config.in

index 1fe20b6bc77cb45cacc4033237cc634b39515ef8..7972ffdc2c547e68ae2cdd33793f7881d9220ced 100644 (file)
@@ -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 (file)
index bd5129c..0000000
+++ /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.
index f658057b5d344ee31bb68d858ff578dd067c43b7..4a7311bad3c4791517813404fe8ea8f76762130f 100644 (file)
@@ -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 <<EOF
--module(conftest).
-
--record(state, {host = dict:new() :: dict:dict()}).
-EOF
-
-       if $ERLC 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
-])
index 928d4b403a523008878c41bf5763229951a214ec..f4a697038b71c8bdaad949379bf35942bb6024a2 100644 (file)
@@ -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'}},
index b1519aedb82b20ae39779d29442c8a8a428b4f79..7423211baaf6e4fee4ae4b16962838b342c97338 100644 (file)
@@ -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").
          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()}).
index 1f2926f4d350f8073621810d607d781e1cfa4990..fc3b8a29d1a73f507a19c6b1b63e279f0f7d0469 100644 (file)
@@ -65,7 +65,6 @@
 
 -behaviour(p1_fsm).
 
--include("type_compat.hrl").
 -include("logger.hrl").
 
 %% External exports
          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
index 690d41b2f97f2a8d1c15e566dd43eee6767bdfaa..45e44c4979e663ef7b9856144e531a229e972844 100644 (file)
         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
index 78b50a1b9218f6ce968dbf65e5058cb4572224e5..a2837f5276a2d3613334ee41b1f1d4fb1595eb39 100644 (file)
@@ -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(),
index a1cab2236bb48b323402d12dabd91f96d053d8da..edddd13cf4525fdd5729815a50ab3bdd5ef4d2e8 100644 (file)
 -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}}) ->
index 2188169f2e1342e170d7fa84934a2cfd7cde2ca8..5f2fa3297d84047c64108731e402700d55fb8e7f 100644 (file)
         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
index 44dd40c1c6a947194b3ef5de990877816f23f8e6..9878ee2b490c821725e5cf9e678548f975c7f8c8 100644 (file)
@@ -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