-ifndef(GUAM_COMPAT_HRL).

-ifdef(OTP_RELEASE). %% this implies OTP 21 or higher
    -define(COMPAT_CATCH(Class, Reason, Stacktrace), Class:Reason:Stacktrace).
    -define(COMPAT_GET_STACKTRACE(Stacktrace), Stacktrace).

    -define(GUAM_OTP_21, 1).
    % This is how we could detect higher otp versions
    % -if(?OTP_RELEASE >= 23).
    %     -define(GUAM_OTP_23, 1).
    % -endif.
-else.
    -define(COMPAT_CATCH(Class, Reason, _), Class:Reason).
    -define(COMPAT_GET_STACKTRACE(_), erlang:get_stacktrace()).
-endif.

-define(GUAM_COMPAT_HRL, 1).

-endif.
