title: Doxygen - documenting X Macro
body: <p>I'm using Doxygen version 1.8.11 and trying to doc my X macro:</p>
  <pre><code>#define COLOR_VARIABLES\
  COLOR__X(RED /*!&lt; &quot;RED COLOR&quot; */)\
  COLOR__X(BLUE /*!&lt; &quot;BLUE COLOR&quot; */)\
  </code></pre>
  <p>Then I use it in an enum:</p>
  <pre><code>/** COLOR doc */
  typedef enum {
    #define COLOR__X(name) name,
       COLOR_VARIABLES
    #undef COLOR__X
  
  } color;
  </code></pre>
  <p>I have the MACRO_EXPANSION and ENABLE_PREPROCESSING set to YES and the <code>@file</code> at the beginning of my file.</p>
  <p>I'd like the HTML created with the doxygen to show the documentation for each variable defined with the x macro. Can it be done?</p>
  <p><strong>Edit</strong>:</p>
  <p>So after some suggestions here, I noticed that in my doxyfile I have the following configurations:</p>
  <pre><code>MACRO_EXPANSION        = YES
  EXPAND_ONLY_PREDEF     = YES
  ENABLE_PREPROCESSING   = YES
  PREDEFINED             = INNER_FUNC(msg)=
  </code></pre>
  <p>If I change the <code>EXPAND_ONLY_PREDEF</code> to No it will work but it causes other problems in my project. I have tried to do the following options but it didn't work:</p>
  <p>Option 1:</p>
  <pre><code>PREDEFINED             = INNER_FUNC(msg)= /
                          COLOR__X(name)=name, /
                          COLOR__X:=COLOR__X
  </code></pre>
  <p>Option 2:</p>
  <pre><code>EXPAND_AS_DEFINED      = COLOR__X(name) /
                          COLOR__X
  </code></pre>