From: Stephen Hemminger <stephen@networkplumber.org>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>,
Jingjing Wu <jingjing.wu@intel.com>,
Bernard Iremonger <bernard.iremonger@intel.com>,
Olivier Matz <olivier.matz@6wind.com>,
dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing
Date: Fri, 8 Nov 2019 08:15:53 -0800 [thread overview]
Message-ID: <20191108081553.78d1900d@hermes.lan> (raw)
In-Reply-To: <20191106120943.15967-1-thomas@monjalon.net>
On Wed, 6 Nov 2019 13:09:43 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:
> The constants like AF_INET are in sys/socket.h in FreeBSD.
> The #ifdef macro __FreeBSD__ is replaced with RTE_EXEC_ENV_FREEBSD
> in order to be consistent across DPDK files, and allow to grep
> for EXEC_ENV among other benefits.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> app/test-pmd/cmdline.c | 2 +-
> app/test/test_cmdline_ipaddr.c | 2 +-
> examples/cmdline/commands.c | 2 +-
> lib/librte_cmdline/cmdline_parse_ipaddr.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 4478069911..74e02d6813 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -11,7 +11,7 @@
> #include <termios.h>
> #include <unistd.h>
> #include <inttypes.h>
> -#ifdef __FreeBSD__
> +#ifdef RTE_EXEC_ENV_FREEBSD
> #include <sys/socket.h>
> #endif
> #include <netinet/in.h>
> diff --git a/app/test/test_cmdline_ipaddr.c b/app/test/test_cmdline_ipaddr.c
> index 2d11ce936c..315ac3a9f8 100644
> --- a/app/test/test_cmdline_ipaddr.c
> +++ b/app/test/test_cmdline_ipaddr.c
> @@ -6,7 +6,7 @@
> #include <string.h>
> #include <inttypes.h>
> #include <netinet/in.h>
> -#ifdef __FreeBSD__
> +#ifdef RTE_EXEC_ENV_FREEBSD
> #include <sys/socket.h>
> #endif
>
> diff --git a/examples/cmdline/commands.c b/examples/cmdline/commands.c
> index 1249ee7a8a..4badffc257 100644
> --- a/examples/cmdline/commands.c
> +++ b/examples/cmdline/commands.c
> @@ -12,7 +12,7 @@
> #include <errno.h>
> #include <netinet/in.h>
> #include <termios.h>
> -#ifdef __FreeBSD__
> +#ifdef RTE_EXEC_ENV_FREEBSD
> #include <sys/socket.h>
> #endif
>
> diff --git a/lib/librte_cmdline/cmdline_parse_ipaddr.c b/lib/librte_cmdline/cmdline_parse_ipaddr.c
> index 848c1eb07d..4de5ba35ae 100644
> --- a/lib/librte_cmdline/cmdline_parse_ipaddr.c
> +++ b/lib/librte_cmdline/cmdline_parse_ipaddr.c
> @@ -13,7 +13,7 @@
> #include <errno.h>
> #include <arpa/inet.h>
> #include <netinet/in.h>
> -#ifdef __FreeBSD__
> +#ifdef RTE_EXEC_ENV_FREEBSD
> #include <sys/socket.h>
> #endif
>
Why not always include sys/socket.h having an extra include
is much less of a nuisance than a silly #ifdef.
next prev parent reply other threads:[~2019-11-08 16:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 12:09 [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing Thomas Monjalon
2019-11-06 12:11 ` Burakov, Anatoly
2019-11-08 8:44 ` Olivier Matz
2019-11-08 10:18 ` David Marchand
2019-11-08 16:15 ` Stephen Hemminger [this message]
2019-11-08 16:28 ` Thomas Monjalon
2019-11-08 18:00 ` [dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef Stephen Hemminger
2019-11-11 10:41 ` Bruce Richardson
2019-11-12 8:10 ` Olivier Matz
2019-11-12 19:14 ` David Marchand
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=20191108081553.78d1900d@hermes.lan \
--to=stephen@networkplumber.org \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=olivier.matz@6wind.com \
--cc=thomas@monjalon.net \
--cc=wenzhuo.lu@intel.com \
/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.