One way would be to define a constant at compile-time which version of
Erlang are you running. Then check for it in source and put the right
function/case statement accordingly.
rebar -> erl_opts -> platform_define is one of the ways to define that constant.
--
Motiejus Jakštys
Interesting. How do you know when you are running in dialyzer (i.e.
how would you define that macro)?
--
Motiejus Jakštys
> On Tue, Aug 14, 2012 at 2:04 PM, Magnus Henoch
> <magnus...@erlang-solutions.com> wrote:
>> Zabrane Mickael <zabr...@gmail.com> writes:
>>
>> An advanced variant of that is to define a ?catch_for_dialyzer macro
>> that expands to nothing for normal compilation, and to 'catch' when
>> running Dialyzer.
>
> Interesting. How do you know when you are running in dialyzer (i.e.
> how would you define that macro)?
The only way I know is to have your build system pass different -D flags
for normal compilation and dialyzer.
Regards,
Magnus