打印

testbed:while循环宏替换

[复制链接]
335|2
手机看帖
扫描二维码
随时随地手机跟帖
沙发
keer_zu|  楼主 | 2023-2-18 15:06 | 只看该作者
/*
* Pre-include code will be placed here
* this code is located at global scope and should consist of
* declarations, preprocessor directives (e.g. #include) or procedures
*/
static int loopValue=0;

int stub(void) {
  if(loopValue==0) {
    loopValue=1;
  }else {
    loopValue=0;
  }
  return loopValue;
}

#define while(expression) while(stub())


使用特权

评论回复
板凳
keer_zu|  楼主 | 2023-2-18 15:07 | 只看该作者
/*
* Post-include code will be placed here
* this code is located at global scope and should consist of
* declarations, preprocessor directives (e.g. #include) or procedures
*/
#undef while(expression)

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:qq群:49734243 Email:zukeqiang@gmail.com

1349

主题

12426

帖子

53

粉丝