例如,可以使用'uname -a'的输出来创建下面的COMPILED_ON宏吗?
#include <stdio.h>
#define COMPILED_ON `call uname -a and use the output as a quoted string'
int main( int argc, char **argv ) {
printf( COMPILED_ON );
return 0;
}
最佳答案
不是,但:
gcc -DCOMPILED_ON="$(uname -a)"
关于c - gcc C预处理程序可以使用shell命令的输出吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5319289/