OSDN Git Service

xf86drm.h : wrap C code for C++ compilation/linking
authorTapani Pälli <tapani.palli@intel.com>
Fri, 23 Sep 2011 11:17:42 +0000 (14:17 +0300)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 23 Sep 2011 11:58:56 +0000 (12:58 +0100)
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>
xf86drm.h
xf86drmMode.h

index 20f4c78..76eb94e 100644 (file)
--- a/xf86drm.h
+++ b/xf86drm.h
 #include <stdint.h>
 #include <drm.h>
 
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
 #ifndef DRM_MAX_MINOR
 #define DRM_MAX_MINOR   16
 #endif
@@ -723,4 +727,8 @@ extern int drmHandleEvent(int fd, drmEventContextPtr evctx);
 
 extern char *drmGetDeviceNameFromFd(int fd);
 
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
 #endif
index ee7c454..1b1e3e2 100644 (file)
  *
  */
 
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
 #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);
 extern int drmModePageFlip(int fd, uint32_t crtc_id, uint32_t fb_id,
                           uint32_t flags, void *user_data);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif