Xorg can not use C++ code with xf86.h, xf86_OSproc.h, xf86Cursor.h, cursorstr.h and others included
Xorg use some C++ reserved names such as class, bool and private as variable names and it causes conflicts.
In file included from /home/twaik/xf86-video-dummy/src/dummy_cursor.cpp:6:
In file included from /home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86.h:44:
In file included from /home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86str.h:39:
/home/twaik/xorg-server-1.20.1/include/scrnintstr.h:68:11: error: declaration of anonymous class must be a
definition
short class;
^
/home/twaik/xorg-server-1.20.1/include/scrnintstr.h:68:5: warning: declaration does not declare anything
[-Wmissing-declarations]
short class;
^~~~~
In file included from /home/twaik/xf86-video-dummy/src/dummy_cursor.cpp:6:
In file included from /home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86.h:44:
In file included from /home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86str.h:40:
/home/twaik/xorg-server-1.20.1/include/pixmapstr.h:59:19: error: declaration of anonymous class must be a
definition
unsigned char class; /* specific to type */
^
/home/twaik/xorg-server-1.20.1/include/pixmapstr.h:59:5: warning: declaration does not declare anything
[-Wmissing-declarations]
unsigned char class; /* specific to type */
^~~~~~~~~~~~~
In file included from /home/twaik/xf86-video-dummy/src/dummy_cursor.cpp:6:
In file included from /home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86.h:44:
In file included from /home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86str.h:41:
/home/twaik/xorg-server-1.20.1/include/colormapst.h:91:11: error: declaration of anonymous class must be a
definition
short class; /* PseudoColor or DirectColor */
^
/home/twaik/xorg-server-1.20.1/include/colormapst.h:91:5: warning: declaration does not declare anything
[-Wmissing-declarations]
short class; /* PseudoColor or DirectColor */
^~~~~
In file included from /home/twaik/xf86-video-dummy/src/dummy_cursor.cpp:6:
In file included from /home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86.h:44:
In file included from /home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86str.h:43:
/home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86Opt.h:44:10: error: cannot combine with previous
'type-name' declaration specifier
Bool bool;
^
/home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86Opt.h:44:5: warning: declaration does not declare
anything [-Wmissing-declarations]
Bool bool;
^~~~~~~~~
In file included from /home/twaik/xf86-video-dummy/src/dummy_cursor.cpp:6:
In file included from /home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86.h:44:
/home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86str.h:482:52: error: expected ')'
typedef void (*EntityProc) (int entityIndex, void *private);
^
/home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86str.h:482:28: note: to match this '('
typedef void (*EntityProc) (int entityIndex, void *private);
^
In file included from /home/twaik/xf86-video-dummy/src/dummy_cursor.cpp:6:
/home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86.h:127:56: error: expected ')'
void *private);
^
/home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86.h:121:49: note: to match this '('
extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
^
/home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86.h:332:62: error: expected ')'
EntityProc enter, EntityProc leave, void *private);
^
/home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86.h:330:19: note: to match this '('
xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
^
In file included from /home/twaik/xf86-video-dummy/src/dummy_cursor.cpp:12:
In file included from /home/twaik/xf86-video-dummy/src/dummy.h:11:
/home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86xv.h:116:11: error: declaration of anonymous class
must be a definition
short class;
^
/home/twaik/xorg-server-1.20.1/hw/xfree86/common/xf86xv.h:116:5: warning: declaration does not declare
anything [-Wmissing-declarations]
short class;
^~~~~
5 warnings and 8 errors generated.