Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.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
C# 在#if false块中对预处理器代码的貌似评估_C#_Unity3d_Undef - Fatal编程技术网

C# 在#if false块中对预处理器代码的貌似评估

C# 在#if false块中对预处理器代码的貌似评估,c#,unity3d,undef,C#,Unity3d,Undef,我通过MonoDevelop 4.0.1(Unity的当前版本)在C#中工作, 而且有一种看似怪异的语言 这是我的整个.cs文件: #if false #define foo #endif class myClass { int member; } #if false #error this error does not trigger #undef foo // "cannot define or undefine preprocessor symbols after firs

我通过MonoDevelop 4.0.1(Unity的当前版本)在C#中工作, 而且有一种看似怪异的语言

这是我的整个.cs文件:

#if false

#define foo

#endif

class myClass {
  int member;
}

#if false

#error this error does not trigger

#undef foo
// "cannot define or undefine preprocessor symbols after first token in file

#endif
我理解在声明令牌后不
#undef
处理预处理器符号的规则,但在这种情况下,我不
#undef
处理,因为
#undef
#if false


这个例子并不是完全设计的,它试图通过一个方法来描述一个源文件在C和C++中编译。

< P> VisualStudio不抱怨相同的代码。我想你在莫诺河发现了一个bug。< / P>我发现,在没有正确的语言编码的情况下,我甚至会尝试编写同样的C和C++代码!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!