From bd397a536bba813fda9865bc39bddd02eef60b5a Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Thu, 6 Sep 2012 11:47:40 +0200 Subject: [PATCH] pluginutils: add G_PRIMITIVE_SWAP() helper macro. This macro helps swapping variables while maintaining the correct underlying and primitive type. --- gst/vaapi/gstvaapipluginutil.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/vaapi/gstvaapipluginutil.h b/gst/vaapi/gstvaapipluginutil.h index b55374b..78f274f 100644 --- a/gst/vaapi/gstvaapipluginutil.h +++ b/gst/vaapi/gstvaapipluginutil.h @@ -50,4 +50,10 @@ G_GNUC_INTERNAL gboolean gst_vaapi_append_surface_caps (GstCaps *out_caps, GstCaps *in_caps); +#ifndef G_PRIMITIVE_SWAP +#define G_PRIMITIVE_SWAP(type, a, b) do { \ + const type t = a; a = b; b = t; \ + } while (0) +#endif + #endif /* GST_VAAPI_PLUGIN_UTIL_H */ -- 2.7.4