diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2018-12-13 13:45:45 +0300 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2018-12-13 13:46:53 +0300 |
commit | c88a2d056968254cdb513d81e133d45484a6236a (patch) | |
tree | 938033a3e7c5dae5b1e1edefc8d5dafeacb50efe /include | |
parent | 34ac21e66b16a82094e3ce0f6b3f61916daca0c9 (diff) |
Add code for handling deprecations of get_stacktrace()
Diffstat (limited to 'include')
-rw-r--r-- | include/ejabberd_stacktrace.hrl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/ejabberd_stacktrace.hrl b/include/ejabberd_stacktrace.hrl new file mode 100644 index 000000000..470abed15 --- /dev/null +++ b/include/ejabberd_stacktrace.hrl @@ -0,0 +1,27 @@ +%%%---------------------------------------------------------------------- +%%% +%%% 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(DEPRECATED_GET_STACKTRACE). +-define(EX_RULE(Class, Reason, Stack), Class:Reason:Stack). +-define(EX_STACK(Stack), Stack). +-else. +-define(EX_RULE(Class, Reason, _), Class:Reason). +-define(EX_STACK(_), erlang:get_stacktrace()). +-endif. |