<div dir="ltr">On Mon, Sep 21, 2015 at 1:56 PM, zxq9 <span dir="ltr"><<a href="mailto:zxq9@zxq9.com" target="_blank">zxq9@zxq9.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 2015年9月21日 月曜日 14:26:35 Martin Koroudjiev wrote:<br>
> -ifdef(CONTAINING_APP_INCLUDE).<br>
> -include(?CONTAINING_APP_INCLUDE).<br>
> -endif.<br>
><br>
> and to compile the source files as:<br>
><br>
> erlc -Werror -Wall -DCONTAINING_APP_INCLUDE="\"<path>/<file>.hrl\""<br>
> <module>.erl<br>
><br>
> but I get the following error:<br>
><br>
> badly formed 'include'<br>
<br>
</span>I think includes run before macros, so your include is trying to include a very odd-looking thing that starts with a question-mark instead of a filename.<br>
</blockquote><div><br></div><div>Not quite. The -include and -include_lib directives require that the thing between the parentheses is a string literal, so the tokens '?' '<span class="">CONTAINING_APP_INCLUDE' are not even subject to macro expansion in this case. (This could probably be easily fixed, if it is important to anyone.)</span><br> <br></div></div></div></div>