From c7ca58ba36b28814baf9468ddf47340db71f4b13 Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Sat, 9 Mar 2019 02:46:18 +0900 Subject: [PATCH] [libusb] fix error c2001 (#5604) Fix error c2001 by specify /source-charset:utf-8. That error seems to occur on multi-byte character locale. --- ports/libusb/CONTROL | 2 +- ports/libusb/fix_c2001.patch | 92 ++++++++++++++++++++++++++++++++++++ ports/libusb/portfile.cmake | 2 + 3 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 ports/libusb/fix_c2001.patch diff --git a/ports/libusb/CONTROL b/ports/libusb/CONTROL index 02adfafe04..f7eabbc225 100644 --- a/ports/libusb/CONTROL +++ b/ports/libusb/CONTROL @@ -1,3 +1,3 @@ Source: libusb -Version: 1.0.22-1 +Version: 1.0.22-2 Description: a cross-platform library to access USB devices diff --git a/ports/libusb/fix_c2001.patch b/ports/libusb/fix_c2001.patch new file mode 100644 index 0000000000..38c4774a16 --- /dev/null +++ b/ports/libusb/fix_c2001.patch @@ -0,0 +1,92 @@ +diff --git a/msvc/libusb_dll_2015.vcxproj b/msvc/libusb_dll_2015.vcxproj +index ce562f1..e5a19fd 100644 +--- a/msvc/libusb_dll_2015.vcxproj ++++ b/msvc/libusb_dll_2015.vcxproj +@@ -53,10 +53,18 @@ + ProgramDatabase + Disabled + MultiThreadedDebugDLL ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) + + + NDEBUG;%(PreprocessorDefinitions) + MultiThreadedDLL ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) + + + libusb-1.0.rc;%(EmbedManagedResourceFile) +diff --git a/msvc/libusb_dll_2017.vcxproj b/msvc/libusb_dll_2017.vcxproj +index 8311300..f635aed 100644 +--- a/msvc/libusb_dll_2017.vcxproj ++++ b/msvc/libusb_dll_2017.vcxproj +@@ -53,10 +53,18 @@ + ProgramDatabase + Disabled + MultiThreadedDebugDLL ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) + + + NDEBUG;%(PreprocessorDefinitions) + MultiThreadedDLL ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) + + + libusb-1.0.rc;%(EmbedManagedResourceFile) +diff --git a/msvc/libusb_static_2015.vcxproj b/msvc/libusb_static_2015.vcxproj +index a182171..ce4cc66 100644 +--- a/msvc/libusb_static_2015.vcxproj ++++ b/msvc/libusb_static_2015.vcxproj +@@ -54,10 +54,18 @@ + ProgramDatabase + Disabled + MultiThreadedDebug ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) + + + NDEBUG;%(PreprocessorDefinitions) + MultiThreaded ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) + + + $(OutDir)libusb-1.0.lib +diff --git a/msvc/libusb_static_2017.vcxproj b/msvc/libusb_static_2017.vcxproj +index 1341693..8908450 100644 +--- a/msvc/libusb_static_2017.vcxproj ++++ b/msvc/libusb_static_2017.vcxproj +@@ -54,10 +54,18 @@ + ProgramDatabase + Disabled + MultiThreadedDebug ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) + + + NDEBUG;%(PreprocessorDefinitions) + MultiThreaded ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) ++ /source-charset:utf-8 %(AdditionalOptions) + + + $(OutDir)libusb-1.0.lib diff --git a/ports/libusb/portfile.cmake b/ports/libusb/portfile.cmake index 92d008206c..d2a96c73b8 100644 --- a/ports/libusb/portfile.cmake +++ b/ports/libusb/portfile.cmake @@ -10,6 +10,8 @@ vcpkg_from_github( REF v1.0.22 SHA512 b1fed66aafa82490889ee488832c6884a95d38ce7b28fb7c3234b9bce1f749455d7b91cde397a0abc25101410edb13ab2f9832c59aa7b0ea8c19ba2cf4c63b00 HEAD_REF master + PATCHES + "${CMAKE_CURRENT_LIST_DIR}/fix_c2001.patch" ) if(VCPKG_PLATFORM_TOOLSET MATCHES "v141")