Problem with rootcint and dirent.h

Hi,

I have some trouble to produce a root dictionary with rootcint over a code calling the dirent.h header.
To illustrate my problem, I simplified my code to the the minimum:

1/ I have a header file “test.h” with only one line:
#include <dirent.h>

2/ I have a LinkDef.h file with only 5 lines:
#ifdef CINT
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#endif

3/ then I use rootcint as follows:
rootcint -f testDict.cc -c -p test.h LinkDef.h

I get an error which I don’t understand (see the end of this post). It refers to the line 535 of /usr/include/dirent.h which doesn’t even exist. I’m using root v5.26.00.
Any idea of what is going on?
Thank you.

Error message:
Error: Too many ‘}’ /usr/include/dirent.h:535:
Error: Missing closing brace for the block opened around line 28.
Error: Unexpected end of file (G__exec_statement()) /tmp/ZG1FPo_cint.cxx:2:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing testDict.cc testDict.h !!!
Error: rootcint: error loading headers…

Hi,

I can not reproduce the problem with v5.26/00f or up but can reproduce it with v5.22. So the problem has been solved in the patch branch of v5.26.

To work around the problem hide dirent.h from CINT:

#ifndef __CINT__ #include <dirent.h> #endif
Cheers,
Philippe.