net/ionic: use standard stdbool.h
Checks
Commit Message
Any DPDK public header file which includes stdbool.h may conflict with
local definition of bool, if any, which further results in compilation
error. To avoid, used standard stdbool.h instead of defining bool
internally.
I observed this issue during a development where I included rte_uuid.h
into rte_ethdev.h. As rte_ethdev.h is included to PMD driver, it started
throwing error as given below:
CC ionic_rxtx.o
In file included from .../dpdk/build/include/rte_uuid.h:17:0,
from .../dpdk/build/include/rte_ethdev.h:161,
from .../dpdk/build/include/rte_ethdev_driver.h:18,
from .../dpdk/drivers/net/ionic/ionic_rxtx.c:34:
.../dpdk/drivers/net/ionic/ionic_osdep.h:48:17: error: two or more data types in declaration specifiers
typedef uint8_t bool;
^
In file included from .../dpdk/drivers/net/ionic/ionic_dev.h:8:0,
from .../dpdk/drivers/net/ionic/ionic.h:13,
from .../dpdk/drivers/net/ionic/ionic_mac_api.h:8,
from .../dpdk/drivers/net/ionic/ionic_rxtx.c:45:
.../dpdk/drivers/net/ionic/ionic_osdep.h:48:1: warning: useless type name in empty declaration
typedef uint8_t bool;
^~~~~~~
cc1: warning: unrecognized command line option ‘-Wno-address-of-packed-member’
.../dpdk/mk/internal/rte.compile-pre.mk:114: recipe for target 'ionic_rxtx.o' failed
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
drivers/net/ionic/ionic_dev.c | 1 +
drivers/net/ionic/ionic_mac_api.c | 1 +
drivers/net/ionic/ionic_main.c | 1 +
drivers/net/ionic/ionic_osdep.h | 1 -
drivers/net/ionic/ionic_rx_filter.c | 1 +
5 files changed, 4 insertions(+), 1 deletion(-)
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
*/
+#include <stdbool.h>
#include <rte_malloc.h>
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
*/
+#include <stdbool.h>
#include "ionic_mac_api.h"
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
* Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
*/
+#include <stdbool.h>
#include <rte_memzone.h>
@@ -45,7 +45,6 @@ typedef uint32_t __le32;
typedef uint64_t __le64;
#ifndef __cplusplus
-typedef uint8_t bool;
#define false 0
#define true 1
#endif
@@ -3,6 +3,7 @@
*/
#include <errno.h>
+#include <stdbool.h>
#include <rte_malloc.h>