Skip to content

Commit

Permalink
Revert "[release/6.0-staging] [Mono] Fix offset calculation for neste…
Browse files Browse the repository at this point in the history
…d struct, when pinvoke is enabled (#91424)"

This reverts commit b9895c9.
  • Loading branch information
mmitche committed Oct 18, 2023
1 parent 8915010 commit 1513bf9
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 140 deletions.
4 changes: 2 additions & 2 deletions src/mono/mono/mini/mini-amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ collect_field_info_nested (MonoClass *klass, GArray *fields_array, int offset, g
g_assert(info);
for (i = 0; i < info->num_fields; ++i) {
if (MONO_TYPE_ISSTRUCT (info->fields [i].field->type)) {
collect_field_info_nested (mono_class_from_mono_type_internal (info->fields [i].field->type), fields_array, (offset + info->fields [i].offset), pinvoke, unicode);
collect_field_info_nested (mono_class_from_mono_type_internal (info->fields [i].field->type), fields_array, info->fields [i].offset, pinvoke, unicode);
} else {
guint32 align;
StructFieldInfo f;
Expand All @@ -373,7 +373,7 @@ collect_field_info_nested (MonoClass *klass, GArray *fields_array, int offset, g
info->fields [i].mspec,
&align, TRUE, unicode);
f.offset = offset + info->fields [i].offset;
if ((i == info->num_fields - 1) && ((f.size + f.offset) < (info->native_size))) {
if (i == info->num_fields - 1 && f.size + f.offset < info->native_size) {
/* This can happen with .pack directives eg. 'fixed' arrays */
if (MONO_TYPE_IS_PRIMITIVE (f.type)) {
/* Replicate the last field to fill out the remaining place, since the code in add_valuetype () needs type information */
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,3 @@ extern "C" DLL_EXPORT Int32CLongStruct STDMETHODCALLTYPE AddCLongs(Int32CLongStr
{
return { lhs.i + rhs.i, lhs.l + rhs.l };
}

extern "C" DLL_EXPORT SDL_GameControllerBindType STDMETHODCALLTYPE getBindType(SDL_GameControllerButtonBind button)
{
return button.bindType;
}
Original file line number Diff line number Diff line change
Expand Up @@ -974,26 +974,3 @@ struct Int32CLongStruct
int32_t i;
long l;
};

typedef enum
{
SDL_CONTROLLER_BINDTYPE_NONE = 0,
SDL_CONTROLLER_BINDTYPE_BUTTON,
SDL_CONTROLLER_BINDTYPE_AXIS,
SDL_CONTROLLER_BINDTYPE_HAT
} SDL_GameControllerBindType;

typedef struct SDL_GameControllerButtonBind
{
SDL_GameControllerBindType bindType;
union
{
int button;
int axis;
struct {
int hat;
int hat_mask;
} hat;
} value;

} SDL_GameControllerButtonBind;
27 changes: 0 additions & 27 deletions src/tests/Interop/StructMarshalling/PInvoke/NestedStruct.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/tests/Interop/StructMarshalling/PInvoke/NestedStruct.csproj

This file was deleted.

6 changes: 0 additions & 6 deletions src/tests/issues.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2912,12 +2912,6 @@
</ExcludeList>
</ItemGroup>

<ItemGroup Condition=" '$(TargetArchitecture)' == 'wasm' or ('$(TargetOS)' == 'Android' or '$(TargetOS)' == 'iOSSimulator')">
<ExcludeList Include="$(XunitTestBinBase)/Interop/StructMarshalling/PInvoke/NestedStruct/**">
<Issue>https://github.com/dotnet/runtime/issues/64127</Issue>
</ExcludeList>
</ItemGroup>

<ItemGroup Condition=" $(TargetOS) == 'iOSSimulator' " >
<ExcludeList Include = "$(XunitTestBinBase)/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest/**">
<Issue>missing assembly</Issue>
Expand Down

0 comments on commit 1513bf9

Please sign in to comment.