Xcode でのみ (Visual Studio は問題ありません)、va_args を使用してラッパー関数に配置しようとすると、swprintf が壊れます。
簡単な例:
void test( wchar_t *a_buffer, int a_buffer_size, const wchar_t* a_format, ...)
{
va_list args;
va_start(args, a_format);
::swprintf(a_buffer, a_buffer_size, a_format, args );
va_end(args);
}
double value = 1.0;
wchar_t text[32];
::swprintf( text, 32, L"%f", value ); // this works (text=L"1.0000")
test(text, 32, L"%f", 30.0); // this does not work (text=L"0.0000")
どんな助けでも感謝します、それはかなりのスタンパーです。問題はXCodeの癖にあると思います。
この質問で提案されているように、私はすでにロケール設定とファイル プロパティをいじっています。
ありがとう。