1.#ifdef __cplusplus
extern "C" {
#endif
作用:
一般用于将C++代码以标准C形式输出(即以C的形式被调用),这是因为C++虽然常被认为是C的超集,但是C++的编译器还是与C的编译器不同的。C中调用C++中的代码这样定义会是安全的。
2. 预编译指令#if:如果给定条件为真,则编译下面代码
#if OS_MBOX_EN > 0
typedef struct os_mbox_data {
void *OSMsg; /* Pointer to message in mailbox */
#if OS_LOWEST_PRIO <= 63
INT8U OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur */
INT8U OSEventGrp; /* Group corresponding to tasks waiting for event to occur */
#else
INT16U OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur */
INT16U OSEventGrp; /* Group corresponding to tasks waiting for event to occur */
#endif //结束一个#if……#else条件编译块
} OS_MBOX_DATA;
#endif
3.

浙公网安备 33010602011771号