1
votes

I have a problem with Eclox, the Doxygen plugin for Eclipse.

I use it to document my C/C++ code.

A reaaally nice feature of it is that it auto-generates comments for functions, when writing "/**" followed by an ENTER just before the function's definition.

Initial (code 1):

/** <--pressing enter after this results in code 2-->
int f(int a, int b)

Code after pressing enter (code 2):

/**
 *
 * @param a
 * @param b
 * @return
 */
int f(int a, int b)

The problem is that I use Microsoft's SAL syntax when writing my functions, and f would actually look like:

int f(__in int a, __in int b)

which confuses Eclox, and prevents it from auto-generating the @param & @return stuff. So I'm left with the following:

/**
 *
 */
int f(__in int a, __in int b)

even though __in is defined as empty in an included file:

#define __in

NOTE that if I paste the above define in THE SAME file, it works:

#define __in

/** <--now pressing enter here works as expected-->
int f(__in int a, __in int b)

Did anyone else encounter this problem?

1

1 Answers

2
votes

Kind of solved my problem.

Not a perfect solution, neither a very good one but it does the job so the result is satisfying nonetheless.

In Eclipse: right-click your C/C++ project->Properties->C/C++ General->Paths and Symbols->Symbols->Click the C language (GNU C in my case).

You can add symbols which will be taken-into-account by Eclox there: e.g. adding the symbol __in with an empty value solves the situation exemplified in my original question.

In my case, I would have to add A LOT OF SYMBOLS (as I said I decorate my functions using Microsoft's SAL), which would take a lot of time if done directly from Eclipse. Instead I add just one symbol and click Export Settings which exports them to an XML for which you can make a script to add your entries to and which you can import afterwards by using Import Settings.

Or similarly you can edit your .cproject file directly (I suggest you first backup it), if you wish to add those settings to ALL project configurations at once, just search for you added symbol and you'll find that it's defined there.

Next to Paths and Symbols there is also Preprocessor Include Paths, Macros etc.. You can use that as well, it is setup similarly, with the note that you'd have to add the macros to CDT User Setting Entries. I've tried adding an Include File entry or a Preprocessor Macros File entry instead of adding Preprocessor Macro entries, but it didn't work.