Do I need <geom/geom.h> in <geom/gate/g_gate.h> ?

Marcin Cieslak saper at saper.info
Sat Jan 24 02:00:13 UTC 2015


I am trying to write a GEOM gate module 
in C++ - for the project that is already
written 100% in C++ ....

Unfortunately, trying to #include <geom/gate/g_gate.h>
fails:

In file included from GEOMGate.cpp:1:
In file included from /usr/include/geom/gate/g_gate.h:37:
/usr/include/geom/geom.h:118:21: error: expected ';' after struct
        LIST_ENTRY(g_class)     class;
                           ^
/usr/include/geom/geom.h:118:22: error: declaration of anonymous class must be
      a definition
        LIST_ENTRY(g_class)     class;
                                ^
/usr/include/geom/geom.h:131:19: error: expected member name or ';' after
      declaration specifiers
        struct g_class          *class;
        ~~~~~~                   ^
/usr/include/geom/geom.h:186:10: error: expected member name or ';' after
      declaration specifiers
        void                    *private;
        ~~~~                     ^
/usr/include/geom/geom.h:215:10: error: expected member name or ';' after
      declaration specifiers
        void                    *private;
        ~~~~                     ^


I think C++ does not like using "class" in this context.

One idea would be to get rid of this word in <geom/geom.h>;
but I also noticed that including <geom/geom.h> in <geom/gate/g_gate.h>
does not seem necessary at all (as this is the userland interface).

At least our sample ggate userland programs compile fine without it,
and ggate kernel module includes <geom/geom.h> separately.

Would that be ok to remove seemingly unnecessary include directive?

//Marcin

[1] http://thread.gmane.org/gmane.os.freebsd.devel.hackers/52098


More information about the freebsd-hackers mailing list