Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8909585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:28:04+00:00 2026-06-15T03:28:04+00:00

I have a lot of code doing conditional compilation based on defines that come

  • 0

I have a lot of code doing conditional compilation based on defines that come from the compiler, not any definitions in the code itself or external headers. For example, quite frequently I have things such as:

#if defined _MSC_VER || defined __ICL
// A lot of freakin code
#elif defined __GNUC__  || defined __ICC
// A bunch more here
#else
#error "Unsupported environment"
#endif

I need to generate documentation for all the code inside the platofm/compiler-specific sections, but I cannot simply set ENABLE_PREPROCESSING to NO because it must be YES for INCLUDE_GRAPH and INCLUDED_GRAPH to work, according to the documentation.

So, how do I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:28:05+00:00Added an answer on June 15, 2026 at 3:28 am

    You’d first have to define a macro DOXYGEN or similar in the “predefined” section of the doxygen configuration. Then you’d have to split up the #elif in separate #if and keep track of the fact that you found one valid configuration.

    #if defined _MSC_VER || defined __ICL || defined DOXYGEN
    #define WE_FOUND_SOME
    // A lot of freakin code
    #endif
    #if defined __GNUC__  || defined __ICC || defined DOXYGEN
    #define WE_FOUND_SOME
    // A bunch more here
    #endif
    #ifndef WE_FOUND_SOME
    # error "Unsupported environment"
    #endif
    

    But beware that if these different parts define the same functions or macros, that doxygen will easily get lost.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am have a lot of code that I need to optimize and make
I have a lot of front-end code that would be more readable if I
I have a lot of C# VS2008 code that looks like this: new SqlParameter(@Description,
I have lot of code in my Tornado app which looks like this: @tornado.web.asynchronous
In my project I have a lot of code like this: int[][] a =
DirectDraw 7 is very old APIs but we have a lot legacy code written
I have just refactored a lot of code out of my AccountController into an
I have a lot of pieces of code which has to be run one
Currently I have a lot of python objects in my code similar to the
On my blog I have a lot of <pre> blocks containing code snippets. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.