diff options
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/compat.h | 2 | ||||
-rwxr-xr-x | v4l/scripts/make_config_compat.pl | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h index f3dfceafe..7325e15c4 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -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 --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index e538c925b..bd34e7193 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -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 |