All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Irina Tirdea <irina.tirdea@gmail.com>
Cc: Pekka Enberg <penberg@kernel.org>,
	mingo@redhat.com, acme@ghostprotocols.net, rostedt@goodmis.org,
	paulus@samba.org, dsahern@gmail.com, namhyung.kim@lge.com,
	linux-kernel@vger.kernel.org,
	Irina Tirdea <irina.tirdea@intel.com>
Subject: Re: [PATCH v2 03/12] perf tools: include __WORDSIZE definition
Date: Mon, 10 Sep 2012 16:44:56 +0200	[thread overview]
Message-ID: <1347288296.2124.12.camel@twins> (raw)
In-Reply-To: <CANg8OW+iuqnc-_daWDSXymYNKnr0YEoa_3310YvYJAUF_vCTnQ@mail.gmail.com>

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) 

  reply	other threads:[~2012-09-10 14:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-08  0:43 [PATCH v2 00/12] Porting perf to Android Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 01/12] perf tools: include wrapper for magic.h Irina Tirdea
2012-09-08  9:13   ` Pekka Enberg
2012-09-08 22:39     ` Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 02/12] perf tools: update types definitions for Android Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 03/12] perf tools: include __WORDSIZE definition Irina Tirdea
2012-09-08  9:07   ` Pekka Enberg
2012-09-08 22:19     ` Irina Tirdea
2012-09-10 14:44       ` Peter Zijlstra [this message]
2012-09-10 21:42         ` Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 04/12] perf tools: fix ALIGN redefinition in system headers Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 05/12] perf tools: include basename for non-glibc systems Irina Tirdea
2012-09-08  9:09   ` Pekka Enberg
2012-09-08 14:33     ` David Ahern
2012-09-08 11:43   ` [tip:perf/core] " tip-bot for Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 06/12] perf tools: fix missing winsize definition Irina Tirdea
2012-09-08 11:44   ` [tip:perf/core] " tip-bot for Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 07/12] perf tools: include missing pthread.h header Irina Tirdea
2012-09-08 11:45   ` [tip:perf/core] " tip-bot for Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 08/12] perf tools: fix no return in non-void function Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 09/12] perf tools: replace mkostemp with mkstemp Irina Tirdea
2012-09-08 11:46   ` [tip:perf/core] " tip-bot for Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 10/12] tools lib traceevent: replace mempcpy with memcpy Irina Tirdea
2012-09-08 11:47   ` [tip:perf/core] " tip-bot for Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 11/12] perf tools: add NO_BACKTRACE for application self-debugging Irina Tirdea
2012-09-08 11:48   ` [tip:perf/core] " tip-bot for Irina Tirdea
2012-09-08  0:43 ` [PATCH v2 12/12] perf tools: Use __maybe_used for unused variables Irina Tirdea
2012-09-08  1:14 ` [PATCH v2 00/12] Porting perf to Android Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347288296.2124.12.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=irina.tirdea@gmail.com \
    --cc=irina.tirdea@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    --cc=penberg@kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.