首页 > 移动平台 > 详细

definition to expand macro then apply to pragma message

时间:2017-05-09 13:39:17      阅读:295      评论:0      收藏:0      [点我收藏+]

/* Some test definition here */

#define DEFINED_BUT_NO_VALUE

#define DEFINED_INT 1

#define DEFINED_STR "ABC"


/* definition to expand macro then apply to pragma message */

#define VALUE_TO_STRING(x) #x

#define VALUE(x) VALUE_TO_STRING(x)

#define VAR_NAME_VALUE(var) #var "="  VALUE(var)


/* Some example here */

#pragma message(VAR_NAME_VALUE(NOT_DEFINED))

#pragma message(VAR_NAME_VALUE(DEFINED_BUT_NO_VALUE))

#pragma message(VAR_NAME_VALUE(DEFINED_INT))

#pragma message(VAR_NAME_VALUE(DEFINED_STR))


definition to expand macro then apply to pragma message

原文:http://zhiyuandai.blog.51cto.com/9640630/1923562

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!