1.#ifdef __cplusplus

  #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.

相关文章:

  • 2021-06-19
  • 2022-01-08
  • 2021-12-19
  • 2021-12-05
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-26
  • 2021-07-29
  • 2021-05-18
  • 2021-06-12
  • 2022-12-23
  • 2022-01-20
相关资源
相似解决方案