Re: [RFC][PATCH] A generic boolean (version 3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>+++ b/drivers/block/DAC960.h
>@@ -71,7 +71,7 @@ #define DAC690_V2_PciDmaMask	0xfffffffff
>   Define a Boolean data type.
> */
> 
>-typedef enum { false, true } __attribute__ ((packed)) boolean;
>+typedef bool boolean;
> 
Probably I missed some mail, but why can't we just have typedef _Bool bool?
Like below?

>+++ b/include/asm-i386/types.h
>@@ -1,6 +1,13 @@
> #ifndef _I386_TYPES_H
> #define _I386_TYPES_H
> 
>+#if __GNUC__ >= 3
>+typedef _Bool bool;
>+#else
>+#warning You compiler doesn't seem to support boolean types, will set 'bool' as
>an 'unsigned int'
>+typedef unsigned int bool;
>+#endif
>+
> #ifndef __ASSEMBLY__
> 
> typedef unsigned short umode_t;
>--- a/include/linux/stddef.h
>+++ b/include/linux/stddef.h
>@@ -10,6 +10,17 @@ #else
> #define NULL ((void *)0)
> #endif
> 
>+#undef false
>+#undef true

Wasnot this supposed to go away?

>+
>+enum {
>+	false	= 0,
>+	true	= 1
>+};
>+
>+#define false false
>+#define true true 
>+
> #undef offsetof
> #ifdef __compiler_offsetof
> #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
>

Jan Engelhardt
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux