It works!

For those who encounter a similar problem, I add to my .emacs file :
(add-to-list 'semantic-lex-c-preprocessor-symbol-file "~/work/depends/OpenSceneGraph-2.7.4/include/osg/Export" )

where Export contains all the macro I want.

Now OSG integration seems to works fine but It's quite a pity that semantic doesn't manage to retrieve the macro by itself.

Thanks for all

Julien


2009/1/6 Eric M. Ludlam <eric@siege-engine.com>
>>> "cabieces julien" <jcabieces@free.fr> seems to think that:
>Thanks,
>
>it solves the issue even if it seems to always have problems with elif
>statement and spaces. I'have not really investigate this problem but
>show-unmatched-syntax-error raise an error on elif statement
>
>#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) ||
>defined( __BCPLUSPLUS__)  || defined( __MWERKS__)
>    #  if defined( OSG_LIBRARY_STATIC )
>    #    define OSG_EXPORT
>    #  elif defined( OSG_LIBRARY )
>    #    define OSG_EXPORT   __declspec(dllexport)
>    #  else
>    #    define OSG_EXPORT   __declspec(dllimport)
>    #  endif
>#else
>    #  define OSG_EXPORT
>#endif

I checked in a fix to get this working better.  Elif's weren't handled
well when the extra spaces were involved.  My block skip code also
didn't handle elif well.

>I have a more problematic issue, semantic seems to not recognize macro
>definition which come from an include file.
>
>example:
>Export.h
>#define EXPORT
>
>Toto.h
>#include "Export.h"
>
>class EXPORT toto // <--- error start from here until the class end

You need to add Export.h to your list of headers to derive CPP macros
from, or just add EXPORT into the general table of symbols.

You can use ede-cpp-root (see commentary) to add a symbol to your
project.  Otherwise, customize
semantic-lex-c-preprocessor-symbol-file, or
semantic-lex-c-preprocessor-symbol-map to get going.

This doesn't happen automatically because scanning all the header
files can be very slow, and symbols needed are often rare.

Good Luck
Eric

>{
>...
>}
>
>Thanks
>
>Julien
>
>
>
>
>
>2009/1/6 Eric M. Ludlam <eric@siege-engine.com>
>
>> Hi,
>>
>>  This is a fine forum for that question.  I appear to have forgotten
>> to reply to your post.
>>
>>  It appears that the problem is w/ the spaces in front of the #.  I
>> examined the lexer, and by re-ordering some of the analyzers, got this
>> case to work.
>>
>>  After updating from CVS, everyone should be on the lookout for
>> anomalies in case I got something wrong, but this case should be
>> working fine.
>>
>> Eric
>>
>> >>> "cabieces julien" <jcabieces@free.fr> seems to think that:
>> >Up!
>> >
>> >I just checked out semantic from CVS and I get always the same issue. Is
>> it
>> >a known issue or maybe I don't post in the right mailing list.
>> >
>> >Thanks for replies.
>> >
>> >
>> >2008/12/15 cabieces julien <jcabieces@free.fr>
>> >
>> >> Hi,
>> >>
>> >> I've got problem on macro with semantic when I've multiple ifdef macro
>> >> inclusion.
>> >>
>> >> On following example, all "ifdef BABAR" bloc is tagged like "unmatched
>> >> syntax" using semantic-show-unmatched-syntax.
>> >>
>> >> Example:
>> >>
>> >> #define CLOUG
>> >> #define BABAR
>> >>
>> >> #ifdef CLOUG
>> >>     #ifdef BABAR
>> >>     #define BUBU
>> >>     #endif
>> >> #endif
>> >>
>> >> Thanks
>> >>
>> >> Julien
>>   [ ... ]
>>
>> --
>>          Eric Ludlam:                       eric@siege-engine.com
>>   Siege: www.siege-engine.com          Emacs: http://cedet.sourceforge.net
>>
>>
>

--
         Eric Ludlam:                       eric@siege-engine.com
  Siege: www.siege-engine.com          Emacs: http://cedet.sourceforge.net