ClangSharp
ClangSharp copied to clipboard
A non defined function macro being used results in a crash
#define ADDRESS_IN_USE TESTRESULT_FROM_WIN32(10048)
If TESTRESULT_FROM_WIN32 is not defined, the above code will result in the following stack trace.
System.InvalidCastException
HResult=0x80004002
Message=Unable to cast object of type 'ClangSharp.Stmt' to type 'ClangSharp.Expr'.
Source=System.Private.CoreLib
StackTrace:
at System.Runtime.CompilerServices.CastHelpers.ChkCastAny(Void* toTypeHnd, Object obj)
at ClangSharp.TranslationUnit.GetOrCreate[TCursor](CXCursor handle) in C:\Users\thhous\Documents\GitHub\ClangSharp\sources\ClangSharp\TranslationUnit.cs:line 105
at ClangSharp.VarDecl.<>c__DisplayClass4_0.<.ctor>b__1() in C:\Users\thhous\Documents\GitHub\ClangSharp\sources\ClangSharp\Cursors\Decls\VarDecl.cs:line 26
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)