[erlang-questions] Using -callback with libraries supporting R14 and higher

Loïc Hoguin essen@REDACTED
Wed Feb 20 01:06:17 CET 2013

Learn to say "no" to your users, in this case with a reason similar to "we only support behaviours in R15+". I occasionally receive bug reports about Ranch not building in R14, my answer is "upgrade or fork and fix on your own". May sound harsh, but there's more important work to do, you have to draw the line somewhere. Nobody complained so far.

Anthony Molinaro <anthonym@REDACTED> wrote:

>I recently was asked to add -callback support to a library I maintain
>because someone was getting warnings from dialyzer.  Upon looking into
>it I don't see any way to support both R14 and R15.
>The -callback attribute seems to cause syntax errors with the R14 compiler.
>If you include both with R15 you get an error about how you can't use them
>I know it's possible using a -D flag and some conditional macros, but that
>requires integration with the build system (and despite its wide appeal,
>rebar is not the only game in town, some people use EMakefiles, some
>GNU autotools, etc).
>Does OTP provide some sort of macro definition, similar to say ?MODULE
>which provides the version of OTP?  If not how are other library
>maintainers providing versions for multiple incompatible OTP releases?
>Anthony Molinaro                           <anthonym@REDACTED>
>erlang-questions mailing list

More information about the erlang-questions mailing list