lkml.org 
[lkml]   [2009]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] unifdef: teach it about defined(FOO) syntax
On Sun, 21 Jun 2009 20:21:32 +0200
Denys Vlasenko <vda.linux@googlemail.com> wrote:

> Hi,
>
> uclibc project patched unifdef.c (which we stole from kernel)
> so that it understands defined(FOO) in addition to defined FOO,
> and also taught it to understand short-circuited evaluation
> of && and ||
>
> The patch is attached. (Sorry, not inline, I fear Google
> web mail interface may mangle it).
>
> I ran these commands in unpatched and patched tree:
>
> make ARCH=i386 CROSS_COMPILE=i486-linux-uclibc- defconfig
> ln -s asm-x86 include/asm
> make ARCH=i386 CROSS_COMPILE=i486-linux-uclibc- headers_install
>
> and then diffed usr/*. The difference clearly shows that
> new unifdef works better than old one:
>
>
> linux-2.6.30.test/usr/include/linux/acct.h:
> @@ -59,9 +59,7 @@ struct acct
> comp_t ac_majflt; /* Major Pagefaults */
> comp_t ac_swaps; /* Number of Swaps */
> /* m68k had no padding here. */
> -#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
> __u16 ac_ahz; /* AHZ */
> -#endif
> __u32 ac_exitcode; /* Exitcode */
> char ac_comm[ACCT_COMM + 1]; /* Command Name */
> __u8 ac_etime_hi; /* Elapsed Time MSB */
>
>
> linux-2.6.30.test/usr/include/linux/soundcard.h:
> @@ -1033,7 +1033,6 @@ typedef struct mixer_vol_table {
> */
> #define LOCL_STARTAUDIO 1
>
> -#if !defined(__KERNEL__) || defined(USE_SEQ_MACROS)
> /*
> * Some convenience macros to simplify programming of the
> * /dev/sequencer interface
> @@ -1275,4 +1274,3 @@ void seqbuf_dump(void); /* This function
> (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
>
> #endif
> -#endif
>
> ...
>

eek. Please avoid quoting anything which looks like a patch in the
changelog. Because when some poor schmuck comes along and tries to
apply it, patch(1) goes sniffing around in the changelog, thinks it
sees a patch and makes a huge mess of everything.


> Please apply.

Unfortunately unifdef.c got changed after 2.6.30 and this patch throws
more rejects than I am comfortable about fixing.



\
 
 \ /
  Last update: 2009-06-27 00:07    [W:0.039 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site