Skip to content

Commit

Permalink
winrt: Another attempt at getting this to compile.
Browse files Browse the repository at this point in the history
IntPtr isn't a POD type like I thought, so hopefully we can just construct
one that works out? C++/CX is so weird.
  • Loading branch information
icculus committed Aug 1, 2020
1 parent b131661 commit ea171c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video/winrt/SDL_winrtmessagebox.cpp
Expand Up @@ -82,7 +82,7 @@ WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
sdlButton = &messageboxdata->buttons[i];
}
UICommand ^ button = ref new UICommand(WINRT_UTF8ToPlatformString(sdlButton->text));
button->Id = (IntPtr)((size_t)(sdlButton - messageboxdata->buttons));
button->Id = IntPtr((int)((size_t)(sdlButton - messageboxdata->buttons)));
dialog->Commands->Append(button);
if (sdlButton->flags & SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT) {
dialog->CancelCommandIndex = i;
Expand All @@ -104,7 +104,7 @@ WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
return SDL_SetError("An unknown error occurred in displaying the WinRT MessageDialog");
}
if (buttonid) {
IntPtr results = (IntPtr)((size_t)(operation->GetResults()->Id));
IntPtr results = safe_cast<IntPtr>(operation->GetResults()->Id);
int clicked_index = results.ToInt32();
*buttonid = messageboxdata->buttons[clicked_index].buttonid;
}
Expand Down

0 comments on commit ea171c0

Please sign in to comment.