* [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro
@ 2015-08-07 7:37 Tapani Pälli
2015-08-07 7:37 ` [PATCH 2/3] intel: wrap intel_bufmgr.h C code for C++ compilation/linking Tapani Pälli
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Tapani Pälli @ 2015-08-07 7:37 UTC (permalink / raw)
To: dri-devel; +Cc: emil.l.velikov
Use only __cplusplus which is supported by the C++ standard.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
---
libkms/libkms.h | 4 ++--
xf86drm.h | 4 ++--
xf86drmMode.h | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
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@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 2/3] intel: wrap intel_bufmgr.h C code for C++ compilation/linking 2015-08-07 7:37 [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro Tapani Pälli @ 2015-08-07 7:37 ` Tapani Pälli 2015-08-07 7:37 ` [PATCH 3/3] modeprint: cleanup, remove compile warnings Tapani Pälli 2015-08-07 12:11 ` [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro Thierry Reding 2 siblings, 0 replies; 10+ messages in thread From: Tapani Pälli @ 2015-08-07 7:37 UTC (permalink / raw) To: dri-devel; +Cc: emil.l.velikov We need this include in porting changes for the OpenGL ES conformance suite. v2: remove c_plusplus usage Signed-off-by: Tapani Pälli <tapani.palli@intel.com> --- intel/intel_bufmgr.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index 285919e..95eecb8 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h @@ -38,6 +38,10 @@ #include <stdint.h> #include <stdio.h> +#if defined(__cplusplus) +extern "C" { +#endif + struct drm_clip_rect; typedef struct _drm_intel_bufmgr drm_intel_bufmgr; @@ -308,4 +312,8 @@ int drm_intel_get_eu_total(int fd, unsigned int *eu_total); /** @{ */ +#if defined(__cplusplus) +} +#endif + #endif /* INTEL_BUFMGR_H */ -- 2.1.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/3] modeprint: cleanup, remove compile warnings 2015-08-07 7:37 [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro Tapani Pälli 2015-08-07 7:37 ` [PATCH 2/3] intel: wrap intel_bufmgr.h C code for C++ compilation/linking Tapani Pälli @ 2015-08-07 7:37 ` Tapani Pälli 2015-08-07 12:04 ` Thierry Reding 2015-08-07 15:05 ` Emil Velikov 2015-08-07 12:11 ` [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro Thierry Reding 2 siblings, 2 replies; 10+ messages in thread From: Tapani Pälli @ 2015-08-07 7:37 UTC (permalink / raw) To: dri-devel; +Cc: emil.l.velikov Signed-off-by: Tapani Pälli <tapani.palli@intel.com> --- tests/modeprint/modeprint.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c index e6c6553..5e953f7 100644 --- a/tests/modeprint/modeprint.c +++ b/tests/modeprint/modeprint.c @@ -61,6 +61,7 @@ static const char* getConnectionText(drmModeConnection conn) return "connected"; case DRM_MODE_DISCONNECTED: return "disconnected"; + case DRM_MODE_UNKNOWNCONNECTION: default: return "unknown"; } @@ -124,9 +125,6 @@ static int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, ui } } else { - if (!strncmp(props->name, "DPMS", 4)) - ; - for (j = 0; j < props->count_enums; j++) { printf("\t\t%lld = %s\n", props->enums[j].value, props->enums[j].name); if (props->enums[j].value == value) -- 2.1.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] modeprint: cleanup, remove compile warnings 2015-08-07 7:37 ` [PATCH 3/3] modeprint: cleanup, remove compile warnings Tapani Pälli @ 2015-08-07 12:04 ` Thierry Reding 2015-08-07 15:05 ` Emil Velikov 1 sibling, 0 replies; 10+ messages in thread From: Thierry Reding @ 2015-08-07 12:04 UTC (permalink / raw) To: Tapani Pälli; +Cc: emil.l.velikov, dri-devel [-- Attachment #1.1: Type: text/plain, Size: 368 bytes --] On Fri, Aug 07, 2015 at 10:37:58AM +0300, Tapani Pälli wrote: > Signed-off-by: Tapani Pälli <tapani.palli@intel.com> > --- > tests/modeprint/modeprint.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) I've had this exact same commit locally for a while now but never got around to posting it. Reviewed-by: Thierry Reding <treding@nvidia.com> [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] [-- Attachment #2: Type: text/plain, Size: 159 bytes --] _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] modeprint: cleanup, remove compile warnings 2015-08-07 7:37 ` [PATCH 3/3] modeprint: cleanup, remove compile warnings Tapani Pälli 2015-08-07 12:04 ` Thierry Reding @ 2015-08-07 15:05 ` Emil Velikov 1 sibling, 0 replies; 10+ messages in thread From: Emil Velikov @ 2015-08-07 15:05 UTC (permalink / raw) To: Tapani Pälli; +Cc: ML dri-devel On 7 August 2015 at 08:37, Tapani Pälli <tapani.palli@intel.com> wrote: > Signed-off-by: Tapani Pälli <tapani.palli@intel.com> > --- > tests/modeprint/modeprint.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c > index e6c6553..5e953f7 100644 > --- a/tests/modeprint/modeprint.c > +++ b/tests/modeprint/modeprint.c > @@ -61,6 +61,7 @@ static const char* getConnectionText(drmModeConnection conn) > return "connected"; > case DRM_MODE_DISCONNECTED: > return "disconnected"; > + case DRM_MODE_UNKNOWNCONNECTION: > default: > return "unknown"; > } > @@ -124,9 +125,6 @@ static int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, ui > } > > } else { > - if (!strncmp(props->name, "DPMS", 4)) > - ; > - I've never bothered checking if this hunk was useful at some point. If you had can you add a line in the commit log. Regardless, the series is Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Thanks for sticking with my suggestion and killing off the c_plusplus fossil. -Emil _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro 2015-08-07 7:37 [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro Tapani Pälli 2015-08-07 7:37 ` [PATCH 2/3] intel: wrap intel_bufmgr.h C code for C++ compilation/linking Tapani Pälli 2015-08-07 7:37 ` [PATCH 3/3] modeprint: cleanup, remove compile warnings Tapani Pälli @ 2015-08-07 12:11 ` Thierry Reding 2015-08-07 12:16 ` Tapani Pälli 2015-08-07 15:03 ` Emil Velikov 2 siblings, 2 replies; 10+ messages in thread From: Thierry Reding @ 2015-08-07 12:11 UTC (permalink / raw) To: Tapani Pälli; +Cc: emil.l.velikov, Laurent Pinchart, dri-devel [-- Attachment #1.1: Type: text/plain, Size: 3372 bytes --] 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@intel.com> > --- > 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@ideasonboard.com> 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@ideasonboard.com> Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com> Oh... looks like Laurent's changes might have been copy/paste from your earlier commit: commit cfee5218b17a2741e5519ed44091171e01f0dbb2 Author: Tapani Pälli <tapani.palli@intel.com> 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@intel.com> [ickle: also wrap xf86drmMode.h] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> 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@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] [-- Attachment #2: Type: text/plain, Size: 159 bytes --] _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro 2015-08-07 12:11 ` [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro Thierry Reding @ 2015-08-07 12:16 ` Tapani Pälli 2015-08-07 12:38 ` Thierry Reding 2015-08-07 15:03 ` Emil Velikov 1 sibling, 1 reply; 10+ messages in thread From: Tapani Pälli @ 2015-08-07 12:16 UTC (permalink / raw) To: Thierry Reding; +Cc: emil.l.velikov, Laurent Pinchart, dri-devel 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@intel.com> >> --- >> 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@ideasonboard.com> > 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@ideasonboard.com> > Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com> > > 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@intel.com> > 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@intel.com> > [ickle: also wrap xf86drmMode.h] > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > > 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@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro 2015-08-07 12:16 ` Tapani Pälli @ 2015-08-07 12:38 ` Thierry Reding 2015-08-07 13:30 ` Chris Wilson 0 siblings, 1 reply; 10+ messages in thread From: Thierry Reding @ 2015-08-07 12:38 UTC (permalink / raw) To: Tapani Pälli; +Cc: emil.l.velikov, Laurent Pinchart, dri-devel [-- Attachment #1.1: Type: text/plain, Size: 4101 bytes --] On Fri, Aug 07, 2015 at 03:16:10PM +0300, Tapani Pälli wrote: > > > 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@intel.com> > >>--- > >> 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@ideasonboard.com> > > 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@ideasonboard.com> > > Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com> > > > >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! Indeed, looks like your original post: http://lists.freedesktop.org/archives/dri-devel/2011-September/014552.html didn't have it. Since Chris amended the commit, perhaps he had a reason to add it. Chris? Thierry > > commit cfee5218b17a2741e5519ed44091171e01f0dbb2 > > Author: Tapani Pälli <tapani.palli@intel.com> > > 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@intel.com> > > [ickle: also wrap xf86drmMode.h] > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > > > >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@lists.freedesktop.org > >>http://lists.freedesktop.org/mailman/listinfo/dri-devel [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] [-- Attachment #2: Type: text/plain, Size: 159 bytes --] _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro 2015-08-07 12:38 ` Thierry Reding @ 2015-08-07 13:30 ` Chris Wilson 0 siblings, 0 replies; 10+ messages in thread From: Chris Wilson @ 2015-08-07 13:30 UTC (permalink / raw) To: Thierry Reding; +Cc: emil.l.velikov, Laurent Pinchart, dri-devel On Fri, Aug 07, 2015 at 02:38:49PM +0200, Thierry Reding wrote: > On Fri, Aug 07, 2015 at 03:16:10PM +0300, Tapani Pälli wrote: > > > > > > 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@intel.com> > > >>--- > > >> 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@ideasonboard.com> > > > 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@ideasonboard.com> > > > Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com> > > > > > >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! > > Indeed, looks like your original post: > > http://lists.freedesktop.org/archives/dri-devel/2011-September/014552.html > > didn't have it. Since Chris amended the commit, perhaps he had a reason > to add it. Chris? Just cargo-culting. -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro 2015-08-07 12:11 ` [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro Thierry Reding 2015-08-07 12:16 ` Tapani Pälli @ 2015-08-07 15:03 ` Emil Velikov 1 sibling, 0 replies; 10+ messages in thread From: Emil Velikov @ 2015-08-07 15:03 UTC (permalink / raw) To: Thierry Reding; +Cc: Laurent Pinchart, ML dri-devel On 7 August 2015 at 13:11, Thierry Reding <thierry.reding@gmail.com> 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@intel.com> >> --- >> 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: > The only reference I could find was in Oracle's documentation, which says that it was used in ancient versions of the C++ standard [1]. On the question of why I believe you've answered is perfectly - copy'n'paste FTW ;-) Cheers, Emil [1] http://docs.oracle.com/cd/E19422-01/819-3689/Ch6.Diff.C_C++.html _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-08-07 15:06 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-08-07 7:37 [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro Tapani Pälli 2015-08-07 7:37 ` [PATCH 2/3] intel: wrap intel_bufmgr.h C code for C++ compilation/linking Tapani Pälli 2015-08-07 7:37 ` [PATCH 3/3] modeprint: cleanup, remove compile warnings Tapani Pälli 2015-08-07 12:04 ` Thierry Reding 2015-08-07 15:05 ` Emil Velikov 2015-08-07 12:11 ` [PATCH 1/3] remove usage of 'c_plusplus' preprocessor macro Thierry Reding 2015-08-07 12:16 ` Tapani Pälli 2015-08-07 12:38 ` Thierry Reding 2015-08-07 13:30 ` Chris Wilson 2015-08-07 15:03 ` Emil Velikov
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.