lkml.org 
[lkml]   [2012]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 03/12] perf tools: include __WORDSIZE definition
On Mon, Sep 10, 2012 at 5:44 PM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> On Sun, 2012-09-09 at 01:19 +0300, Irina Tirdea wrote:
>> >> +#ifndef __WORDSIZE
>> >> +#if defined(__x86_64__)
>> >> +# define __WORDSIZE 64
>> >> +#endif
>> >> +#if defined(__i386__) || defined(__arm__)
>> >> +# define __WORDSIZE 32
>> >> +#endif
>> >> +#endif
>> >
>> > Why not use "sizeof(unsigned long) * 8" ?
>>
>> I tried to do it this, but the compilation crashes because this value
>> is tested in an #if:
>>
>> target C: libperf <= tools/perf/util/annotate.c
>> In file included from tools/perf/util/include/linux/bitmap.h:5:0,
>> from tools/perf/util/header.h:10,
>> from tools/perf/util/session.h:6,
>> from tools/perf/util/build-id.h:4,
>> from tools/perf/util/annotate.c:11:
>> tools/perf/util/include/linux/bitops.h: In function '__ffs':
>> tools/perf/util/include/linux/bitops.h:62:5: warning: "sizeof" is not
>> defined [-Wundef]
>> tools/perf/util/include/linux/bitops.h:62:5: error: missing binary
>> operator before token "("
>
> Use either: __SIZEOF_LONG__ (8) or __LP64__ (1)

Thanks! Using __SIZEOF_LONG__ works. I'll update the patch.

Thanks,
Irina


\
 
 \ /
  Last update: 2012-09-11 00:21    [W:0.082 / U:26.596 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site