From: Magnus Fromreide <magfr at lysator.liu.se>
To: powertop@lists.01.org
Subject: [Powertop] [PATCH 1/2] Make it possible to include parse-events.h before libc headers.
Date: Tue, 24 Jul 2012 08:03:27 +0200 [thread overview]
Message-ID: <1343209431.2554.0.camel@sara> (raw)
[-- Attachment #1: Type: text/plain, Size: 2223 bytes --]
The __unused macro interferes with the glibc and is in a reserved namespace
so it should be renamed.
Additionally the __ununsed macro is used from just one implementation file so
the macro is moved there.
Signed-off-by: Magnus Fromreide <magfr(a)lysator.liu.se>
---
pevent/parse-events.c | 12 +++++++++---
pevent/parse-events.h | 4 ----
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/pevent/parse-events.c b/pevent/parse-events.c
index 58716e9..c039698 100644
--- a/pevent/parse-events.c
+++ b/pevent/parse-events.c
@@ -37,6 +37,10 @@
#include "parse-events.h"
+#ifndef pevent_unused
+#define pevent_unused __attribute__ ((unused))
+#endif
+
static const char *input_buf;
static unsigned long long input_buf_ptr;
static unsigned long long input_buf_siz;
@@ -1777,7 +1781,7 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)
}
static enum event_type
-process_entry(struct event_format *event __unused, struct print_arg *arg,
+process_entry(struct event_format *event pevent_unused, struct print_arg *arg,
char **tok)
{
enum event_type type;
@@ -2350,7 +2354,8 @@ process_paren(struct event_format *event, struct print_arg *arg, char **tok)
static enum event_type
-process_str(struct event_format *event __unused, struct print_arg *arg, char **tok)
+process_str(struct event_format *event pevent_unused, struct print_arg *arg,
+ char **tok)
{
enum event_type type;
char *token;
@@ -3500,7 +3505,8 @@ static void free_args(struct print_arg *args)
}
static char *
-get_bprint_format(void *data, int size __unused, struct event_format *event)
+get_bprint_format(void *data, int size pevent_unused,
+ struct event_format *event)
{
struct pevent *pevent = event->pevent;
unsigned long long addr;
diff --git a/pevent/parse-events.h b/pevent/parse-events.h
index 5d5d195..124aa1b 100644
--- a/pevent/parse-events.h
+++ b/pevent/parse-events.h
@@ -27,10 +27,6 @@
#include <stdarg.h>
#include <regex.h>
-#ifndef __unused
-#define __unused __attribute__ ((unused))
-#endif
-
/* ----------------------- trace_seq ----------------------- */
--
1.7.10.4
next reply other threads:[~2012-07-24 6:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-24 6:03 Magnus Fromreide [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-07-25 17:44 [Powertop] [PATCH 1/2] Make it possible to include parse-events.h before libc headers Chris Ferron
2012-07-25 19:26 Magnus Fromreide
2012-07-26 22:09 Chris Ferron
2012-07-28 17:27 Magnus Fromreide
2012-07-30 16:08 Chris Ferron
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=1343209431.2554.0.camel@sara \
--to=powertop@lists.01.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.