diff --git a/src/Mono.Cxxi/Abi/Impl/MsvcAbi.cs b/src/Mono.Cxxi/Abi/Impl/MsvcAbi.cs index 49bdc307..b75e6951 100644 --- a/src/Mono.Cxxi/Abi/Impl/MsvcAbi.cs +++ b/src/Mono.Cxxi/Abi/Impl/MsvcAbi.cs @@ -210,6 +210,9 @@ public virtual string GetTypeCode (CppType mangleType) code.Append(mangleType.ElementTypeName); code.Append ("@@"); break; + case CppTypes.Bool: + code.Append("_N"); + break; } return code.ToString (); diff --git a/src/Mono.Cxxi/CppField.cs b/src/Mono.Cxxi/CppField.cs index 3902da69..29d5c439 100644 --- a/src/Mono.Cxxi/CppField.cs +++ b/src/Mono.Cxxi/CppField.cs @@ -53,6 +53,20 @@ public T this [CppInstancePtr ip] { retVal = Marshal.ReadInt16 (ip.Native, fieldOffset); else if (retType.Equals (typeof (Int32))) retVal = Marshal.ReadInt32 (ip.Native, fieldOffset); + else if (retType.Equals(typeof(Double))) + { + IntPtr doubleStart = new IntPtr(ip.Native.ToInt64() + fieldOffset); + byte[] buffer = new byte[8]; + Marshal.Copy(doubleStart, buffer, 0, 8); + retVal = BitConverter.ToDouble(buffer, 0); + } + else if (retType.Equals(typeof(Int64))) + { + IntPtr doubleStart = new IntPtr(ip.Native.ToInt64() + fieldOffset); + byte[] buffer = new byte[8]; + Marshal.Copy(doubleStart, buffer, 0, 8); + retVal = BitConverter.ToInt64(buffer, 0); + } else if (typeof (ICppObject).IsAssignableFrom (retType)) {