Make the bizinvoker, when not in compatibility mode, marshal bool returns as C++ would expect you to, and not winapi because fuck winapi

This commit is contained in:
nattthebear 2017-06-06 17:59:27 -04:00
parent e298863b3d
commit deaf22cb36
1 changed files with 4 additions and 1 deletions

View File

@ -309,7 +309,10 @@ namespace BizHawk.Common.BizInvoke
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Ldfld, field);
il.EmitCalli(OpCodes.Calli, nativeCall, returnType, nativeParamTypes.ToArray());
il.EmitCalli(OpCodes.Calli,
nativeCall,
returnType == typeof(bool) ? typeof(byte) : returnType, // undo winapi style bool garbage
nativeParamTypes.ToArray());
if (monitorField != null) // monitor: finally exit
{