public override bool VisitArrayType(ArrayType array, TypeQualifiers quals) { TypeMap typeMap; if (TypeMapDatabase.FindTypeMap(array, out typeMap) && typeMap.IsIgnored) { Ignore(); return false; } if (array.SizeType != ArrayType.ArraySize.Constant) return true; var arrayElemType = array.Type.Desugar(); Class @class; if (arrayElemType.TryGetClass(out @class) && @class.IsRefType) return true; PrimitiveType primitive; if ((arrayElemType.IsPrimitiveType(out primitive) && primitive != PrimitiveType.LongDouble) || arrayElemType.IsPointerToPrimitiveType()) return true; Ignore(); return false; }
public override bool VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals) { // we do not support long double yet because its high-level representation is often problematic if (type == PrimitiveType.LongDouble) { Ignore(); return false; } return base.VisitPrimitiveType(type, quals); }
public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) { TypeMap typeMap; if (TypeMapDatabase.FindTypeMap(typedef, out typeMap) && typeMap.IsIgnored) { Ignore(); return false; } return base.VisitTypedefType(typedef, quals); }
public override bool VisitTemplateSpecializationType(TemplateSpecializationType template, TypeQualifiers quals) { if (AlreadyVisited(template) || template.Template.Access == AccessSpecifier.Private) return false; if (template.Arguments.Select(a => a.Type.Type.Desugar()).All(t => t.IsAddress() && !t.GetFinalPointee().IsDependent)) { var cppTypePrinter = new CppTypePrinter { PrintScopeKind = CppTypePrintScopeKind.Qualified }; templateInstantiations.Add(string.Format("{0}<{1}>", template.Template.Name, string.Join(", ", template.Arguments.Select(a => a.Type.Type.Visit(cppTypePrinter))))); } return true; }
public override bool VisitArrayType(ArrayType array, TypeQualifiers quals) { if (!VisitType(array, quals)) return false; switch (array.SizeType) { case ArrayType.ArraySize.Constant: var supportBefore = Context.SupportBefore; supportBefore.WriteLine("if ({0} != nullptr)", Context.ArgName); supportBefore.WriteStartBraceIndent(); supportBefore.WriteLine("for (int i = 0; i < {0}; i++)", array.Size); supportBefore.WriteLineIndent("{0}[i] = {1}[i]{2};", Context.ReturnVarName, Context.ArgName, array.Type.IsPointerToPrimitiveType(PrimitiveType.Void) ? ".ToPointer()" : string.Empty); supportBefore.WriteCloseBraceIndent(); break; default: Context.Return.Write("null"); break; } return true; }
public bool VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals) { throw new NotImplementedException(); }
public override bool VisitArrayType(ArrayType array, TypeQualifiers quals) { if (!VisitType(array, quals)) return false; Class @class; switch (array.SizeType) { case ArrayType.ArraySize.Constant: var supportBefore = Context.SupportBefore; string value = Generator.GeneratedIdentifier("value"); supportBefore.WriteLine("{0}[] {1} = null;", array.Type, value, array.Size); supportBefore.WriteLine("if ({0} != null)", Context.ReturnVarName); supportBefore.WriteStartBraceIndent(); supportBefore.WriteLine("{0} = new {1}[{2}];", value, array.Type, array.Size); supportBefore.WriteLine("for (int i = 0; i < {0}; i++)", array.Size); if (array.Type.IsPointerToPrimitiveType(PrimitiveType.Void)) supportBefore.WriteLineIndent("{0}[i] = new global::System.IntPtr({1}[i]);", value, Context.ReturnVarName); else if (array.Type.Desugar().TryGetClass(out @class) && @class.IsRefType) supportBefore.WriteLineIndent("{0}[i] = {1}.{2}(*(({1}.Internal*)&({3}[i * sizeof({1}.Internal)])));", value, array.Type, Helpers.CreateInstanceIdentifier, Context.ReturnVarName); else supportBefore.WriteLineIndent("{0}[i] = {1}[i];", value, Context.ReturnVarName); supportBefore.WriteCloseBraceIndent(); Context.Return.Write(value); break; case ArrayType.ArraySize.Variable: Context.Return.Write("null"); break; } return true; }
public static TypeQualifiers __CreateInstance(TypeQualifiers.Internal native) { return new TypeQualifiers(native); }
public bool VisitBuiltinType(BuiltinType builtin, TypeQualifiers quals) { throw new NotImplementedException(); }
internal TypeQualifiers(TypeQualifiers.Internal native) : this(__CopyValue(native)) { }
private static void* __CopyValue(TypeQualifiers.__Internal native) { var ret = Marshal.AllocHGlobal(3); *(TypeQualifiers.__Internal*) ret = native; return ret.ToPointer(); }
public bool VisitUnaryTransformType(UnaryTransformType unaryTransformType, TypeQualifiers quals) { throw new NotImplementedException(); }
public override bool VisitMemberPointerType(MemberPointerType member, TypeQualifiers quals) { return false; }
public bool VisitDependentNameType(DependentNameType dependent, TypeQualifiers quals) { throw new NotImplementedException(); }
public bool VisitPackExpansionType(PackExpansionType packExpansionType, TypeQualifiers quals) { throw new NotImplementedException(); }
public bool VisitInjectedClassNameType(InjectedClassNameType injected, TypeQualifiers quals) { throw new NotImplementedException(); }
public bool VisitTemplateParameterSubstitutionType(TemplateParameterSubstitutionType param, TypeQualifiers quals) { throw new NotImplementedException(); }
public bool VisitDeclaration(Declaration decl, TypeQualifiers quals) { throw new NotImplementedException(); }
public override bool VisitPointerType(PointerType pointer, TypeQualifiers quals) { if (!VisitType(pointer, quals)) return false; var param = Context.Parameter; var isRefParam = param != null && (param.IsInOut || param.IsOut); var pointee = pointer.Pointee.Desugar(); bool marshalPointeeAsString = CSharpTypePrinter.IsConstCharString(pointee) && isRefParam; if (CSharpTypePrinter.IsConstCharString(pointer) || marshalPointeeAsString) { Context.Return.Write(MarshalStringToManaged(Context.ReturnVarName, pointer.GetFinalPointee() as BuiltinType)); return true; } var finalPointee = pointer.GetFinalPointee(); PrimitiveType primitive; if (finalPointee.IsPrimitiveType(out primitive) || finalPointee.IsEnumType()) { if (isRefParam) { Context.Return.Write("_{0}", param.Name); return true; } Context.Return.Write(Context.ReturnVarName); return true; } return pointer.Pointee.Visit(this, quals); }
public bool VisitVectorType(VectorType vectorType, TypeQualifiers quals) { throw new NotImplementedException(); }
public override bool VisitType(Type type, TypeQualifiers quals) { TypeMap typeMap; if (Context.Driver.TypeDatabase.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = type; typeMap.CSharpMarshalToManaged(Context); return false; } return true; }
public bool VisitCILType(CILType type, TypeQualifiers quals) { throw new NotImplementedException(); }
public override bool VisitFunctionType(FunctionType type, TypeQualifiers quals) { var currentUniqueName = this.uniqueName; this.uniqueName = 0; var ret = base.VisitFunctionType(type, quals); this.uniqueName = currentUniqueName; return ret; }
public bool VisitUnsupportedType(UnsupportedType type, TypeQualifiers quals) { throw new NotImplementedException(); }
internal TypeQualifiers(TypeQualifiers.Internal* native) : this(new global::System.IntPtr(native)) { }
public override TypePrinterResult VisitPointerType(PointerType pointer, TypeQualifiers quals) { if (MarshalKind == MarshalKind.NativeField) { return(IntPtrType); } var pointee = pointer.Pointee; if (pointee is FunctionType) { var function = pointee as FunctionType; return(string.Format("{0}", function.Visit(this, quals))); } var isManagedContext = ContextKind == TypePrinterContextKind.Managed; if (allowStrings && IsConstCharString(pointer)) { if (isManagedContext) { return("string"); } if (Parameter == null || Parameter.Name == Helpers.ReturnIdentifier) { return(IntPtrType); } if (Options.Encoding == Encoding.ASCII) { return(string.Format("[MarshalAs(UnmanagedType.LPStr)] string")); } if (Options.Encoding == Encoding.Unicode || Options.Encoding == Encoding.BigEndianUnicode) { return(string.Format("[MarshalAs(UnmanagedType.LPWStr)] string")); } throw new NotSupportedException(string.Format("{0} is not supported yet.", Options.Encoding.EncodingName)); } var desugared = pointee.Desugar(); // From http://msdn.microsoft.com/en-us/library/y31yhkeb.aspx // Any of the following types may be a pointer type: // * sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, // decimal, or bool. // * Any enum type. // * Any pointer type. // * Any user-defined struct type that contains fields of unmanaged types only. var finalPointee = pointer.GetFinalPointee(); if (finalPointee.IsPrimitiveType()) { // Skip one indirection if passed by reference bool isRefParam = Parameter != null && (Parameter.IsOut || Parameter.IsInOut); if (isManagedContext && isRefParam) { return(pointer.QualifiedPointee.Visit(this)); } if (pointee.IsPrimitiveType(PrimitiveType.Void)) { return(IntPtrType); } if (IsConstCharString(pointee) && isRefParam) { return(IntPtrType + "*"); } // Do not allow strings inside primitive arrays case, else we'll get invalid types // like string* for const char **. allowStrings = isRefParam; var result = pointer.QualifiedPointee.Visit(this); allowStrings = true; return(!isRefParam && result.Type == IntPtrType ? "void**" : result + "*"); } Enumeration @enum; if (desugared.TryGetEnum(out @enum)) { // Skip one indirection if passed by reference if (isManagedContext && Parameter != null && (Parameter.IsOut || Parameter.IsInOut) && pointee == finalPointee) { return(pointer.QualifiedPointee.Visit(this)); } return(pointer.QualifiedPointee.Visit(this) + "*"); } Class @class; if ((desugared.IsDependent || desugared.TryGetClass(out @class)) && ContextKind == TypePrinterContextKind.Native) { return(IntPtrType); } return(pointer.QualifiedPointee.Visit(this)); }
private TypeQualifiers(TypeQualifiers.Internal native, bool skipVTables = false) : this(__CopyValue(native), skipVTables) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; }
public bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) { throw new NotImplementedException(); }
private TypeQualifiers(TypeQualifiers.Internal native) : this(__CopyValue(native)) { __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; }
public bool VisitDecayedType(DecayedType decayed, TypeQualifiers quals) { throw new NotImplementedException(); }
public override bool VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) { Context.Return.Write(param.Parameter.Name); return true; }
public bool VisitDependentTemplateSpecializationType(DependentTemplateSpecializationType template, TypeQualifiers quals) { throw new NotImplementedException(); }
public override TypePrinterResult VisitTemplateParameterType( TemplateParameterType param, TypeQualifiers quals) { return(param.Parameter.Name); }
public bool VisitAttributedType(AttributedType attributed, TypeQualifiers quals) { throw new NotImplementedException(); }
public override bool VisitPointerType(PointerType pointer, TypeQualifiers quals) { if (!VisitType(pointer, quals)) return false; var param = Context.Parameter; var isRefParam = param != null && (param.IsInOut || param.IsOut); var pointee = pointer.Pointee.Desugar(); bool marshalPointeeAsString = CSharpTypePrinter.IsConstCharString(pointee) && isRefParam; if (CSharpTypePrinter.IsConstCharString(pointer) || marshalPointeeAsString) { if (param.IsOut) { Context.Return.Write("IntPtr.Zero"); CSharpContext.ArgumentPrefix.Write("&"); } else if (param.IsInOut) { Context.Return.Write(MarshalStringToUnmanaged(Context.Parameter.Name)); CSharpContext.ArgumentPrefix.Write("&"); } else { Context.Return.Write(MarshalStringToUnmanaged(Context.Parameter.Name)); CSharpContext.Cleanup.WriteLine("Marshal.FreeHGlobal({0});", Context.ArgName); } return true; } if (pointee is FunctionType) { var function = pointee as FunctionType; return VisitDelegateType(function, function.ToString()); } Class @class; if (pointee.TryGetClass(out @class) && @class.IsValueType) { if (Context.Parameter.Usage == ParameterUsage.Out) { Context.SupportBefore.WriteLine("var {0} = new {1}.Internal();", Generator.GeneratedIdentifier(Context.ArgName), @class.Name); } else { Context.SupportBefore.WriteLine("var {0} = {1}.{2};", Generator.GeneratedIdentifier(Context.ArgName), Context.Parameter.Name, Helpers.InstanceIdentifier); } Context.Return.Write("new global::System.IntPtr(&{0})", Generator.GeneratedIdentifier(Context.ArgName)); return true; } var finalPointee = pointer.GetFinalPointee(); PrimitiveType primitive; if (finalPointee.IsPrimitiveType(out primitive) || finalPointee.IsEnumType()) { // From MSDN: "note that a ref or out parameter is classified as a moveable // variable". This means we must create a local variable to hold the result // and then assign this value to the parameter. if (isRefParam) { var typeName = Type.TypePrinterDelegate(finalPointee); if (param.IsInOut) Context.SupportBefore.WriteLine("{0} _{1} = {1};", typeName, param.Name); else Context.SupportBefore.WriteLine("{0} _{1};", typeName, param.Name); Context.Return.Write("&_{0}", param.Name); } else Context.Return.Write(Context.Parameter.Name); return true; } return pointer.Pointee.Visit(this, quals); }
public override TypePrinterResult VisitPackExpansionType(PackExpansionType type, TypeQualifiers quals) { return(string.Empty); }
public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) { if (!VisitType(typedef, quals)) return false; var decl = typedef.Declaration; FunctionType func; if (decl.Type.IsPointerTo<FunctionType>(out func)) { VisitDelegateType(func, typedef.Declaration.OriginalName); return true; } return decl.Type.Visit(this); }
public override TypePrinterResult VisitCILType(CILType type, TypeQualifiers quals) { return(type.Type.FullName); }
public override bool VisitFunctionType(FunctionType function, TypeQualifiers quals) { var ptrName = Generator.GeneratedIdentifier("ptr") + Context.ParameterIndex; Context.SupportBefore.WriteLine("var {0} = {1};", ptrName, Context.ReturnVarName); Context.Return.Write("({1})Marshal.GetDelegateForFunctionPointer({0}, typeof({1}))", ptrName, function.ToString()); return true; }
public override TypePrinterResult VisitPrimitiveType(PrimitiveType primitive, TypeQualifiers quals) { switch (primitive) { case PrimitiveType.Bool: // returned structs must be blittable and bool isn't return(MarshalKind == MarshalKind.NativeField ? "byte" : "bool"); case PrimitiveType.Void: return("void"); case PrimitiveType.Char16: case PrimitiveType.Char32: case PrimitiveType.WideChar: return("char"); case PrimitiveType.Char: // returned structs must be blittable and char isn't return(Options.MarshalCharAsManagedChar && ContextKind != TypePrinterContextKind.Native ? "char" : "sbyte"); case PrimitiveType.SChar: return("sbyte"); case PrimitiveType.UChar: return("byte"); case PrimitiveType.Short: case PrimitiveType.UShort: case PrimitiveType.Int: case PrimitiveType.UInt: case PrimitiveType.Long: case PrimitiveType.ULong: case PrimitiveType.LongLong: case PrimitiveType.ULongLong: return(GetIntString(primitive, Context.TargetInfo)); case PrimitiveType.Int128: return(new TypePrinterResult { Type = "fixed byte", NameSuffix = "[16]" }); // The type is always 128 bits wide case PrimitiveType.UInt128: return(new TypePrinterResult { Type = "fixed byte", NameSuffix = "[16]" }); // The type is always 128 bits wide case PrimitiveType.Half: return(new TypePrinterResult { Type = "fixed byte", NameSuffix = $"[{Context.TargetInfo.HalfWidth}]" }); case PrimitiveType.Float: return("float"); case PrimitiveType.Double: return("double"); case PrimitiveType.LongDouble: return(new TypePrinterResult { Type = "fixed byte", NameSuffix = $"[{Context.TargetInfo.LongDoubleWidth}]" }); case PrimitiveType.IntPtr: return(IntPtrType); case PrimitiveType.UIntPtr: return("global::System.UIntPtr"); case PrimitiveType.Null: return("void*"); case PrimitiveType.String: return("string"); case PrimitiveType.Float128: return("__float128"); } throw new NotSupportedException(); }
public override bool VisitPrimitiveType(PrimitiveType primitive, TypeQualifiers quals) { switch (primitive) { case PrimitiveType.Void: return true; case PrimitiveType.Bool: case PrimitiveType.Char: case PrimitiveType.UChar: case PrimitiveType.Short: case PrimitiveType.UShort: case PrimitiveType.Int: case PrimitiveType.UInt: case PrimitiveType.Long: case PrimitiveType.ULong: case PrimitiveType.LongLong: case PrimitiveType.ULongLong: case PrimitiveType.Float: case PrimitiveType.Double: case PrimitiveType.WideChar: case PrimitiveType.Null: Context.Return.Write(Context.ReturnVarName); return true; case PrimitiveType.Char16: return false; } throw new NotImplementedException(); }
public override TypePrinterResult VisitArrayType(ArrayType array, TypeQualifiers quals) { Type arrayType = array.Type.Desugar(); if ((MarshalKind == MarshalKind.NativeField || (ContextKind == TypePrinterContextKind.Native && MarshalKind == MarshalKind.ReturnVariableArray)) && array.SizeType == ArrayType.ArraySize.Constant) { if (array.Size == 0) { var pointer = new PointerType(array.QualifiedType); return(pointer.Visit(this)); } PrimitiveType primitiveType; if ((arrayType.IsPointerToPrimitiveType(out primitiveType) && !(arrayType is FunctionType)) || (arrayType.IsPrimitiveType() && MarshalKind != MarshalKind.NativeField)) { if (primitiveType == PrimitiveType.Void) { return("void*"); } return(array.QualifiedType.Visit(this)); } if (Parameter != null) { return(IntPtrType); } Enumeration @enum; if (arrayType.TryGetEnum(out @enum)) { return(new TypePrinterResult { Type = $"fixed {@enum.BuiltinType}", NameSuffix = $"[{array.Size}]" }); } Class @class; if (arrayType.TryGetClass(out @class)) { return(new TypePrinterResult { Type = "fixed byte", NameSuffix = $"[{array.Size * @class.Layout.Size}]" }); } var arrayElemType = array.QualifiedType.Visit(this).ToString(); // C# does not support fixed arrays of machine pointer type (void* or IntPtr). // In that case, replace it by a pointer to an integer type of the same size. if (arrayElemType == IntPtrType) { arrayElemType = Context.TargetInfo.PointerWidth == 64 ? "long" : "int"; } // Do not write the fixed keyword multiple times for nested array types var fixedKeyword = arrayType is ArrayType ? string.Empty : "fixed "; return(new TypePrinterResult { Type = $"{fixedKeyword}{arrayElemType}", NameSuffix = $"[{array.Size}]" }); } // const char* and const char[] are the same so we can use a string if (array.SizeType == ArrayType.ArraySize.Incomplete && arrayType.IsPrimitiveType(PrimitiveType.Char) && array.QualifiedType.Qualifiers.IsConst) { return("string"); } if (arrayType.IsPointerToPrimitiveType(PrimitiveType.Char)) { var prefix = ContextKind == TypePrinterContextKind.Managed ? string.Empty : "[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] "; return($"{prefix}string[]"); } var arraySuffix = array.SizeType != ArrayType.ArraySize.Constant && MarshalKind == MarshalKind.ReturnVariableArray ? (ContextKind == TypePrinterContextKind.Managed && arrayType.IsPrimitiveType() ? "*" : string.Empty) : "[]"; return($"{arrayType.Visit(this)}{arraySuffix}"); }
public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) { if (!VisitType(typedef, quals)) return false; var decl = typedef.Declaration; FunctionType function; if (decl.Type.IsPointerTo(out function)) { var ptrName = Generator.GeneratedIdentifier("ptr") + Context.ParameterIndex; Context.SupportBefore.WriteLine("var {0} = {1};", ptrName, Context.ReturnVarName); Context.Return.Write("({1})Marshal.GetDelegateForFunctionPointer({0}, typeof({1}))", ptrName, typedef.ToString()); return true; } return decl.Type.Visit(this); }
public override TypePrinterResult VisitVectorType(VectorType vectorType, TypeQualifiers quals) { return(vectorType.ElementType.Visit(this)); }
private bool? CheckForDefaultConstruct(Type desugared, Statement arg, TypeQualifiers qualifiers) { // Unwrapping the underlying type behind a possible pointer/reference Type type = desugared.GetFinalPointee() ?? desugared; Class decl; if (!type.TryGetClass(out decl)) return false; var ctor = arg.Declaration as Method; TypeMap typeMap; var typePrinterContext = new CSharpTypePrinterContext { CSharpKind = CSharpTypePrinterContextKind.DefaultExpression, Type = type }; string typePrinterResult = null; if (Driver.TypeDatabase.FindTypeMap(decl, type, out typeMap)) { var typeInSignature = typeMap.CSharpSignatureType( typePrinterContext).SkipPointerRefs().Desugar(); Enumeration @enum; if (typeInSignature.TryGetEnum(out @enum)) return false; if (ctor == null || !ctor.IsConstructor) return false; typePrinterResult = typeMap.CSharpSignature(typePrinterContext); if (typePrinterResult == "string" && ctor.Parameters.Count == 0) { arg.String = "\"\""; return true; } } var match = regexCtor.Match(arg.String); if (match.Success) { if (ctor != null) { var templateSpecializationType = type as TemplateSpecializationType; var typePrinter = new CSharpTypePrinter(Driver); typePrinterResult = typePrinterResult ?? (templateSpecializationType != null ? typePrinter.VisitTemplateSpecializationType( templateSpecializationType, qualifiers) : typePrinter.VisitClassDecl((Class) ctor.Namespace)).Type; arg.String = string.Format("new {0}{1}", typePrinterResult, match.Groups[2].Value); if (ctor.Parameters.Count > 0 && ctor.Parameters[0].Type.IsAddress()) arg.String = arg.String.Replace("(0)", "()"); } else arg.String = string.Format("new {0}", arg.String); } else { if (ctor != null && ctor.Parameters.Count > 0) { var finalPointee = ctor.Parameters[0].Type.SkipPointerRefs().Desugar(); Enumeration @enum; if (finalPointee.TryGetEnum(out @enum)) TranslateEnumExpression(ctor, arg, finalPointee, arg.String); } } return decl.IsValueType ? true : (bool?) null; }
public override TypePrinterResult VisitArrayType(ArrayType array, TypeQualifiers quals) { return($"{array.Type.Visit(this)}[]"); }
private static global::System.IntPtr __CopyValue(TypeQualifiers.Internal native) { global::System.IntPtr ret = Marshal.AllocHGlobal(3); *(TypeQualifiers.Internal*) ret = native; return ret; }
public override TypePrinterResult VisitBuiltinType(BuiltinType builtin, TypeQualifiers quals) { return(VisitPrimitiveType(builtin.Type)); }
private TypeQualifiers(TypeQualifiers.Internal native) : this(__CopyValue(native)) { __ownsNativeInstance = true; }
public override TypePrinterResult VisitPrimitiveType(PrimitiveType primitive, TypeQualifiers quals) { return(VisitPrimitiveType(primitive)); }
internal TypeQualifiers(TypeQualifiers.Internal native) : this(&native) { }
public bool VisitFunctionType(FunctionType function, TypeQualifiers quals) { return(false); }
public static TypeQualifiers __CreateInstance(TypeQualifiers.Internal native, bool skipVTables = false) { return new TypeQualifiers(native, skipVTables); }
public bool VisitMemberPointerType(MemberPointerType member, TypeQualifiers quals) { return(false); }
protected TypeQualifiers(TypeQualifiers.Internal* native, bool skipVTables = false) { if (native == null) return; __Instance = new global::System.IntPtr(native); }
public bool VisitBuiltinType(BuiltinType builtin, TypeQualifiers quals) { return(false); }
private static TypeQualifiers.Internal* __CopyValue(TypeQualifiers.Internal native) { var ret = (TypeQualifiers.Internal*) Marshal.AllocHGlobal(3); *ret = native; return ret; }
public bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) { return(false); }
protected TypeQualifiers(TypeQualifiers.Internal* native, bool isInternalImpl = false) { __Instance = new global::System.IntPtr(native); }
public bool VisitMemberPointerType(MemberPointerType member, TypeQualifiers quals) { throw new NotImplementedException(); }