Skip to content

Commit f93c2d1

Browse files
authored
Perform a PropEr check for Erlang/OTP >= 21 (#226)
Erlang/OTP release 21.0 introduced an OTP_RELEASE macro that is defined to contain the release of the emulator. Use that macro for OTP releases >= 21 instead of the (slightly broken, in PropEr) rebar3 platform_define check.
1 parent 493d61e commit f93c2d1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

include/proper_internal.hrl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@
4646
%% Stacktrace access
4747
%%------------------------------------------------------------------------------
4848

49-
-ifdef(AT_LEAST_21).
50-
-define(STACKTRACE(ErrorType, Error, ErrorStackTrace),
51-
ErrorType:Error:ErrorStackTrace ->).
52-
-else.
49+
-ifndef(OTP_RELEASE). %% introduced in 21
50+
%% cases for Erlang/OTP releases prior to 21
5351
-define(STACKTRACE(ErrorType, Error, ErrorStackTrace),
5452
ErrorType:Error ->
5553
ErrorStackTrace = erlang:get_stacktrace(),).
54+
-else. %% -if (?OTP_RELEASE >= 21)
55+
-define(STACKTRACE(ErrorType, Error, ErrorStackTrace),
56+
ErrorType:Error:ErrorStackTrace ->).
5657
-endif.
5758

5859
%%------------------------------------------------------------------------------

rebar.config

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%%% -*- coding: utf-8 -*-
33
%%% -*- erlang-indent-level: 2 -*-
44
%%% -------------------------------------------------------------------
5-
%%% Copyright 2010-2019 Manolis Papadakis <[email protected]>,
5+
%%% Copyright 2010-2020 Manolis Papadakis <[email protected]>,
66
%%% Eirini Arvaniti <[email protected]>
77
%%% and Kostis Sagonas <[email protected]>
88
%%%
@@ -21,8 +21,8 @@
2121
%%% You should have received a copy of the GNU General Public License
2222
%%% along with PropEr. If not, see <http://www.gnu.org/licenses/>.
2323

24-
%%% Author: Manolis Papadakis
25-
%%% Description: Options for rebar
24+
%%% Author(s): Manolis Papadakis, Kostis Sagonas
25+
%%% Description: Options for rebar/rebar3
2626

2727
%% WARNING: Our version of rebar does NOT automatically report warnings,
2828
%% nor does it add erl_opts to eunit_compile_opts.
@@ -38,8 +38,7 @@
3838
report_warnings, {warn_format,1}, warn_export_vars,
3939
warn_obsolete_guard, warn_unused_import,
4040
warn_missing_spec, warn_untyped_record,
41-
{platform_define, "^2", 'AT_LEAST_20'},
42-
{platform_define, "^2[1-9]", 'AT_LEAST_21'}]}.
41+
{platform_define, "^2", 'AT_LEAST_20'}]}.
4342

4443
{post_hooks, [{clean, "./scripts/clean_doc.sh"}]}.
4544

0 commit comments

Comments
 (0)