pluginutils: add G_PRIMITIVE_SWAP() helper macro.

This macro helps swapping variables while maintaining the correct underlying
and primitive type.
This commit is contained in:
Gwenole Beauchesne 2012-09-06 11:47:40 +02:00
parent 09724e12de
commit bd397a536b

View file

@ -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 */