[erlang-questions] predefined Erlang version macros

Joseph Wayne Norton norton@REDACTED
Tue Jul 2 16:04:50 CEST 2013


Stefan -

I typically use macros with rebar's platform_define feature for such situations.

Here is an example for R14 and old inets behavior (https://github.com/ubf/ubf-jsonrpc/blob/master/rebar.config#L6).

This method is simple but works only at compile-time.

Regards,

Joe N.

On 2013/07/02, at 8:13, "Stefan Jahn" <stefan@REDACTED> wrote:

> Dear Erlang'ers,
> 
> sometimes it would be nice to enable version-dependend code such as
> needed here:
> 
>  %% R16B: use new ssh behaviour
>  %-behaviour(ssh_daemon_channel).
> 
>  %% R15: use old ssh behaviour
>  -behaviour(ssh_channel).
> 
> 
> Is there anything suitable in Erlang?  Or is it unwanted because of
> strict versioning requirements of modules and applications?
> 
> Thank you in advance,
>  Stefan.
> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130702/ae10e8dc/attachment.htm>


More information about the erlang-questions mailing list