gpp
gpp copied to clipboard
gpp parameter -D<var>=<value> appears to always be 1
Input testfile input.md
<#ifdef vara>testa<#else>testb<#endif>
<#if varb>x<#else>y<#endif>
Terminal Output
$ cat input.md | gpp -H -Dvara -Dvarb=1
testa
x
$ cat input.md | gpp -H -Dvarb=0
testb
x
$ gpp --version
GPP 2.24
Copyright (C) 1996-2001 Denis Auroux
Copyright (C) 2003, 2004 Tristan Miller
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Thanks for the report. I think I understand what you are saying about the behaviour of <#if varb>x<#else>y<#endif>
, but what is the problem with <#ifdef vara>testa<#else>testb<#endif>
? Could you please tell me the expected behaviour for both invocations?
Been a while, but I think there is no issues with #ifdef
commands, just #if
only. I was only posting it to contrast its behaviour with eachother I think