Re: [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 08/07/2015 03:11 PM, Thierry Reding wrote:
On Fri, Aug 07, 2015 at 10:37:56AM +0300, Tapani Pälli wrote:
Use only __cplusplus which is supported by the C++ standard.

Signed-off-by: Tapani Pälli <tapani.palli@xxxxxxxxx>
---
  libkms/libkms.h | 4 ++--
  xf86drm.h       | 4 ++--
  xf86drmMode.h   | 4 ++--
  3 files changed, 6 insertions(+), 6 deletions(-)

This looks fine to me, I can't find any mention of c_plusplus on the
internet. Let's see what Laurent says, who added this in commit:

	commit 9fa4a4b1a894fa8fffe2075bc3376b7fa5e18104
	Author: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
	Date:   Thu Nov 1 09:40:30 2012 +0000
	
	    kms: Make libkms.h usable in C++
	
	    Wrap the header in extern "C" { ... };.
	
	    Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
	    Reviewed-by: Jakob Bornecrantz <wallbraker@xxxxxxxxx>

Oh... looks like Laurent's changes might have been copy/paste from your
earlier commit:

:) yeah, I'm not the source for this evil though, I recall this addition was made during the review!

	commit cfee5218b17a2741e5519ed44091171e01f0dbb2
	Author: Tapani Pälli <tapani.palli@xxxxxxxxx>
	Date:   Fri Sep 23 14:17:42 2011 +0300
	
	    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@xxxxxxxxx>
	    [ickle: also wrap xf86drmMode.h]
	    Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>

Thierry

diff --git a/libkms/libkms.h b/libkms/libkms.h
index c00b159..930a2bf 100644
--- a/libkms/libkms.h
+++ b/libkms/libkms.h
@@ -29,7 +29,7 @@
  #ifndef _LIBKMS_H_
  #define _LIBKMS_H_

-#if defined(__cplusplus) || defined(c_plusplus)
+#if defined(__cplusplus)
  extern "C" {
  #endif

@@ -75,7 +75,7 @@ int kms_bo_map(struct kms_bo *bo, void **out);
  int kms_bo_unmap(struct kms_bo *bo);
  int kms_bo_destroy(struct kms_bo **bo);

-#if defined(__cplusplus) || defined(c_plusplus)
+#if defined(__cplusplus)
  };
  #endif

diff --git a/xf86drm.h b/xf86drm.h
index e3a19dc..360e04a 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -39,7 +39,7 @@
  #include <stdint.h>
  #include <drm.h>

-#if defined(__cplusplus) || defined(c_plusplus)
+#if defined(__cplusplus)
  extern "C" {
  #endif

@@ -759,7 +759,7 @@ extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle);
  extern char *drmGetPrimaryDeviceNameFromFd(int fd);
  extern char *drmGetRenderDeviceNameFromFd(int fd);

-#if defined(__cplusplus) || defined(c_plusplus)
+#if defined(__cplusplus)
  }
  #endif

diff --git a/xf86drmMode.h b/xf86drmMode.h
index 1c10023..4de7bbb 100644
--- a/xf86drmMode.h
+++ b/xf86drmMode.h
@@ -36,7 +36,7 @@
  #ifndef _XF86DRMMODE_H_
  #define _XF86DRMMODE_H_

-#if defined(__cplusplus) || defined(c_plusplus)
+#if defined(__cplusplus)
  extern "C" {
  #endif

@@ -508,7 +508,7 @@ extern int drmModeCreatePropertyBlob(int fd, const void *data, size_t size,
  extern int drmModeDestroyPropertyBlob(int fd, uint32_t id);


-#if defined(__cplusplus) || defined(c_plusplus)
+#if defined(__cplusplus)
  }
  #endif

--
2.1.0

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux