Declare platform.h functions with C linkage (#2218)

The platform.h headers for both RP2040 and RP2350 need 'extern "C"'
declarations when included from C++ code or 'rp2040_chip_version'
and 'rp2350_chip_version' won't be found by the linker.
This commit is contained in:
Richard Hulme 2025-02-02 18:44:17 +01:00 committed by GitHub
parent 6c06f90bfe
commit d7f6582459
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View file

@ -77,6 +77,10 @@
#ifndef __ASSEMBLER__
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief No-op function for the body of tight loops
* \ingroup pico_platform
*
@ -210,6 +214,10 @@ return a;
(__builtin_popcount(b) >= 2 ? __mul_instruction(a,b) : (a)*(b)), \
(a)*(b))
#ifdef __cplusplus
}
#endif
#endif // __ASSEMBLER__
#endif

View file

@ -70,6 +70,10 @@
#ifndef __ASSEMBLER__
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief No-op function for the body of tight loops
* \ingroup pico_platform
*
@ -281,6 +285,10 @@ __force_inline static int32_t __mul_instruction(int32_t a, int32_t b) {
(__builtin_popcount(b) >= 2 ? __mul_instruction(a,b) : (a)*(b)), \
(a)*(b))
#ifdef __cplusplus
}
#endif
#endif // __ASSEMBLER__
#endif