Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb/pull/348#discussion_r40655249
  
    --- Diff: rebar.config.script ---
    @@ -15,6 +15,18 @@
     ConfigureEnv = filename:join(filename:dirname(SCRIPT), "config.erl"),
     os:putenv("COUCHDB_CONFIG", ConfigureEnv).
     
    +OTP_VSN = erlang:system_info(compat_rel),
    +
    +Features = lists:filter(fun({_K, Flag}) -> Flag end, [
    +    {'HAS_CALLBACKS', OTP_VSN > 14}
    +]),
    +
    +Properties = Features ++ [
    +    {'OTP_VSN', OTP_VSN},
    +    {'OTP_RELEASE', erlang:system_info(otp_release)}
    +],
    --- End diff --
    
    The way I see it, we need to define a set of constants in order to make 
version-dependent macros later on. crypto:hash/2 was added in R15B02, for 
example;
    
    ```
    -ifdef(VERSION_15B02_OR_HIGHER).
    -define(HASH(Alg, Data),
        crypto:hash(Alg, Data)).
    -else.
    -define(HASH(Alg, Data),
        case Alg of
                sha -> crypto:sha(Data);
                md5 -> crypto:md5(Data)
        end).
    -endif.
    
    hash(Alg, Data) ->
        ?HASH(Alg, Data).
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to