Menu

Doxygen preprocessing: #ifdef doesn't work in complex inclusion

Yaroslav
2017-05-29
2017-05-29
  • Yaroslav

    Yaroslav - 2017-05-29

    In C pseudo code below b and c variables will be documented by doxygen, but a - will not. But as we know, this code will be work, because second.h will be included before first.h

    first.h

    ..    
    #define MY_MACRO
    ..
    

    second.h

    ..
    #ifdef MY_MACRO
    int a;
    #endif
    ..
    

    all.h

    #include first.h
    ..
    #include second.h
    ..
    #ifdef MY_MACRO
    int b;
    #endif
    

    all.c

    #include all.h
    ..
    #ifdef MY_MACRO
    int c;
    #endif
    

    Is it possible to solve this problem, given that the C project is complex and contains a lot of such cases. (it will be work if second.h will #include first.h, but it seems that this is not the best idea, because there is a lot of files such as first.h and such as second.h too and a lot of dependencies)

     
  • Yaroslav

    Yaroslav - 2017-05-29

    in attachment well known project - grbl (ported to stm32) and doxygen config file

     

    Last edit: Yaroslav 2017-05-29

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.