Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos clang是否允许预处理器==?_Macos_Clang_Osx Mountain Lion - Fatal编程技术网

Macos clang是否允许预处理器==?

Macos clang是否允许预处理器==?,macos,clang,osx-mountain-lion,Macos,Clang,Osx Mountain Lion,我试图在Mac OS X 10.8上编译PHP,遇到以下问题: In file included from /Users/ryan/Downloads/php-5.4.5/ext/phar/util.c:23: ext/phar/phar_internal.h:223:19: error: invalid token at start of a preprocessor expression # if SIZEOF_SHORT == 2 ^ 我不

我试图在Mac OS X 10.8上编译PHP,遇到以下问题:

In file included from /Users/ryan/Downloads/php-5.4.5/ext/phar/util.c:23:
ext/phar/phar_internal.h:223:19: error: invalid token at start of a preprocessor
      expression
# if SIZEOF_SHORT == 2
                  ^

我不确定为什么会发生这个错误,因为我觉得这很好。我已经打开了头文件,如果没有,我可以进行更改或删除if,因为我知道我的系统应该是什么,但我想知道这是否是解决此问题的正确方法。

我没有找到解决此问题的方法,但是我删除了if,留下了无论如何都会被处理的行,程序编译得很好。我真的不知道这个文件出了什么问题。

它看起来像
SIZEOF\u SHORT
扩展为没有令牌。您应该调查
SIZEOF_SHORT
的位置
\define
d(这可能通过
-DSIZEOF_SHORT=
在命令行上),并修复它以提供正确的值

或者,您可以使用以下选项:

#include "limits.h"
/* ... */
#if SHRT_BIT == CHAR_BIT * 2

SIZEOF_是如何定义的?clang对“#if==2”给出了相同的错误。