什么是平台名称宏? (例如,__SVR4)

时间:2010-02-26 03:06:42

标签: c cross-platform macros

pycups-1.9.48库不能在Mac OS 10.6上构建,除非我删除了这个ifdef:

#ifdef __SVR4
/*
 * A rudimentary emulation of getline() for systems that dont support it
 * natively.  Since this is used for PPD file reading, it assumes (possibly
 * falsely) that BUFSIZ is big enough.
 */
ssize_t
getline(char **line, size_t *linelen, FILE *fp)
{
...

我猜测_SVR4在SVR4编译环境中的某处定义,以便预处理器知道它应该包含这个自制的getline实现。这个机制叫做什么?谷歌搜索__SVR4实际上获得了大量的源代码和人们讨论源代码的点击。

而且,更一般地说,Snow Leopard是否有相同的符号,所以我可以编译这段代码而无需学习autoconf或手工编辑它?

1 个答案:

答案 0 :(得分:0)