From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Bruce Richardson
<bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH] ring: cleanup file-local macros at end-of-file
Date: Tue, 03 Mar 2015 22:03:45 +0100 [thread overview]
Message-ID: <6979759.vFaJhNqs1F@xps13> (raw)
In-Reply-To: <1425400717-24322-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-03 16:38, Bruce Richardson:
> The ENQUEUE_PTRS and DEQUEUE_PTRS macros defined in rte_ring.h are
> not meant to be global and are not prefixed with the RTE_ prefix.
> Therefore undef the macros at end of file to avoid pollution of the
> global namespace, in case ends apps end up wanting to reuse those names.
>
> Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
> lib/librte_ring/rte_ring.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
> index bdf69b7..0d35648 100644
> --- a/lib/librte_ring/rte_ring.h
> +++ b/lib/librte_ring/rte_ring.h
> @@ -1232,6 +1232,10 @@ rte_ring_dequeue_burst(struct rte_ring *r, void **obj_table, unsigned n)
> return rte_ring_mc_dequeue_burst(r, obj_table, n);
> }
>
> +/* undef un-prefixed macros which are local to this file */
> +#undef ENQUEUE_PTRS
> +#undef DEQUEUE_PTRS
> +
Thanks for trying to clean-up things.
Note that if an application is using this macro name, it will be destroyed
when including rte_ring.h.
Globally, DPDK namespace is awful and I hope we will be able to improve it.
next prev parent reply other threads:[~2015-03-03 21:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 16:38 [PATCH] ring: cleanup file-local macros at end-of-file Bruce Richardson
[not found] ` <1425400717-24322-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-03 21:03 ` Thomas Monjalon [this message]
2015-03-04 10:22 ` Bruce Richardson
2015-03-04 10:26 ` Ananyev, Konstantin
[not found] ` <2601191342CEEE43887BDE71AB977258213F3C63-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-04 10:49 ` Bruce Richardson
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=6979759.vFaJhNqs1F@xps13 \
--to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
--cc=bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dev-VfR2kkLFssw@public.gmane.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.