Skip to content

Commit 367d2ee

Browse files
authored
UWP: Migrate from C++/CX to C++/WinRT (libretro#18558)
- Replace ref class with winrt::implements<> - Convert Platform::String^ to winrt::hstring - Update event handlers to C++/WinRT delegates - Add PackageReference for auto NuGet restore - Add specific Xbox model CPU detection via Gaming Device Info API Signed-off-by: SternXD <[email protected]>
1 parent aa8053c commit 367d2ee

File tree

5 files changed

+460
-340
lines changed

5 files changed

+460
-340
lines changed

libretro-common/vfs/vfs_implementation_uwp.cpp

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,12 @@
2020
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
*/
2222

23-
#include <retro_environment.h>
24-
2523
#include <ppl.h>
2624
#include <ppltasks.h>
2725
#include <stdio.h>
2826
#include <wrl.h>
2927
#include <wrl/implements.h>
3028
#include <robuffer.h>
31-
#include <collection.h>
3229
#include <functional>
3330
#include <fileapifromapp.h>
3431
#include <AclAPI.h>
@@ -50,7 +47,6 @@
5047
#include <file/file_path.h>
5148
#include <string/stdstring.h>
5249
#include <retro_environment.h>
53-
#include <uwp/uwp_async.h>
5450
#include <uwp/std_filesystem_compat.h>
5551

5652
namespace
@@ -73,25 +69,6 @@ namespace
7369
}
7470
}
7571

76-
#ifdef VFS_FRONTEND
77-
struct retro_vfs_file_handle
78-
#else
79-
struct libretro_vfs_implementation_file
80-
#endif
81-
{
82-
int64_t size;
83-
uint64_t mappos;
84-
uint64_t mapsize;
85-
FILE* fp;
86-
HANDLE fh;
87-
char* buf;
88-
char* orig_path;
89-
uint8_t* mapped;
90-
int fd;
91-
unsigned hints;
92-
enum vfs_scheme scheme;
93-
};
94-
9572
#define RFILE_HINT_UNBUFFERED (1 << 8)
9673

9774
int retro_vfs_file_close_impl(libretro_vfs_implementation_file* stream)
@@ -349,7 +326,7 @@ libretro_vfs_implementation_file* retro_vfs_file_open_impl(
349326
goto error;
350327

351328
stream->fh = file_handle;
352-
if ((stream->fd = _open_osfhandle((uint64)stream->fh, flags)) == -1)
329+
if ((stream->fd = _open_osfhandle((uintptr_t)stream->fh, flags)) == -1)
353330
goto error;
354331

355332
{
@@ -394,7 +371,7 @@ libretro_vfs_implementation_file* retro_vfs_file_open_impl(
394371
return NULL;
395372
}
396373

397-
static int uwp_mkdir_impl(std::experimental::filesystem::path dir)
374+
static int uwp_mkdir_impl(std::filesystem::path dir)
398375
{
399376
/*I feel like this should create the directory recursively but the existing implementation does not so this update won't
400377
*I put in the work but I just commented out the stuff you would need */

0 commit comments

Comments
 (0)