diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-09-06 11:47:40 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-09-06 13:39:50 +0200 |
commit | bd397a536bba813fda9865bc39bddd02eef60b5a (patch) | |
tree | bed1aa2819d4543e7066da769ab4bb46fd4b31e2 | |
parent | 09724e12defa3c2f78fafebe3316d8173086a4a2 (diff) |
pluginutils: add G_PRIMITIVE_SWAP() helper macro.
This macro helps swapping variables while maintaining the correct underlying
and primitive type.
-rw-r--r-- | gst/vaapi/gstvaapipluginutil.h | 6 |
1 files changed, 6 insertions, 0 deletions
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 */ |