The patch number 9354 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Mauro Carvalho Chehab  <[EMAIL PROTECTED]>
Fix compilation with RHEL 5.2 kernel


RHEL 5 already declares bool. Still, there are some warnings that
probably indicate that something else needs to be done for the code to
work with RHEL5.

Priority: normal

Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>


---

 v4l/compat.h                      |    4 +++-
 v4l/scripts/make_config_compat.pl |   20 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff -r 379a48b17dcc -r 5114e2e56188 v4l/compat.h
--- a/v4l/compat.h      Sat Oct 18 07:41:52 2008 +0000
+++ b/v4l/compat.h      Fri Oct 24 08:44:03 2008 -0200
@@ -55,7 +55,9 @@
 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
 #define PCIAGP_FAIL 0
 #define vmalloc_32_user(a) vmalloc_32(a)
-
+#endif
+
+#ifdef NEED_BOOL_TYPE
 /* bool type and enum-based definition of true and false was added in 2.6.19 */
 typedef int bool;
 #define true 1
diff -r 379a48b17dcc -r 5114e2e56188 v4l/scripts/make_config_compat.pl
--- a/v4l/scripts/make_config_compat.pl Sat Oct 18 07:41:52 2008 +0000
+++ b/v4l/scripts/make_config_compat.pl Fri Oct 24 08:44:03 2008 -0200
@@ -83,12 +83,32 @@ sub check_snd_ctl_boolean_mono_info()
        close INNET;
 }
 
+sub check_bool()
+{
+       my $file = "$kdir/include/linux/types.h";
+       my $old_syntax = 1;
+
+       open INDEP, "<$file" or die "File not found: $file";
+       while (<INDEP>) {
+               if (m/^\s*typedef.*bool;/) {
+                       $old_syntax = 0;
+                       last;
+               }
+       }
+
+       if ($old_syntax) {
+               $out.= "\n#define NEED_BOOL_TYPE 1\n";
+       }
+       close INDEP;
+}
+
 sub check_other_dependencies()
 {
        check_spin_lock();
        check_sound_driver_h();
        check_snd_ctl_boolean_mono_info();
        check_snd_pcm_rate_to_rate_bit();
+       check_bool();
 }
 
 # Do the basic rules


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/5114e2e5618833f1da487d2b4ac930c66cebbae2

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to