v4l2: consistently check #ifdef HAVE_GUDEV instead of #if
authorNirbheek Chauhan <nirbheek@centricular.com>
Sat, 9 Apr 2016 02:21:03 +0000 (07:51 +0530)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 18 Aug 2016 19:20:20 +0000 (20:20 +0100)
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.

sys/v4l2/gstv4l2deviceprovider.c
sys/v4l2/v4l2-utils.c

index 4142f1a..61ca135 100644 (file)
@@ -49,7 +49,7 @@ G_DEFINE_TYPE (GstV4l2DeviceProvider, gst_v4l2_device_provider,
 static void gst_v4l2_device_provider_finalize (GObject * object);
 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 void gst_v4l2_device_provider_stop (GstDeviceProvider * provider);
 #endif
@@ -63,7 +63,7 @@ gst_v4l2_device_provider_class_init (GstV4l2DeviceProviderClass * klass)
 
   dm_class->probe = gst_v4l2_device_provider_probe;
 
-#if HAVE_GUDEV
+#ifdef HAVE_GUDEV
   dm_class->start = gst_v4l2_device_provider_start;
   dm_class->stop = gst_v4l2_device_provider_stop;
 #endif
@@ -79,7 +79,7 @@ gst_v4l2_device_provider_class_init (GstV4l2DeviceProviderClass * klass)
 static void
 gst_v4l2_device_provider_init (GstV4l2DeviceProvider * provider)
 {
-#if HAVE_GUDEV
+#ifdef HAVE_GUDEV
   g_cond_init (&provider->started_cond);
 #endif
 }
@@ -87,7 +87,7 @@ gst_v4l2_device_provider_init (GstV4l2DeviceProvider * provider)
 static void
 gst_v4l2_device_provider_finalize (GObject * object)
 {
-#if HAVE_GUDEV
+#ifdef HAVE_GUDEV
   GstV4l2DeviceProvider *provider = GST_V4L2_DEVICE_PROVIDER (object);
 
   g_cond_clear (&provider->started_cond);
@@ -219,7 +219,7 @@ gst_v4l2_device_provider_probe (GstDeviceProvider * provider)
   return devices;
 }
 
-#if HAVE_GUDEV
+#ifdef HAVE_GUDEV
 
 static GstDevice *
 gst_v4l2_device_provider_device_from_udev (GstV4l2DeviceProvider * provider,
index 73506b9..260c5df 100644 (file)
@@ -29,7 +29,7 @@
 /* Common device iterator */
 /**************************/
 
-#if HAVE_GUDEV
+#ifdef HAVE_GUDEV
 #include <gudev/gudev.h>
 
 struct _GstV4l2GUdevIterator