This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new b4be1070733 include, drivers, boards: Remove the last EXTERN
definitions.
b4be1070733 is described below
commit b4be1070733b267264a7d6ae8c8c51e78f805425
Author: Marco Casaroli <[email protected]>
AuthorDate: Wed Oct 28 16:14:21 2026 +0100
include, drivers, boards: Remove the last EXTERN definitions.
Three changes that were merged while the removal of the EXTERN macro
was in review brought it back in eight headers: include/nuttx/poll.h,
drivers/vhost/vhost-serial.h and six headers of the
raspberrypi-pico-2-w board. Remove the definitions there, as in the
other headers. The extern "C" block for C++ stays.
A program reaches include/nuttx/poll.h through nuttx/fs/fs.h (<stdio.h>
in a flat build, <aio.h>): its #undef EXTERN again removed a definition
of EXTERN that the program made for its own use.
rp23xx_extra_gpio.h declares g_cyw43439 with plain extern now. The
declaration is inside the extern "C" block of the header.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
---
boards/arm/rp23xx/raspberrypi-pico-2-w/include/board.h | 5 -----
boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_extra_gpio.h | 7 +------
boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_i2cdev.h | 5 -----
boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_i2sdev.h | 5 -----
boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_spidev.h | 5 -----
boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_spisd.h | 5 -----
drivers/vhost/vhost-serial.h | 4 ----
include/nuttx/poll.h | 5 -----
8 files changed, 1 insertion(+), 40 deletions(-)
diff --git a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/board.h
b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/board.h
index ac15e2245f6..818e48ede99 100644
--- a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/board.h
+++ b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/board.h
@@ -102,13 +102,9 @@
* Public Data
****************************************************************************/
-#undef EXTERN
#if defined(__cplusplus)
-#define EXTERN extern "C"
extern "C"
{
-#else
-#define EXTERN extern
#endif
/****************************************************************************
@@ -133,7 +129,6 @@ void rp23xx_boardearlyinitialize(void);
void rp23xx_boardinitialize(void);
-#undef EXTERN
#if defined(__cplusplus)
}
#endif
diff --git a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_extra_gpio.h
b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_extra_gpio.h
index 65efb38b9ac..1dde222addb 100644
--- a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_extra_gpio.h
+++ b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_extra_gpio.h
@@ -67,16 +67,12 @@
* Public Data
****************************************************************************/
-#undef EXTERN
#if defined(__cplusplus)
-#define EXTERN extern "C"
extern "C"
{
-#else
-#define EXTERN extern
#endif
-EXTERN gspi_dev_t *g_cyw43439;
+extern gspi_dev_t *g_cyw43439;
/****************************************************************************
* Public Function Prototypes
@@ -130,7 +126,6 @@ static inline int rp23xx_extra_gpio_get(uint32_t gpio, bool
*value)
return bcmf_get_gpio(g_cyw43439->priv, gpio, value);
}
-#undef EXTERN
#if defined(__cplusplus)
}
#endif
diff --git a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_i2cdev.h
b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_i2cdev.h
index 7baa2017676..41cbe85e317 100644
--- a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_i2cdev.h
+++ b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_i2cdev.h
@@ -38,13 +38,9 @@
* Public Data
****************************************************************************/
-#undef EXTERN
#if defined(__cplusplus)
-#define EXTERN extern "C"
extern "C"
{
-#else
-#define EXTERN extern
#endif
/****************************************************************************
@@ -63,7 +59,6 @@ extern "C"
int board_i2cdev_initialize(int bus);
#endif
-#undef EXTERN
#if defined(__cplusplus)
}
#endif
diff --git a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_i2sdev.h
b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_i2sdev.h
index c7ba25f3b9f..72c01736e6e 100644
--- a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_i2sdev.h
+++ b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_i2sdev.h
@@ -38,13 +38,9 @@
* Public Data
****************************************************************************/
-#undef EXTERN
#if defined(__cplusplus)
-#define EXTERN extern "C"
extern "C"
{
-#else
-#define EXTERN extern
#endif
/****************************************************************************
@@ -63,7 +59,6 @@ extern "C"
int board_i2sdev_initialize(int bus);
#endif
-#undef EXTERN
#if defined(__cplusplus)
}
#endif
diff --git a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_spidev.h
b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_spidev.h
index 5d1c201ff6b..7ca5ae4d85a 100644
--- a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_spidev.h
+++ b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_spidev.h
@@ -37,13 +37,9 @@
* Public Data
****************************************************************************/
-#undef EXTERN
#if defined(__cplusplus)
-#define EXTERN extern "C"
extern "C"
{
-#else
-#define EXTERN extern
#endif
/****************************************************************************
@@ -60,7 +56,6 @@ extern "C"
int board_spidev_initialize(int bus);
-#undef EXTERN
#if defined(__cplusplus)
}
#endif
diff --git a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_spisd.h
b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_spisd.h
index c3b3d65b69f..6de8ed2e162 100644
--- a/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_spisd.h
+++ b/boards/arm/rp23xx/raspberrypi-pico-2-w/include/rp23xx_spisd.h
@@ -39,13 +39,9 @@
* Public Data
****************************************************************************/
-#undef EXTERN
#if defined(__cplusplus)
-#define EXTERN extern "C"
extern "C"
{
-#else
-#define EXTERN extern
#endif
/****************************************************************************
@@ -76,7 +72,6 @@ int board_spisd_initialize(int minor, int bus);
uint8_t board_spisd_status(struct spi_dev_s *dev, uint32_t devid);
#endif
-#undef EXTERN
#if defined(__cplusplus)
}
#endif
diff --git a/drivers/vhost/vhost-serial.h b/drivers/vhost/vhost-serial.h
index 702ef9fc4ae..12c4c1a9fb8 100644
--- a/drivers/vhost/vhost-serial.h
+++ b/drivers/vhost/vhost-serial.h
@@ -40,11 +40,8 @@
****************************************************************************/
#ifdef __cplusplus
-#define EXTERN extern "C"
extern "C"
{
-#else
-#define EXTERN extern
#endif
/****************************************************************************
@@ -53,7 +50,6 @@ extern "C"
int vhost_register_serial_driver(void);
-#undef EXTERN
#ifdef __cplusplus
}
#endif
diff --git a/include/nuttx/poll.h b/include/nuttx/poll.h
index cc1aef6ed8c..cd12a75ab70 100644
--- a/include/nuttx/poll.h
+++ b/include/nuttx/poll.h
@@ -75,20 +75,15 @@ struct pollfd_s
* Public Function Prototypes
****************************************************************************/
-#undef EXTERN
#if defined(__cplusplus)
-#define EXTERN extern "C"
extern "C"
{
-#else
-#define EXTERN extern
#endif
void poll_default_cb(FAR struct pollfd_s *fds);
void poll_notify(FAR struct pollfd_s **afds, int nfds,
pollevent_t eventset);
-#undef EXTERN
#if defined(__cplusplus)
}
#endif