Skip to content

Commit

Permalink
Windowsの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Sep 6, 2023
1 parent b16e513 commit 7700e24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion example/cpp/windows/simple_tts/simple_tts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ int main() {
continue;
}
VoicevoxVoiceModel* model;
result = voicevox_voice_model_new_from_path(path.c_str(), &model);
result = voicevox_voice_model_new_from_path(wide_to_utf8_cppapi(path).c_str(),
&model);
if (result != VoicevoxResultCode::VOICEVOX_RESULT_OK) {
OutErrorMessage(result);
return 0;
Expand Down Expand Up @@ -158,6 +159,8 @@ void OutErrorMessage(VoicevoxResultCode messageCode) {
std::wcout << wideStr << std::endl;
}

// FIXME: codecvtはC++17から非推奨となり、win32で頑張って手書きしなければならない。それができたらvcxprojの_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNINGを削除する。

/// <summary>
/// ワイド文字列をUTF8に変換します。
/// </summary>
Expand Down
8 changes: 4 additions & 4 deletions example/cpp/windows/simple_tts/simple_tts.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<LanguageStandard>stdcpp17</LanguageStandard>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\core\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
Expand All @@ -113,7 +113,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\core\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
Expand All @@ -131,7 +131,7 @@
<LanguageStandard>stdcpp17</LanguageStandard>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\core\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
Expand All @@ -149,7 +149,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\core\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
Expand Down

0 comments on commit 7700e24

Please sign in to comment.