From 9950a388d23b69cd86bed5306a0c6b99d7c751cb Mon Sep 17 00:00:00 2001
From: Morph <39850852+Morph1984@users.noreply.github.com>
Date: Sun, 28 May 2023 15:00:05 -0400
Subject: [PATCH] externals: Update to fmt 10 and add format_as formatter for
 BitField

Implicit conversions are now disallowed in fmt 10. Use format_as to convert to the underlying type.
---
 CMakeLists.txt         | 2 +-
 externals/vcpkg        | 2 +-
 src/common/bit_field.h | 5 +++++
 vcpkg.json             | 4 ++--
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7276ac9dd5..7e8f35a4bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -212,7 +212,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
 # Enforce the search mode of non-required packages for better and shorter failure messages
 find_package(Boost 1.79.0 REQUIRED context)
 find_package(enet 1.3 MODULE)
-find_package(fmt 9 REQUIRED)
+find_package(fmt 10 REQUIRED)
 find_package(inih 52 MODULE COMPONENTS INIReader)
 find_package(LLVM MODULE COMPONENTS Demangle)
 find_package(lz4 REQUIRED)
diff --git a/externals/vcpkg b/externals/vcpkg
index a7b6122f6b..656fcc6ab2 160000
--- a/externals/vcpkg
+++ b/externals/vcpkg
@@ -1 +1 @@
-Subproject commit a7b6122f6b6504d16d96117336a0562693579933
+Subproject commit 656fcc6ab2b05c6d999b7eaca717027ac3738f71
diff --git a/src/common/bit_field.h b/src/common/bit_field.h
index e4e58ea450..0168ff9cbf 100644
--- a/src/common/bit_field.h
+++ b/src/common/bit_field.h
@@ -188,3 +188,8 @@ private:
 
 template <std::size_t Position, std::size_t Bits, typename T>
 using BitFieldBE = BitField<Position, Bits, T, BETag>;
+
+template <std::size_t Position, std::size_t Bits, typename T, typename EndianTag = LETag>
+inline auto format_as(BitField<Position, Bits, T, EndianTag> bitfield) {
+    return bitfield.Value();
+}
diff --git a/vcpkg.json b/vcpkg.json
index 19f99e89e1..26f545c6c2 100644
--- a/vcpkg.json
+++ b/vcpkg.json
@@ -1,7 +1,7 @@
 {
     "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
     "name": "yuzu",
-    "builtin-baseline": "acc3bcf76b84ae5041c86ab55fe138ae7b8255c7",
+    "builtin-baseline": "656fcc6ab2b05c6d999b7eaca717027ac3738f71",
     "version": "1.0",
     "dependencies": [
         "boost-algorithm",
@@ -53,7 +53,7 @@
         },
         {
             "name": "fmt",
-            "version": "9.0.0"
+            "version": "10.0.0"
         }
     ]
 }