mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
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:
parent
6c06f90bfe
commit
d7f6582459
2 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue