* Re: [PATCH 24/24] drm/vmwgfx: add extern C guard for the UAPI header
[not found] ` <1461267765-10785-25-git-send-email-emil.l.velikov@gmail.com>
@ 2016-04-22 17:40 ` Sinclair Yeh
0 siblings, 0 replies; 2+ messages in thread
From: Sinclair Yeh @ 2016-04-22 17:40 UTC (permalink / raw)
To: Emil Velikov; +Cc: Thomas Hellstrom, Brian Paul, dri-devel
Are these going to be ported over to corresponding files in libdrm?
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
On Thu, Apr 21, 2016 at 08:42:45PM +0100, Emil Velikov wrote:
> Cc: Sinclair Yeh <syeh@vmware.com>
> Cc: Thomas Hellstrom <thellstrom@vmware.com>
> Cc: Brian Paul <brianp@vmware.com>
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
> ---
> include/uapi/drm/vmwgfx_drm.h | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h
> index 5b68b4d..d325a41 100644
> --- a/include/uapi/drm/vmwgfx_drm.h
> +++ b/include/uapi/drm/vmwgfx_drm.h
> @@ -30,6 +30,10 @@
>
> #include "drm.h"
>
> +#if defined(__cplusplus)
> +extern "C" {
> +#endif
> +
> #define DRM_VMW_MAX_SURFACE_FACES 6
> #define DRM_VMW_MAX_MIP_LEVELS 24
>
> @@ -1087,4 +1091,9 @@ union drm_vmw_extended_context_arg {
> enum drm_vmw_extended_context req;
> struct drm_vmw_context_arg rep;
> };
> +
> +#if defined(__cplusplus)
> +}
> +#endif
> +
> #endif
> --
> 2.6.2
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 00/24] drm: add extern C guard for the UAPI headers
@ 2016-04-21 20:17 Emil Velikov
2016-04-21 20:17 ` [PATCH 24/24] drm/vmwgfx: add extern C guard for the UAPI header Emil Velikov
0 siblings, 1 reply; 2+ messages in thread
From: Emil Velikov @ 2016-04-21 20:17 UTC (permalink / raw)
To: dri-devel
Cc: emil.l.velikov, David Howells, Laurent Pinchart, Daniel Vetter,
Thomas Hellstrom, Tomi Valkeinen, Brian Paul, Ben Skeggs,
Russell King, Dave Airlie, Andrzej Hajda, Michel Dänzer,
Alex Deucher, Christian König
[Re-sending to the correct mailing list. Apologies if you've seen it already]
Hi all, David Howells
Dave Airlie pointed out that "polluting" the headers in a manner as seen
with this series might not be too wise. David H, can we hear your view
on the topic ?
Note that these headers are meant to be used by more than just Linux
(various BSD and Solaris come to mind), making things more complicated.
The change:
As some of you may know there are some subtle distinctions between C and
C++ structs/enums, thus one should wrap/annotate them roughly like below.
...
#if defined(__cplusplus)
extern "C" {
#endif
struct foo {
int bar;
...
};
...
#if defined(__cplusplus)
}
#endif
In order to work around the lack of these users can wrap the header
inclusion in the same way. For example:
...
#if defined(__cplusplus)
extern "C" {
#endif
#include <i915_drm.h>
#if defined(__cplusplus)
}
#endif
Yet we should avoid this approach, as it might cause issues [1] [2] [3].
Thus here is a series which systematically updates all the UAPI headers
in one go.
I would prefer if we get this merged in one go. Daniel, is it possible
to go through drm-misc ? The series is already based on it.
Maintainers, does this sound reasonable, can we get a few acks ?
Thanks
Emil
[1] http://developers.redhat.com/blog/2016/02/29/why-cstdlib-is-more-complicated-than-you-might-think/
[2] https://isocpp.org/wiki/faq/mixing-c-and-cpp
[3] http://www.oracle.com/technetwork/articles/servers-storage-dev/mixingcandcpluspluscode-305840.html
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Erik Faye-Lund <kusmabite@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Sinclair Yeh <syeh@vmware.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Emil Velikov (24):
drm/amdgpu: add extern C guard for the UAPI header
drm/armada: add extern C guard for the UAPI header
drm: add extern C guard for the UAPI headers
drm/etnaviv: add extern C guard for the UAPI header
drm/exynos: add extern C guard for the UAPI header
drm/i810: add extern C guard for the UAPI header
drm/i915: add extern C guard for the UAPI header
drm/mga: add extern C guard for the UAPI header
drm/msm: add extern C guard for the UAPI header
drm/nouveau: add extern C guard for the UAPI header
drm/nouveau: drop drm/ prefix from include
drm/omap: add extern C guard for the UAPI header
drm/qxl: add extern C guard for the UAPI header
drm/qxl: remove XXX comment from the UAPI header
drm/r128: add extern C guard for the UAPI header
drm/radeon: add extern C guard for the UAPI header
drm/savage: add extern C guard for the UAPI header
drm/sis: add extern C guard for the UAPI header
drm/sis: add missing include drm.h for the UAPI header
drm/tegra: add extern C guard for the UAPI header
drm/vc4: add extern C guard for the UAPI header
drm/via: add extern C guard for the UAPI header
drm/virgl: add extern C guard for the UAPI header
drm/vmwgfx: add extern C guard for the UAPI header
include/uapi/drm/amdgpu_drm.h | 8 ++++++++
include/uapi/drm/armada_drm.h | 8 ++++++++
include/uapi/drm/drm.h | 16 ++++++++++++++++
include/uapi/drm/drm_fourcc.h | 8 ++++++++
include/uapi/drm/drm_mode.h | 8 ++++++++
include/uapi/drm/drm_sarea.h | 8 ++++++++
include/uapi/drm/etnaviv_drm.h | 8 ++++++++
include/uapi/drm/exynos_drm.h | 8 ++++++++
include/uapi/drm/i810_drm.h | 8 ++++++++
include/uapi/drm/i915_drm.h | 8 ++++++++
include/uapi/drm/mga_drm.h | 8 ++++++++
include/uapi/drm/msm_drm.h | 8 ++++++++
include/uapi/drm/nouveau_drm.h | 10 +++++++++-
include/uapi/drm/omap_drm.h | 8 ++++++++
include/uapi/drm/qxl_drm.h | 9 ++++++++-
include/uapi/drm/r128_drm.h | 8 ++++++++
include/uapi/drm/radeon_drm.h | 8 ++++++++
include/uapi/drm/savage_drm.h | 8 ++++++++
include/uapi/drm/sis_drm.h | 10 ++++++++++
include/uapi/drm/tegra_drm.h | 8 ++++++++
include/uapi/drm/vc4_drm.h | 8 ++++++++
include/uapi/drm/via_drm.h | 8 ++++++++
include/uapi/drm/virtgpu_drm.h | 8 ++++++++
include/uapi/drm/vmwgfx_drm.h | 9 +++++++++
24 files changed, 204 insertions(+), 2 deletions(-)
--
2.6.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-22 17:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1461267765-10785-1-git-send-email-emil.l.velikov@gmail.com>
[not found] ` <1461267765-10785-25-git-send-email-emil.l.velikov@gmail.com>
2016-04-22 17:40 ` [PATCH 24/24] drm/vmwgfx: add extern C guard for the UAPI header Sinclair Yeh
2016-04-21 20:17 [PATCH 00/24] drm: add extern C guard for the UAPI headers Emil Velikov
2016-04-21 20:17 ` [PATCH 24/24] drm/vmwgfx: add extern C guard for the UAPI header Emil Velikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox