Define 'Otherwise' macro

This commit is contained in:
Feng Lee 2019-07-13 12:25:25 +08:00
parent f4a753f683
commit dfa2c2370e
3 changed files with 11 additions and 3 deletions

View File

@ -17,6 +17,12 @@
-ifndef(EMQ_X_HRL). -ifndef(EMQ_X_HRL).
-define(EMQ_X_HRL, true). -define(EMQ_X_HRL, true).
%%--------------------------------------------------------------------
%% Common
%%--------------------------------------------------------------------
-define(Otherwise, true).
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% Banner %% Banner
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------

View File

@ -1,4 +1,5 @@
%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %%--------------------------------------------------------------------
%% Copyright (c) 2019 EMQ Technologies Co., Ltd. All Rights Reserved.
%% %%
%% Licensed under the Apache License, Version 2.0 (the "License"); %% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License. %% you may not use this file except in compliance with the License.
@ -11,6 +12,7 @@
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and %% See the License for the specific language governing permissions and
%% limitations under the License. %% limitations under the License.
%%--------------------------------------------------------------------
%% debug | info | notice | warning | error | critical | alert | emergency %% debug | info | notice | warning | error | critical | alert | emergency
@ -43,3 +45,4 @@
begin begin
(logger:log(Level,#{},#{report_cb => fun(_) -> {'$logger_header'()++(Format), (Args)} end})) (logger:log(Level,#{},#{report_cb => fun(_) -> {'$logger_header'()++(Format), (Args)} end}))
end). end).

View File

@ -14,8 +14,6 @@
%% limitations under the License. %% limitations under the License.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
-define(Otherwise, true).
-type(maybe(T) :: undefined | T). -type(maybe(T) :: undefined | T).
-type(startlink_ret() :: {ok, pid()} | ignore | {error, term()}). -type(startlink_ret() :: {ok, pid()} | ignore | {error, term()}).
@ -23,3 +21,4 @@
-type(ok_or_error(Reason) :: ok | {error, Reason}). -type(ok_or_error(Reason) :: ok | {error, Reason}).
-type(ok_or_error(Value, Reason) :: {ok, Value} | {error, Reason}). -type(ok_or_error(Value, Reason) :: {ok, Value} | {error, Reason}).