Advertising (This ad goes away for registered users. You can Login or Register)

Doxygen problems with preprocessor

Programming on your favorite platform, for your favorite platform? Post here
Post Reply
dj51_Shura
Posts: 36
Joined: Thu Jun 16, 2011 7:35 pm
Location: Granada, Spain
Contact:

Doxygen problems with preprocessor

Post by dj51_Shura » Wed Sep 28, 2011 4:27 pm

Hi everybody! I'm writing a library with some files, and, of course, I have to use the C preprocessor sentences to avoid problems with functions-redefinitions. The gcc compiler works perfect with the code, really cool, but the Doxygen's preprocessor have some problems.

I will try to explain it as good as I can. I have three headers with *utilities* for the library. Boolean, strings and maths. Each one has a #ifndef and #endif sentence like this:

Code: Select all

#ifndef __STRUTILITIES_H
#define __STRUTILITIES_H

// #include <string.h>

// char * strenc( /* blah blah blah */ );

/* blah blah blah, blah blah blah */

#endif
The inclusion of those headers (strutilities.h, boolean.h and mutilities.h) is managed by the library-main-header, ioutilib.h, which also uses #ifndef and #endif sentences...

Code: Select all

#ifndef __IOUTILIB_L
#define __IOUTILIB_L

#include <boolean.h>
#include <strutilities.h>
#include <mutilities.h>

/* Include the File Input/Output Header */
#include <ioutilities.h>

/* Include the Ini File Parser Header*/
#include <iniutilities.h>

/* Include the db-utils header */
#include <dbutils.h>

#endif
Ok. But, what happens with the last three headers? Those are compound-headers, because they uses the functions defined in the utilities-headers (the three first). They have #ifndef and #endif sentences to avoid problems if the utilities-headers are not included. This is an example:

Code: Select all

#ifdef __IOUTILIB_L && __STRUTILITIES_H

#ifndef __IOUTILITIES_H
#define __IOUTILITIES_H

/* Code and functions */

#endif
The ioutilities.h header only "works" if the strutilities.h header is included. And, if the header is already included, not re-definition. Simple...

But, the problem, is that Doxygen doesn't keep the '__STRUTILITIES_H' macro defined in strutilities.h the first time it's included. And, because of that, Doxygen cannot work and doesn't produce documentation for ioutilities.h, iniutilities.h, dbutils.h... etc...

Can anybody help me? I have tested out the options of the Preprocessor section of the Doxywizard (:3) but just doesn't seems to work.
Advertising
PSP 6.20 PRO-B7 and TN HEN E Fix firmware

http://www.mhypnok.blogspot.com

Post Reply

Return to “Programming”