ARM-software / CMSIS_5

CMSIS Version 5 Development Repository
http://arm-software.github.io/CMSIS_5/index.html
Apache License 2.0
1.31k stars 1.08k forks source link

Use of export "C" #824

Closed CurtisAMU closed 3 years ago

CurtisAMU commented 4 years ago

While cmsis_os2.h and some RTX headers (e.g. rtx_os.h) contain the

ifdef __cplusplus

extern "C" {

endif

idiom, others do not. We're using CMSIS-RTOS2 in C++ projects where export "C" in os_tick.h is required. I think, it would be consistent to include export "C" in all header files that may be included by CMSIS users.

JonatanAntoni commented 4 years ago

Hi @CurtisAMU,

thanks for pointing this out. You're right and we are going to add the extern "C" declaration to os_tick.h. Please take care to compile the RTX source code itself in C mode (not C++).

Cheers, Jonatan

RobertRostohar commented 3 years ago

extern "C" has been added as requested.

JonatanAntoni commented 3 years ago

@CurtisAMU, may I ask you to check the fix and close the issue, please?

CurtisAMU commented 3 years ago

Thank you. I checked the fix and it works.