[wasm] Allow enums in unmanaged callbacks. (#61393)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fri, 12 Nov 2021 14:55:46 +0000 (06:55 -0800)
committerGitHub <noreply@github.com>
Fri, 12 Nov 2021 14:55:46 +0000 (06:55 -0800)
Fixes https://github.com/dotnet/runtime/issues/61144.

Co-authored-by: Zoltan Varga <vargaz@gmail.com>
src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs

index 2a68294..7b73771 100644 (file)
@@ -415,7 +415,7 @@ public class PInvokeTableGenerator : Task
 
     private static bool IsBlittable (Type type)
     {
-        if (type.IsPrimitive || type.IsByRef || type.IsPointer)
+        if (type.IsPrimitive || type.IsByRef || type.IsPointer || type.IsEnum)
             return true;
         else
             return false;