Skip to content

Commit

Permalink
[metadata] Initial support for MONO_CALL_UNMANAGED
Browse files Browse the repository at this point in the history
A MethodRefSig or a StandaloneSig can have the calling convention "unmanaged"
which is the default platform calling convention with optional modifiers
encoded in the modopts of the return type.

See dotnet/roslyn#39865 (comment)
and dotnet/runtime#34805

Contributes to dotnet/runtime#38480
  • Loading branch information
lambdageek committed Jul 8, 2020
1 parent b873e91 commit 8684def
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions mono/metadata/metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -2342,6 +2342,7 @@ mono_metadata_parse_method_signature_full (MonoImage *m, MonoGenericContainer *c
case MONO_CALL_STDCALL:
case MONO_CALL_THISCALL:
case MONO_CALL_FASTCALL:
case MONO_CALL_UNMANAGED:
method->pinvoke = 1;
break;
}
Expand Down
6 changes: 5 additions & 1 deletion mono/metadata/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ typedef enum {
MONO_CALL_STDCALL,
MONO_CALL_THISCALL,
MONO_CALL_FASTCALL,
MONO_CALL_VARARG
MONO_CALL_VARARG = 0x05,
/* unused, */
/* unused, */
/* unused, */
MONO_CALL_UNMANAGED = 0x09, /* default unmanaged calling convention, with specifics encoded in modopts */
} MonoCallConvention;

/* ECMA lamespec: the old spec had more info... */
Expand Down

0 comments on commit 8684def

Please sign in to comment.