v4l2: consistently check #ifdef HAVE_GUDEV instead of #if

Both work with autotools but they definitely don't mean the same thing, cause
problems with other build systems, and are bad form. Existence should always be
checked with #ifdef or #if defined.
This commit is contained in:
Nirbheek Chauhan 2016-04-09 07:51:03 +05:30 committed by Tim-Philipp Müller
parent af1d49d039
commit 4048a4e137
2 changed files with 6 additions and 6 deletions

View file

@ -49,7 +49,7 @@ G_DEFINE_TYPE (GstV4l2DeviceProvider, gst_v4l2_device_provider,
static void gst_v4l2_device_provider_finalize (GObject * object); static void gst_v4l2_device_provider_finalize (GObject * object);
static GList *gst_v4l2_device_provider_probe (GstDeviceProvider * provider); static GList *gst_v4l2_device_provider_probe (GstDeviceProvider * provider);
#if HAVE_GUDEV #ifdef HAVE_GUDEV
static gboolean gst_v4l2_device_provider_start (GstDeviceProvider * provider); static gboolean gst_v4l2_device_provider_start (GstDeviceProvider * provider);
static void gst_v4l2_device_provider_stop (GstDeviceProvider * provider); static void gst_v4l2_device_provider_stop (GstDeviceProvider * provider);
#endif #endif
@ -63,7 +63,7 @@ gst_v4l2_device_provider_class_init (GstV4l2DeviceProviderClass * klass)
dm_class->probe = gst_v4l2_device_provider_probe; dm_class->probe = gst_v4l2_device_provider_probe;
#if HAVE_GUDEV #ifdef HAVE_GUDEV
dm_class->start = gst_v4l2_device_provider_start; dm_class->start = gst_v4l2_device_provider_start;
dm_class->stop = gst_v4l2_device_provider_stop; dm_class->stop = gst_v4l2_device_provider_stop;
#endif #endif
@ -79,7 +79,7 @@ gst_v4l2_device_provider_class_init (GstV4l2DeviceProviderClass * klass)
static void static void
gst_v4l2_device_provider_init (GstV4l2DeviceProvider * provider) gst_v4l2_device_provider_init (GstV4l2DeviceProvider * provider)
{ {
#if HAVE_GUDEV #ifdef HAVE_GUDEV
g_cond_init (&provider->started_cond); g_cond_init (&provider->started_cond);
#endif #endif
} }
@ -87,7 +87,7 @@ gst_v4l2_device_provider_init (GstV4l2DeviceProvider * provider)
static void static void
gst_v4l2_device_provider_finalize (GObject * object) gst_v4l2_device_provider_finalize (GObject * object)
{ {
#if HAVE_GUDEV #ifdef HAVE_GUDEV
GstV4l2DeviceProvider *provider = GST_V4L2_DEVICE_PROVIDER (object); GstV4l2DeviceProvider *provider = GST_V4L2_DEVICE_PROVIDER (object);
g_cond_clear (&provider->started_cond); g_cond_clear (&provider->started_cond);
@ -219,7 +219,7 @@ gst_v4l2_device_provider_probe (GstDeviceProvider * provider)
return devices; return devices;
} }
#if HAVE_GUDEV #ifdef HAVE_GUDEV
static GstDevice * static GstDevice *
gst_v4l2_device_provider_device_from_udev (GstV4l2DeviceProvider * provider, gst_v4l2_device_provider_device_from_udev (GstV4l2DeviceProvider * provider,

View file

@ -29,7 +29,7 @@
/* Common device iterator */ /* Common device iterator */
/**************************/ /**************************/
#if HAVE_GUDEV #ifdef HAVE_GUDEV
#include <gudev/gudev.h> #include <gudev/gudev.h>
struct _GstV4l2GUdevIterator struct _GstV4l2GUdevIterator