【发布时间】:2013-01-18 09:45:06
【问题描述】:
我正在预处理我的 InfoPlist 文件以包含我的修订号。我的标题如下所示:
#import "svn.h"
#define APP_VERSION 1.0
#define APP_BUILD APP_VERSION.SVN_REVISION
当我从程序中检查我的构建版本时,它是1.0 . 123456。但如果我试试这个:
#import "svn.h"
#define APP_VERSION 1.0
#define APP_BUILD APP_VERSION ## . ## SVN_REVISION
我明白了
error: pasting formed 'APP_VERSION.', an invalid preprocessing token
error: pasting formed '.SVN_REVISION', an invalid preprocessing token
我见过this question,但它实际上并没有给出答案; OP 实际上并不需要连接标记。我愿意。如何在不插入空格的情况下连接两个带有点的宏?
【问题讨论】:
标签: c-preprocessor