From c526ec1c3d70ad736d87eb27bca009a57547c3c4 Mon Sep 17 00:00:00 2001
From: J <799564+jaguilar@users.noreply.github.com>
Date: Thu, 20 Jun 2024 10:07:32 -0400
Subject: [PATCH] custom_(un)lock_tcpip_core: link properly in C++ (#1738)

---
 src/rp2_common/pico_lwip/include/arch/cc.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/rp2_common/pico_lwip/include/arch/cc.h b/src/rp2_common/pico_lwip/include/arch/cc.h
index 7ac155e..1e7c94c 100644
--- a/src/rp2_common/pico_lwip/include/arch/cc.h
+++ b/src/rp2_common/pico_lwip/include/arch/cc.h
@@ -38,6 +38,10 @@
 #define PICO_LWIP_CUSTOM_LOCK_TCPIP_CORE 1
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if NO_SYS
 // todo really we should just not allow SYS_LIGHTWEIGHT_PROT for nosys mode (it doesn't do anything anyway)
 typedef int sys_prot_t;
@@ -90,4 +94,9 @@ void pico_lwip_custom_unlock_tcpip_core(void);
 // Use the pico_rand library which goes to reasonable lengths to try to provide good entropy
 #define LWIP_RAND() get_rand_32()
 #endif
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __CC_H__ */
-- 
GitLab