Re: preprocessor symbol map incorrect

Eric Ludlam <[email protected]> Tue, 10 Feb 2015 20:39:46 -0500
Newsgroups gmane.emacs.semantic
Message-ID <[email protected]>
On 02/10/2015 07:26 AM, RJD wrote:
> Eric Ludlam <eric <at> siege-engine.com> writes:
>
>> There is a bug in hideif that broke #if parsing in semantic for some
>> versions of Emacs.  I think it is 24.4 and later?
>>
>> You may just be out of luck for a little while, or you could use emacs
>> 24.3 which is what I have default w/ ubuntu, and which worked fine for
>> your example.
>>
>> I also tried this in emacs 25, and none of the expressions worked.
>>
>> Eric
>
> Eric, thank you for your reply however I can confirm that for me this test
> does not work on emacs version 24.3.1 Windows build using cedet version from
> ~~ 26th January.
>
> This is the exact code:
>
> === CODE ===
> #include <iostream>
>
> #define WITH_TESTS
> #define SW_VERSION 22
>
> int main ( void ) {
>
> #if ( SW_VERSION >= 22 )
>     std::cout << "Version 22" << std::endl;
> #endif /* ( SW_VERSION >= 22 ) */
>
> #if defined ( WITH_TESTS )
>     std::cout << "WITH_TESTS" << std::endl;
> #endif /* define ( WITH_TESTS ) */
>
>     return 0;
> }
>
> #if ( SW_VERSION >= 22 ) &&  ( defined( UNIT_TESTS ) )
> void someFunc( void ) {
>     return 1;
> }
> #endif /* ( SW_VERSION >= 22 ) */
> =ENDCODE ===

This is because you:

#define WITH_TESTS

but check for UNIT_TESTS.

If I #define UNIT_TESTS then it works in my 24.3.

Eric

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/