remove usage of 'c_plusplus' preprocessor macro
PATCH 1/3 remove usage of 'c_plusplus' preprocessor macro
Use only __cplusplus which is supported by the C++ standard.
--- libkms/libkms.h | 4 ++-- xf86drm.h | 4 ++-- xf86drmMode.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
libkms/libkms.h +2 -2
@@ -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
xf86drm.h +2 -2
@@ -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
xf86drmMode.h +2 -2
@@ -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
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/3 intel: wrap intel_bufmgr.h C code for C++ compilation/linking
We need this include in porting changes for the OpenGL ES conformance suite.
v2: remove c_plusplus usage
--- intel/intel_bufmgr.h | 8 ++++++++ 1 file changed, 8 insertions(+)
intel/intel_bufmgr.h +8 -0
@@ -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 */
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/3 modeprint: cleanup, remove compile warnings
In reply to Tapani Pälli--- tests/modeprint/modeprint.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
tests/modeprint/modeprint.c +1 -3
@@ -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)
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/3] modeprint: cleanup, remove compile warnings
Quoted 4 lines · Tapani Pälli
Signed-off-by Tapani Pälli <[email protected]>--- 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.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/3] modeprint: cleanup, remove compile warnings
In reply to Tapani PälliQuoted 18 lines · Tapani Pälli
Signed-off-by Tapani Pälli <[email protected]>--- tests/modeprint/modeprint.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)tests/modeprint/modeprint.c +1
-0@@ -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" ; }
tests/modeprint/modeprint.c static int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, ui · line 129
Quoted 6 lines
tests/modeprint/modeprint.c +0
-3@@ -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
Thanks for sticking with my suggestion and killing off the c_plusplus fossil. -Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Tapani Pälli
Use only
__cpluspluswhich is supported by the C++ standard.Signed-off-by Tapani Pälli <[email protected]>--- 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 <[email protected]>
Date: Thu Nov 1 09:40:30 2012 +0000
kms: Make libkms.h usable in C++
Wrap the header in extern "C" { ... };.
Oh... looks like Laurent's changes might have been copy/paste from your earlier commit:
commit cfee5218b17a2741e5519ed44091171e01f0dbb2
Author: Tapani Pälli <[email protected]>
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.
Thierry
Quoted 73 lines
libkms/libkms.h +2
-2@@ -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 xf86drm.h +2
-2@@ -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 xf86drmMode.h +2
-2@@ -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 Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 19 lines · Thierry Reding
Quoted 8 lines · Tapani Pälli
Use only
__cpluspluswhich is supported by the C++ standard.Signed-off-by Tapani Pälli <[email protected]>--- 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_pluspluson the internet. Let's see what Laurent says, who added this in commit:commit
9fa4a4b1a894fa8fffe2075bc3376b7fa5e18104
Author: Laurent Pinchart <[email protected]>
Date: Thu Nov 1 09:40:30 2012 +0000kms: Make
libkms.husable in C++
Quoted 7 lines
Wrap the header in extern "C" { ... };.
Signed-off-by Laurent Pinchart <[email protected]>Reviewed-by Jakob Bornecrantz <[email protected]>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!
Quoted 80 lines
commit
cfee5218b17a2741e5519ed44091171e01f0dbb2
Author: Tapani Pälli <[email protected]>
Date: Fri Sep 23 14:17:42 2011 +0300
xf86drm.h: wrap C code for C++ compilation/linkingTo enable usage of
xf86drm.hfrom C++ programs/frameworks.Signed-off-by Tapani Pälli <[email protected]>[ickle: also wrap xf86drmMode.h]Signed-off-by Chris Wilson <[email protected]>Thierry
Quoted 66 lines
libkms/libkms.h +2
-2@@ -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 xf86drm.h +2
-2@@ -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 xf86drmMode.h +2
-2@@ -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
Quoted 7 lines
Quoted 7 lines
--
2.1.0_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 24 lines · Tapani Pälli
Quoted 21 lines · Thierry Reding
Quoted 8 lines · Tapani Pälli
Use only
__cpluspluswhich is supported by the C++ standard.Signed-off-by Tapani Pälli <[email protected]>--- 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_pluspluson the internet. Let's see what Laurent says, who added this in commit:commit
9fa4a4b1a894fa8fffe2075bc3376b7fa5e18104
Author: Laurent Pinchart <[email protected]>
Date: Thu Nov 1 09:40:30 2012 +0000kms: Make
libkms.husable in C++Wrap the header in extern "C" { ... };.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Laurent Pinchart <[email protected]>Reviewed-by Jakob Bornecrantz <[email protected]>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
Quoted 80 lines
Quoted 80 lines
commit
cfee5218b17a2741e5519ed44091171e01f0dbb2
Author: Tapani Pälli <[email protected]>
Date: Fri Sep 23 14:17:42 2011 +0300
xf86drm.h: wrap C code for C++ compilation/linkingTo enable usage of
xf86drm.hfrom C++ programs/frameworks.Signed-off-by Tapani Pälli <[email protected]>[ickle: also wrap xf86drmMode.h]Signed-off-by Chris Wilson <[email protected]>Thierry
Quoted 66 lines
libkms/libkms.h +2
-2@@ -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 xf86drm.h +2
-2@@ -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 xf86drmMode.h +2
-2@@ -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
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
--
2.1.0_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 34 lines · Thierry Reding
Quoted 24 lines · Tapani Pälli
Quoted 21 lines · Thierry Reding
Quoted 8 lines · Tapani Pälli
Use only
__cpluspluswhich is supported by the C++ standard.Signed-off-by Tapani Pälli <[email protected]>--- 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_pluspluson the internet. Let's see what Laurent says, who added this in commit:commit
9fa4a4b1a894fa8fffe2075bc3376b7fa5e18104
Author: Laurent Pinchart <[email protected]>
Date: Thu Nov 1 09:40:30 2012 +0000kms: Make
libkms.husable in C++Wrap the header in extern "C" { ... };.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Laurent Pinchart <[email protected]>Reviewed-by Jakob Bornecrantz <[email protected]>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!
Quoted 6 lines
Indeed, looks like your original post:
http://lists.freedesktop.org/archives/dri-devel/2011-September/014552.htmldidn't have it. Since Chris amended the commit, perhaps he had a reason to add it. Chris?
Just cargo-culting.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 10 lines · Thierry Reding
Quoted 8 lines · Tapani Pälli
Use only
__cpluspluswhich is supported by the C++ standard.Signed-off-by Tapani Pälli <[email protected]>--- libkms/libkms.h | 4 ++-- xf86drm.h | 4 ++-- xf86drmMode.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
Quoted 3 lines
This looks fine to me, I can't find any mention of
c_pluspluson 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
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel