xf86drm.h : wrap C code for C++ compilation/linking

To enable usage of xf86drm.h from C++ programs/frameworks.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
[ickle: also wrap xf86drmMode.h]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
main
Tapani Pälli 2011-09-23 14:17:42 +03:00 committed by Chris Wilson
parent 194aa1bee6
commit cfee5218b1
2 changed files with 16 additions and 0 deletions

View File

@ -39,6 +39,10 @@
#include <stdint.h> #include <stdint.h>
#include <drm.h> #include <drm.h>
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#ifndef DRM_MAX_MINOR #ifndef DRM_MAX_MINOR
#define DRM_MAX_MINOR 16 #define DRM_MAX_MINOR 16
#endif #endif
@ -723,4 +727,8 @@ extern int drmHandleEvent(int fd, drmEventContextPtr evctx);
extern char *drmGetDeviceNameFromFd(int fd); extern char *drmGetDeviceNameFromFd(int fd);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif #endif

View File

@ -33,6 +33,10 @@
* *
*/ */
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include <drm.h> #include <drm.h>
/* /*
@ -386,3 +390,7 @@ extern int drmModeCrtcGetGamma(int fd, uint32_t crtc_id, uint32_t size,
uint16_t *red, uint16_t *green, uint16_t *blue); uint16_t *red, uint16_t *green, uint16_t *blue);
extern int drmModePageFlip(int fd, uint32_t crtc_id, uint32_t fb_id, extern int drmModePageFlip(int fd, uint32_t crtc_id, uint32_t fb_id,
uint32_t flags, void *user_data); uint32_t flags, void *user_data);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif