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

commit 88a43313483e98277b957a5f26edef66d9b0ee53
Author: Jukka Laitinen <[email protected]>
AuthorDate: Mon Sep 28 12:43:37 2026 +0300

    arch/arm/imxrt: Fix imxrt_clockconfig_ver3 c++ linkage
    
    There was a mismatched EXTERN definition for ver3 in imxrt_periphclks.h,
    and the extern definitions should be there in imxrt_clockconfig_ver3.h
    
    Signed-off-by: Jukka Laitinen <[email protected]>
---
 arch/arm/src/imxrt/imxrt_clockconfig_ver3.h | 16 +++++++++++++++-
 arch/arm/src/imxrt/imxrt_periphclks.h       |  5 +++--
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/arch/arm/src/imxrt/imxrt_clockconfig_ver3.h 
b/arch/arm/src/imxrt/imxrt_clockconfig_ver3.h
index 56cd41ba6c4..3d6b19ab9bf 100644
--- a/arch/arm/src/imxrt/imxrt_clockconfig_ver3.h
+++ b/arch/arm/src/imxrt/imxrt_clockconfig_ver3.h
@@ -194,7 +194,16 @@ struct clock_configuration_s
  * Public Data
  ****************************************************************************/
 
-extern const struct clock_configuration_s g_initial_clkconfig;
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+EXTERN const struct clock_configuration_s g_initial_clkconfig;
 
 /****************************************************************************
  * Pre-processor Definitions
@@ -308,4 +317,9 @@ int imxrt_get_clock(int clkname, uint32_t *frequency);
 
 int imxrt_get_rootclock(uint32_t clkroot, uint32_t *frequency);
 
+#undef EXTERN
+#if defined(__cplusplus)
+}
+#endif
+
 #endif /* __ARCH_ARM_SRC_IMXRT_IMXRT_CLOCKCONFIG_VER3_H */
diff --git a/arch/arm/src/imxrt/imxrt_periphclks.h 
b/arch/arm/src/imxrt/imxrt_periphclks.h
index ccbec63274b..b8d700a3e72 100644
--- a/arch/arm/src/imxrt/imxrt_periphclks.h
+++ b/arch/arm/src/imxrt/imxrt_periphclks.h
@@ -610,10 +610,11 @@ void imxrt_periphclk_configure(uintptr_t regaddr, 
unsigned int index,
 
 #endif
 
-#endif /* !CONFIG_ARCH_FAMILY_IMXRT118x */
-
 #undef EXTERN
 #if defined(__cplusplus)
 }
 #endif
+
+#endif /* !CONFIG_IMXRT_CLOCKCONFIG_VER3 */
+
 #endif /* __ARCH_ARM_SRC_IMXRT_IMXRT_PERIPHCLKS_H */

Reply via email to