Huge Windows utf8 I/O patch.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Thu, 21 Mar 2013 08:18:49 +0000 (19:18 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Fri, 29 Mar 2013 10:25:59 +0000 (21:25 +1100)
Patch from Janne Hyv√§rinen <cse@sci.fi>.

68 files changed:
FLAC.sln
examples/c/decode/file/example_c_decode_file.vcproj
examples/c/encode/file/example_c_encode_file.vcproj
examples/cpp/decode/file/example_cpp_decode_file.vcproj
examples/cpp/encode/file/example_cpp_encode_file.vcproj
include/share/compat.h
include/share/utf8_io.h [new file with mode: 0644]
src/flac/analyze.c
src/flac/decode.c
src/flac/encode.c
src/flac/flac.vcproj
src/flac/foreign_metadata.c
src/flac/iffscan.c
src/flac/iffscan.vcproj
src/flac/main.c
src/flac/utils.c
src/flac/vorbiscomment.c
src/libFLAC++/libFLAC++_dynamic.vcproj
src/libFLAC++/libFLAC++_static.vcproj
src/libFLAC/libFLAC_dynamic.vcproj
src/libFLAC/libFLAC_static.vcproj
src/libFLAC/metadata_iterators.c
src/libFLAC/stream_decoder.c
src/libFLAC/stream_encoder.c
src/metaflac/main.c
src/metaflac/metaflac.vcproj
src/metaflac/operations.c
src/metaflac/operations_shorthand_cuesheet.c
src/metaflac/operations_shorthand_picture.c
src/metaflac/operations_shorthand_seektable.c
src/metaflac/operations_shorthand_streaminfo.c
src/metaflac/operations_shorthand_vorbiscomment.c
src/metaflac/options.c
src/metaflac/usage.c
src/metaflac/utils.c
src/monkeys_audio_utilities/flac_mac/flac_mac.vcproj
src/monkeys_audio_utilities/flac_ren/flac_ren.vcproj
src/plugin_common/plugin_common_static.vcproj
src/share/getopt/getopt_static.vcproj
src/share/grabbag/file.c
src/share/grabbag/grabbag_static.vcproj
src/share/grabbag/picture.c
src/share/grabbag/replaygain.c
src/share/replaygain_analysis/replaygain_analysis_static.vcproj
src/share/replaygain_synthesis/replaygain_synthesis_static.vcproj
src/share/utf8/utf8_static.vcproj
src/share/utf8_io/utf8_io.c [new file with mode: 0644]
src/share/utf8_io/utf8_io.vcproj [new file with mode: 0644]
src/test_grabbag/cuesheet/main.c
src/test_grabbag/cuesheet/test_cuesheet.vcproj
src/test_grabbag/picture/test_picture.vcproj
src/test_libFLAC++/decoders.cpp
src/test_libFLAC++/encoders.cpp
src/test_libFLAC++/metadata_manip.cpp
src/test_libFLAC++/test_libFLAC++.vcproj
src/test_libFLAC/decoders.c
src/test_libFLAC/encoders.c
src/test_libFLAC/metadata_manip.c
src/test_libFLAC/test_libFLAC.vcproj
src/test_libs_common/file_utils_flac.c
src/test_libs_common/test_libs_common_static.vcproj
src/test_seeking/main.c
src/test_seeking/test_seeking.vcproj
src/test_streams/main.c
src/test_streams/test_streams.vcproj
src/utils/flacdiff/flacdiff.vcproj
src/utils/flacdiff/main.cpp
src/utils/flactimer/flactimer.vcproj

index 84bcf7b..c988415 100644 (file)
--- a/FLAC.sln
+++ b/FLAC.sln
@@ -4,23 +4,27 @@ Microsoft Visual Studio Solution File, Format Version 9.00
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "example_c_decode_file", "examples\c\decode\file\example_c_decode_file.vcproj", "{4cefbd00-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "example_c_encode_file", "examples\c\encode\file\example_c_encode_file.vcproj", "{4cefbd01-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "example_cpp_decode_file", "examples\cpp\decode\file\example_cpp_decode_file.vcproj", "{4cefbe00-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
                {4cefbc86-c215-11db-8314-0800200c9a66} = {4cefbc86-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "example_cpp_encode_file", "examples\cpp\encode\file\example_cpp_encode_file.vcproj", "{4cefbe01-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
                {4cefbc86-c215-11db-8314-0800200c9a66} = {4cefbc86-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "flac", "src\flac\flac.vcproj", "{4cefbc7d-c215-11db-8314-0800200c9a66}"\r
@@ -31,16 +35,19 @@ Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "flac", "src\flac\flac.vcpro
                {4cefbc80-c215-11db-8314-0800200c9a66} = {4cefbc80-c215-11db-8314-0800200c9a66}\r
                {4cefbc8a-c215-11db-8314-0800200c9a66} = {4cefbc8a-c215-11db-8314-0800200c9a66}\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "iffscan", "src\flac\iffscan.vcproj", "{4cefbc94-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "flac_mac", "src\monkeys_audio_utilities\flac_mac\flac_mac.vcproj", "{4cefbc7e-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc81-c215-11db-8314-0800200c9a66} = {4cefbc81-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "flac_ren", "src\monkeys_audio_utilities\flac_ren\flac_ren.vcproj", "{4cefbc7f-c215-11db-8314-0800200c9a66}"\r
@@ -48,6 +55,7 @@ EndProject
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "flacdiff", "src\utils\flacdiff\flacdiff.vcproj", "{4cefbc93-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc86-c215-11db-8314-0800200c9a66} = {4cefbc86-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "flactimer", "src\utils\flactimer\flactimer.vcproj", "{4cefbc95-c215-11db-8314-0800200c9a66}"\r
@@ -58,20 +66,26 @@ Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "grabbag_static", "src\share
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
                {4cefbc89-c215-11db-8314-0800200c9a66} = {4cefbc89-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "libFLAC_dynamic", "src\libFLAC\libFLAC_dynamic.vcproj", "{4cefbc83-c215-11db-8314-0800200c9a66}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
+       EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "libFLAC_static", "src\libFLAC\libFLAC_static.vcproj", "{4cefbc84-c215-11db-8314-0800200c9a66}"\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "libFLAC++_dynamic", "src\libFLAC++\libFLAC++_dynamic.vcproj", "{4cefbc85-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc83-c215-11db-8314-0800200c9a66} = {4cefbc83-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "libFLAC++_static", "src\libFLAC++\libFLAC++_static.vcproj", "{4cefbc86-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "metaflac", "src\metaflac\metaflac.vcproj", "{4cefbc87-c215-11db-8314-0800200c9a66}"\r
@@ -81,12 +95,14 @@ Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "metaflac", "src\metaflac\me
                {4cefbc92-c215-11db-8314-0800200c9a66} = {4cefbc92-c215-11db-8314-0800200c9a66}\r
                {4cefbc89-c215-11db-8314-0800200c9a66} = {4cefbc89-c215-11db-8314-0800200c9a66}\r
                {4cefbc81-c215-11db-8314-0800200c9a66} = {4cefbc81-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "plugin_common_static", "src\plugin_common\plugin_common_static.vcproj", "{4cefbc88-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc81-c215-11db-8314-0800200c9a66} = {4cefbc81-c215-11db-8314-0800200c9a66}\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "replaygain_analysis_static", "src\share\replaygain_analysis\replaygain_analysis_static.vcproj", "{4cefbc89-c215-11db-8314-0800200c9a66}"\r
@@ -96,6 +112,7 @@ EndProject
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "test_cuesheet", "src\test_grabbag\cuesheet\test_cuesheet.vcproj", "{4cefbc8b-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc81-c215-11db-8314-0800200c9a66} = {4cefbc81-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "test_libFLAC", "src\test_libFLAC\test_libFLAC.vcproj", "{4cefbc8c-c215-11db-8314-0800200c9a66}"\r
@@ -103,6 +120,7 @@ Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "test_libFLAC", "src\test_li
                {4cefbc8e-c215-11db-8314-0800200c9a66} = {4cefbc8e-c215-11db-8314-0800200c9a66}\r
                {4cefbc81-c215-11db-8314-0800200c9a66} = {4cefbc81-c215-11db-8314-0800200c9a66}\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "test_libFLAC++", "src\test_libFLAC++\test_libFLAC++.vcproj", "{4cefbc8d-c215-11db-8314-0800200c9a66}"\r
@@ -110,152 +128,225 @@ Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "test_libFLAC++", "src\test_
                {4cefbc86-c215-11db-8314-0800200c9a66} = {4cefbc86-c215-11db-8314-0800200c9a66}\r
                {4cefbc81-c215-11db-8314-0800200c9a66} = {4cefbc81-c215-11db-8314-0800200c9a66}\r
                {4cefbc8e-c215-11db-8314-0800200c9a66} = {4cefbc8e-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "test_libs_common_static", "src\test_libs_common\test_libs_common_static.vcproj", "{4cefbc8e-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "test_picture", "src\test_grabbag\picture\test_picture.vcproj", "{4cefbc8f-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc81-c215-11db-8314-0800200c9a66} = {4cefbc81-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "test_seeking", "src\test_seeking\test_seeking.vcproj", "{4cefbc90-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc84-c215-11db-8314-0800200c9a66} = {4cefbc84-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "test_streams", "src\test_streams\test_streams.vcproj", "{4cefbc91-c215-11db-8314-0800200c9a66}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {4cefbc81-c215-11db-8314-0800200c9a66} = {4cefbc81-c215-11db-8314-0800200c9a66}\r
+               {4cefbe02-c215-11db-8314-0800200c9a66} = {4cefbe02-c215-11db-8314-0800200c9a66}\r
        EndProjectSection\r
 EndProject\r
 Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "utf8_static", "src\share\utf8\utf8_static.vcproj", "{4cefbc92-c215-11db-8314-0800200c9a66}"\r
 EndProject\r
+EndProject\r
+Project("{4cefbc7c-c215-11db-8314-0800200c9a66}") = "utf8_io", "src\share\utf8_io\utf8_io.vcproj", "{4cefbe02-c215-11db-8314-0800200c9a66}"\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Win32 = Debug|Win32\r
                Release|Win32 = Release|Win32\r
+               Release (UTF8)|Win32 = Release (UTF8)|Win32\r
        EndGlobalSection\r
        GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
                {4cefbc7d-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc7d-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc7d-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc7d-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc7d-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc7d-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc7e-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc7e-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc7e-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc7e-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc7e-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc7e-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc7f-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc7f-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc7f-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc7f-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc7f-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc7f-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc80-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc80-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc80-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc80-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc80-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc80-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc81-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc81-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc81-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc81-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc81-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc81-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc82-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc82-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc82-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc82-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc82-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc82-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc83-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc83-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc83-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc83-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc83-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc83-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc84-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc84-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc84-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc84-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc84-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc84-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc85-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc85-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc85-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc85-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc85-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc85-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc86-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc86-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc86-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc86-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc86-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc86-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc87-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc87-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc87-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc87-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc87-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc87-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc88-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc88-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc88-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc88-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc88-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc88-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc89-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc89-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc89-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc89-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc89-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc89-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc8a-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc8a-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc8a-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc8a-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc8a-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc8a-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc8b-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc8b-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc8b-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc8b-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc8b-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc8b-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc8c-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc8c-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc8c-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc8c-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc8c-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc8c-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc8d-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc8d-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc8d-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc8d-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc8d-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc8d-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc8e-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc8e-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc8e-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc8e-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc8e-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc8e-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc8f-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc8f-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc8f-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc8f-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc8f-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc8f-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc90-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc90-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc90-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc90-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc90-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc90-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc91-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc91-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc91-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc91-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc91-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc91-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc92-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc92-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc92-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc92-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc92-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc92-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc93-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc93-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc93-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc93-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc93-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc93-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc94-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc94-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc94-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc94-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc94-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc94-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbc95-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbc95-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbc95-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbc95-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbc95-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbc95-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbd00-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbd00-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbd00-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbd00-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbd00-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbd00-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbd01-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbd01-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbd01-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbd01-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbd01-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbd01-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbe00-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbe00-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbe00-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbe00-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbe00-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbe00-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
                {4cefbe01-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {4cefbe01-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
                {4cefbe01-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
                {4cefbe01-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbe01-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbe01-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
+               {4cefbe02-c215-11db-8314-0800200c9a66}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {4cefbe02-c215-11db-8314-0800200c9a66}.Debug|Win32.Build.0 = Debug|Win32\r
+               {4cefbe02-c215-11db-8314-0800200c9a66}.Release|Win32.ActiveCfg = Release|Win32\r
+               {4cefbe02-c215-11db-8314-0800200c9a66}.Release|Win32.Build.0 = Release|Win32\r
+               {4cefbe02-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.ActiveCfg = Release (UTF8)|Win32\r
+               {4cefbe02-c215-11db-8314-0800200c9a66}.Release (UTF8)|Win32.Build.0 = Release (UTF8)|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
index 2498c81..4b1d250 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\..\objs\release\bin"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories="..\..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="..\..\..\..\objs\release\lib\libogg_static.lib"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 4d10ac5..a6287fd 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\..\objs\release\bin"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories="..\..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="..\..\..\..\objs\release\lib\libogg_static.lib"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index b09bc0f..40226ca 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\..\objs\release\bin"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories="..\..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="..\..\..\..\objs\release\lib\libogg_static.lib"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 38a3e26..a2ea87e 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\..\objs\release\bin"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories="..\..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="..\..\..\..\objs\release\lib\libogg_static.lib"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 64139a2..5c9f328 100644 (file)
 #  endif
 #endif /* defined _MSC_VER */
 
+#ifdef FLAC__STRINGS_IN_UTF8 /* all char* strings are in UTF-8 format. Added to support Unicode files on Windows */
+#include "share/utf8_io.h"
+
+#define flac_printf printf_utf8
+#define flac_fprintf fprintf_utf8
+#define flac_vfprintf vfprintf_utf8
+#define flac_fopen fopen_utf8
+#define flac_stat _stat64_utf8
+#define flac_chmod chmod_utf8
+#define flac_utime utime_utf8
+#define flac_unlink unlink_utf8
+#define flac_rename rename_utf8
+
+#else
+
+#define flac_printf printf
+#define flac_fprintf fprintf
+#define flac_vfprintf vfprintf
+#define flac_fopen fopen
+#ifdef _WIN32
+#define flac_stat _stat64
+#else
+#define flac_stat stat
+#endif
+#define flac_chmod chmod
+#define flac_utime utime
+#define flac_unlink unlink
+#define flac_rename rename
+#endif
+
+#ifdef _WIN32
+#define _flac_stat _stat64 /* stat struct */
+#define flac_fstat _fstat64
+#else
+#define _flac_stat stat /* stat struct */
+#define flac_fstat fstat
+#endif
+
 
 /* FLAC needs to compile and work correctly on systems with a norrmal ISO C99
  * snprintf as well as Microsoft Visual Studio which has an non-standards
diff --git a/include/share/utf8_io.h b/include/share/utf8_io.h
new file mode 100644 (file)
index 0000000..1b8988a
--- /dev/null
@@ -0,0 +1,34 @@
+#ifdef FLAC__STRINGS_IN_UTF8
+
+#ifndef flac__utf8_io_h
+#define flac__utf8_io_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include <sys/stat.h>
+#include <stdarg.h>
+
+
+int get_utf8_argv(int *argc, char ***argv);
+
+int printf_utf8(const char *format, ...);
+int fprintf_utf8(FILE *stream, const char *format, ...);
+int vfprintf_utf8(FILE *stream, const char *format, va_list argptr);
+
+FILE *fopen_utf8(const char *filename, const char *mode);
+int stat_utf8(const char *path, struct stat *buffer);
+int _stat64_utf8(const char *path, struct _stat64 *buffer);
+int chmod_utf8(const char *filename, int pmode);
+int utime_utf8(const char *filename, struct utimbuf *times);
+int unlink_utf8(const char *filename);
+int rename_utf8(const char *oldname, const char *newname);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
+#endif
index f5a3f2e..67020d0 100644 (file)
@@ -217,7 +217,7 @@ FLAC__bool dump_stats(const subframe_stats_t *stats, const char *filename)
        const double s1 = stats->stddev, s2 = s1*2, s3 = s1*3, s4 = s1*4, s5 = s1*5, s6 = s1*6;
        const double p = stats->buckets[stats->peak_index].count;
 
-       outfile = fopen(filename, "w");
+       outfile = flac_fopen(filename, "w");
 
        if(0 == outfile) {
                fprintf(stderr, "ERROR opening %s: %s\n", filename, strerror(errno));
index cc6bdc5..646c386 100644 (file)
@@ -244,7 +244,7 @@ FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__
                        d->fout = grabbag__file_get_binary_stdout();
                }
                else {
-                       if(0 == (d->fout = fopen(outfilename, "wb"))) {
+                       if(0 == (d->fout = flac_fopen(outfilename, "wb"))) {
                                flac__utils_printf(stderr, 1, "%s: ERROR: can't open output file %s: %s\n", d->inbasefilename, outfilename, strerror(errno));
                                DecoderSession_destroy(d, /*error_occurred=*/true);
                                return false;
@@ -263,7 +263,7 @@ void DecoderSession_destroy(DecoderSession *d, FLAC__bool error_occurred)
        if(0 != d->fout && d->fout != stdout) {
                fclose(d->fout);
                if(error_occurred)
-                       unlink(d->outfilename);
+                       flac_unlink(d->outfilename);
        }
 }
 
@@ -926,7 +926,7 @@ FLAC__bool fixup_iff_headers(DecoderSession *d)
                d->format==FORMAT_WAVE64? "Wave64" :
                d->format==FORMAT_RF64? "RF64" :
                "AIFF";
-       FILE *f = fopen(d->outfilename, "r+b"); /* stream is positioned at beginning of file */
+       FILE *f = flac_fopen(d->outfilename, "r+b"); /* stream is positioned at beginning of file */
 
        if(0 == f) {
                flac__utils_printf(stderr, 1, "ERROR, couldn't open file %s while fixing up %s chunk size: %s\n", d->outfilename, fmt_desc, strerror(errno));
index 50ca006..9e2cb77 100644 (file)
@@ -1665,7 +1665,7 @@ int EncoderSession_finish_error(EncoderSession *e)
                print_verify_error(e);
        else if(e->outputfile_opened)
                /* only want to delete the file if we opened it; otherwise it could be an existing file and our overwrite failed */
-               unlink(e->outfilename);
+               flac_unlink(e->outfilename);
 
        EncoderSession_destroy(e);
 
@@ -2562,7 +2562,7 @@ FLAC__bool parse_cuesheet(FLAC__StreamMetadata **cuesheet, const char *cuesheet_
                return false;
        }
 
-       if(0 == (f = fopen(cuesheet_filename, "r"))) {
+       if(0 == (f = flac_fopen(cuesheet_filename, "r"))) {
                flac__utils_printf(stderr, 1, "%s: ERROR opening cuesheet \"%s\" for reading: %s\n", inbasefilename, cuesheet_filename, strerror(errno));
                return false;
        }
@@ -2800,9 +2800,9 @@ FLAC__bool read_sane_extended(FILE *f, FLAC__uint32 *val, const char *fn)
 FLAC__bool fskip_ahead(FILE *f, FLAC__uint64 offset)
 {
        static unsigned char dump[8192];
-       struct stat stb;
+       struct _flac_stat stb;
 
-       if(fstat(fileno(f), &stb) == 0 && (stb.st_mode & S_IFMT) == S_IFREG)
+       if(flac_fstat(fileno(f), &stb) == 0 && (stb.st_mode & S_IFMT) == S_IFREG)
        {
                if(fseeko(f, offset, SEEK_CUR) == 0)
                        return true;
index d0d5032..f166a95 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\objs\release\bin"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".;..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="..\..\objs\release\lib\libogg_static.lib"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 3015f1d..8372926 100644 (file)
@@ -702,7 +702,7 @@ void flac__foreign_metadata_delete(foreign_metadata_t *fm)
 FLAC__bool flac__foreign_metadata_read_from_aiff(foreign_metadata_t *fm, const char *filename, const char **error)
 {
        FLAC__bool ok;
-       FILE *f = fopen(filename, "rb");
+       FILE *f = flac_fopen(filename, "rb");
        if(!f) {
                if(error) *error = "can't open AIFF file for reading (000)";
                return false;
@@ -715,7 +715,7 @@ FLAC__bool flac__foreign_metadata_read_from_aiff(foreign_metadata_t *fm, const c
 FLAC__bool flac__foreign_metadata_read_from_wave(foreign_metadata_t *fm, const char *filename, const char **error)
 {
        FLAC__bool ok;
-       FILE *f = fopen(filename, "rb");
+       FILE *f = flac_fopen(filename, "rb");
        if(!f) {
                if(error) *error = "can't open WAVE file for reading (000)";
                return false;
@@ -728,7 +728,7 @@ FLAC__bool flac__foreign_metadata_read_from_wave(foreign_metadata_t *fm, const c
 FLAC__bool flac__foreign_metadata_read_from_wave64(foreign_metadata_t *fm, const char *filename, const char **error)
 {
        FLAC__bool ok;
-       FILE *f = fopen(filename, "rb");
+       FILE *f = flac_fopen(filename, "rb");
        if(!f) {
                if(error) *error = "can't open Wave64 file for reading (000)";
                return false;
@@ -752,12 +752,12 @@ FLAC__bool flac__foreign_metadata_write_to_flac(foreign_metadata_t *fm, const ch
                FLAC__metadata_simple_iterator_delete(it);
                return false;
        }
-       if(0 == (fin = fopen(infilename, "rb"))) {
+       if(0 == (fin = flac_fopen(infilename, "rb"))) {
                if(error) *error = "can't open WAVE/AIFF file for reading (002)";
                FLAC__metadata_simple_iterator_delete(it);
                return false;
        }
-       if(0 == (fout = fopen(outfilename, "r+b"))) {
+       if(0 == (fout = flac_fopen(outfilename, "r+b"))) {
                if(error) *error = "can't open FLAC file for updating (003)";
                FLAC__metadata_simple_iterator_delete(it);
                fclose(fin);
@@ -784,7 +784,7 @@ FLAC__bool flac__foreign_metadata_read_from_flac(foreign_metadata_t *fm, const c
                FLAC__metadata_simple_iterator_delete(it);
                return false;
        }
-       if(0 == (f = fopen(filename, "rb"))) {
+       if(0 == (f = flac_fopen(filename, "rb"))) {
                if(error) *error = "can't open FLAC file for reading (002)";
                FLAC__metadata_simple_iterator_delete(it);
                return false;
@@ -799,11 +799,11 @@ FLAC__bool flac__foreign_metadata_write_to_iff(foreign_metadata_t *fm, const cha
 {
        FLAC__bool ok;
        FILE *fin, *fout;
-       if(0 == (fin = fopen(infilename, "rb"))) {
+       if(0 == (fin = flac_fopen(infilename, "rb"))) {
                if(error) *error = "can't open FLAC file for reading (000)";
                return false;
        }
-       if(0 == (fout = fopen(outfilename, "r+b"))) {
+       if(0 == (fout = flac_fopen(outfilename, "r+b"))) {
                if(error) *error = "can't open WAVE/AIFF file for updating (001)";
                fclose(fin);
                return false;
index b268cc8..cf0fb93 100644 (file)
@@ -58,43 +58,50 @@ int main(int argc, char *argv[])
        size_t i;
        FLAC__uint32 size;
 
+#ifdef FLAC__STRINGS_IN_UTF8
+       if (get_utf8_argv(&argc, &argv) != 0) {
+               fprintf(stderr, "%ERROR: failed to convert command line parameters to UTF-8\n");
+               return 1;
+       }
+#endif
+
        if(argc != 2) {
-               fprintf(stderr, "usage: %s { file.wav | file.aif }\n", argv[0]);
+               flac_fprintf(stderr, "usage: %s { file.wav | file.aif }\n", argv[0]);
                return 1;
        }
        fn = argv[1];
-       if(0 == (f = fopen(fn, "rb")) || fread(buf, 1, 4, f) != 4) {
-               fprintf(stderr, "ERROR opening %s for reading\n", fn);
+       if(0 == (f = flac_fopen(fn, "rb")) || fread(buf, 1, 4, f) != 4) {
+               flac_fprintf(stderr, "ERROR opening %s for reading\n", fn);
                return 1;
        }
        fclose(f);
        if(0 == (fm = flac__foreign_metadata_new(memcmp(buf, "RIFF", 4) && memcmp(buf, "RF64", 4)? FOREIGN_BLOCK_TYPE__AIFF : FOREIGN_BLOCK_TYPE__RIFF))) {
-               fprintf(stderr, "ERROR: out of memory\n");
+               flac_fprintf(stderr, "ERROR: out of memory\n");
                return 1;
        }
        if(fm->type == FOREIGN_BLOCK_TYPE__AIFF) {
                if(!flac__foreign_metadata_read_from_aiff(fm, fn, &error)) {
-                       fprintf(stderr, "ERROR reading chunks from %s: %s\n", fn, error);
+                       flac_fprintf(stderr, "ERROR reading chunks from %s: %s\n", fn, error);
                        return 1;
                }
        }
        else {
                if(!flac__foreign_metadata_read_from_wave(fm, fn, &error)) {
-                       fprintf(stderr, "ERROR reading chunks from %s: %s\n", fn, error);
+                       flac_fprintf(stderr, "ERROR reading chunks from %s: %s\n", fn, error);
                        return 1;
                }
        }
-       if(0 == (f = fopen(fn, "rb"))) {
-               fprintf(stderr, "ERROR opening %s for reading\n", fn);
+       if(0 == (f = flac_fopen(fn, "rb"))) {
+               flac_fprintf(stderr, "ERROR opening %s for reading\n", fn);
                return 1;
        }
        for(i = 0; i < fm->num_blocks; i++) {
                if(fseeko(f, fm->blocks[i].offset, SEEK_SET) < 0) {
-                       fprintf(stderr, "ERROR seeking in %s\n", fn);
+                       flac_fprintf(stderr, "ERROR seeking in %s\n", fn);
                        return 1;
                }
                if(fread(buf, 1, i==0?12:8, f) != (i==0?12:8)) {
-                       fprintf(stderr, "ERROR reading %s\n", fn);
+                       flac_fprintf(stderr, "ERROR reading %s\n", fn);
                        return 1;
                }
                size = unpack32_((const FLAC__byte*)buf+4, fm->type);
@@ -105,7 +112,7 @@ int main(int argc, char *argv[])
                        printf(" offset size=%08x=(%10u)", fm->ssnd_offset_size, fm->ssnd_offset_size);
                else if(fm->type == FOREIGN_BLOCK_TYPE__RIFF && i == 1 && !memcmp(buf, "ds64", 4)) {
                        if(fread(buf+8, 1, 36-8, f) != 36-8) {
-                               fprintf(stderr, "ERROR reading %s\n", fn);
+                               flac_fprintf(stderr, "ERROR reading %s\n", fn);
                                return 1;
                        }
                        printf(" RIFF size=%016" PRIx64 "=(" PRIu64 ")", unpack64le_(buf+8), unpack64le_(buf+8));
index 3153029..d9a241f 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\objs\release\bin"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".;..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="..\..\objs\release\lib\libogg_static.lib"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index b6d4893..7bbe460 100644 (file)
@@ -304,6 +304,12 @@ int main(int argc, char *argv[])
        _response(&argc, &argv);
        _wildcard(&argc, &argv);
 #endif
+#ifdef FLAC__STRINGS_IN_UTF8
+       if (get_utf8_argv(&argc, &argv) != 0) {
+               fprintf(stderr, "ERROR: failed to convert command line parameters to UTF-8\n");
+               return 1;
+       }
+#endif
 
        srand((unsigned)time(0));
        setlocale(LC_ALL, "");
@@ -1684,7 +1690,7 @@ int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_
        }
        else {
                infilesize = grabbag__file_get_filesize(infilename);
-               if(0 == (encode_infile = fopen(infilename, "rb"))) {
+               if(0 == (encode_infile = flac_fopen(infilename, "rb"))) {
                        flac__utils_printf(stderr, 1, "ERROR: can't open input file %s: %s\n", infilename, strerror(errno));
                        return 1;
                }
@@ -1973,14 +1979,14 @@ int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_
 
        /* rename temporary file if necessary */
        if(retval == 0 && internal_outfilename != 0) {
-               if(rename(internal_outfilename, outfilename) < 0) {
+               if(flac_rename(internal_outfilename, outfilename) < 0) {
 #if defined _MSC_VER || defined __MINGW32__ || defined __EMX__
-                       /* on some flavors of windows, rename() will fail if the destination already exists, so we unlink and try again */
-                       if(unlink(outfilename) < 0) {
+                       /* on some flavors of windows, flac_rename() will fail if the destination already exists, so we unlink and try again */
+                       if(flac_unlink(outfilename) < 0) {
                                flac__utils_printf(stderr, 1, "ERROR: moving new FLAC file %s back on top of original FLAC file %s, keeping both\n", internal_outfilename, outfilename);
                                retval = 1;
                        }
-                       else if(rename(internal_outfilename, outfilename) < 0) {
+                       else if(flac_rename(internal_outfilename, outfilename) < 0) {
                                flac__utils_printf(stderr, 1, "ERROR: moving new FLAC file %s back on top of original FLAC file %s, you must do it\n", internal_outfilename, outfilename);
                                retval = 1;
                        }
@@ -1993,7 +1999,7 @@ int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_
 
        /* handle --delete-input-file, but don't want to delete if piping from stdin, or if input filename and output filename are the same */
        if(retval == 0 && option_values.delete_input && strcmp(infilename, "-") && internal_outfilename == 0)
-               unlink(infilename);
+               flac_unlink(infilename);
 
        if(internal_outfilename != 0)
                free(internal_outfilename);
@@ -2135,7 +2141,7 @@ int decode_file(const char *infilename)
                if(option_values.preserve_modtime && strcmp(outfilename, "-"))
                        grabbag__file_copy_metadata(infilename, outfilename);
                if(option_values.delete_input && !option_values.test_only && !option_values.analyze)
-                       unlink(infilename);
+                       flac_unlink(infilename);
        }
 
        return retval;
index 4b36141..1df651f 100644 (file)
@@ -147,7 +147,7 @@ void flac__utils_printf(FILE *stream, int level, const char *format, ...)
 
                va_start(args, format);
 
-               (void) vfprintf(stream, format, args);
+               (void) flac_vfprintf(stream, format, args);
 
                va_end(args);
 
index 789b183..db6d9ad 100644 (file)
@@ -126,7 +126,7 @@ static FLAC__bool set_vc_field(FLAC__StreamMetadata *block, const Argument_VcFie
                if(0 == (data = malloc(size+1)))
                        die("out of memory allocating tag value");
                data[size] = '\0';
-               if(0 == (f = fopen(field->field_value, "rb")) || fread(data, 1, size, f) != (size_t)size) {
+               if(0 == (f = flac_fopen(field->field_value, "rb")) || fread(data, 1, size, f) != (size_t)size) {
                        free(data);
                        if(f)
                                fclose(f);
@@ -170,6 +170,9 @@ static FLAC__bool set_vc_field(FLAC__StreamMetadata *block, const Argument_VcFie
        }
        else {
                FLAC__bool needs_free = false;
+#ifdef FLAC__STRINGS_IN_UTF8 /* everything in UTF-8 already. Must not alter */
+               entry.entry = (FLAC__byte *)field->field;
+#else
                if(raw) {
                        entry.entry = (FLAC__byte *)field->field;
                }
@@ -181,6 +184,7 @@ static FLAC__bool set_vc_field(FLAC__StreamMetadata *block, const Argument_VcFie
                        *violation = "error converting comment to UTF-8";
                        return false;
                }
+#endif
                entry.length = strlen((const char *)entry.entry);
                if(!FLAC__format_vorbiscomment_entry_is_legal(entry.entry, entry.length)) {
                        if(needs_free)
index 2b7575c..a019a3a 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release_dynamic"\r
+                       ConfigurationType="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FLACPP_API_EXPORTS;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index e2c26ce..fa91d66 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release_static"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\objs\release\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 414cfda..76383e2 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release_dynamic"\r
+                       ConfigurationType="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FLAC_API_EXPORTS;FLAC__HAS_OGG;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\&quot;1.3.0pre2\&quot;;FLaC__INLINE=_inline;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="..\..\objs\release\lib\libogg_static.lib"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
                                        Outputs="ia32/bitreader_asm.obj"\r
                                />\r
                        </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release (UTF8)|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="nasm.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/bitreader_asm.nasm -o ia32/bitreader_asm.obj&#x0D;&#x0A;"\r
+                                       AdditionalDependencies="ia32/bitreader_asm.nasm;ia32/nasm.h"\r
+                                       Outputs="ia32/bitreader_asm.obj"\r
+                               />\r
+                       </FileConfiguration>\r
                </File>\r
                <File\r
                        RelativePath=".\release_static\BuildLog.htm"\r
                                        Outputs="ia32/cpu_asm.obj"\r
                                />\r
                        </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release (UTF8)|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="nasm.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/cpu_asm.nasm -o ia32/cpu_asm.obj&#x0D;&#x0A;"\r
+                                       AdditionalDependencies="ia32/cpu_asm.nasm;ia32/nasm.h"\r
+                                       Outputs="ia32/cpu_asm.obj"\r
+                               />\r
+                       </FileConfiguration>\r
                </File>\r
                <File\r
                        RelativePath=".\ia32\fixed_asm.nasm"\r
                                        Outputs="ia32/fixed_asm.obj"\r
                                />\r
                        </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release (UTF8)|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="nasm.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/fixed_asm.nasm -o ia32/fixed_asm.obj&#x0D;&#x0A;"\r
+                                       AdditionalDependencies="ia32/fixed_asm.nasm;ia32/nasm.h"\r
+                                       Outputs="ia32/fixed_asm.obj"\r
+                               />\r
+                       </FileConfiguration>\r
                </File>\r
                <File\r
                        RelativePath=".\ia32\lpc_asm.nasm"\r
                                        Outputs="ia32/lpc_asm.obj"\r
                                />\r
                        </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release (UTF8)|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="nasm.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/lpc_asm.nasm -o ia32/lpc_asm.obj&#x0D;&#x0A;"\r
+                                       AdditionalDependencies="ia32/lpc_asm.nasm;ia32/nasm.h"\r
+                                       Outputs="ia32/lpc_asm.obj"\r
+                               />\r
+                       </FileConfiguration>\r
                </File>\r
                <File\r
                        RelativePath=".\ia32\stream_encoder_asm.nasm"\r
                                        Outputs="ia32/stream_encoder_asm.obj"\r
                                />\r
                        </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release (UTF8)|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="nasm.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/stream_encoder_asm.nasm -o ia32/stream_encoder_asm.obj&#x0D;&#x0A;"\r
+                                       AdditionalDependencies="ia32/stream_encoder_asm.nasm;ia32/nasm.h"\r
+                                       Outputs="ia32/stream_encoder_asm.obj"\r
+                               />\r
+                       </FileConfiguration>\r
                </File>\r
        </Files>\r
        <Globals>\r
index 3f9a8de..963cf78 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release_static"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__HAS_OGG;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\&quot;1.3.0pre2\&quot;;FLAC__NO_DLL;FLaC__INLINE=_inline;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\objs\release\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
                                        Outputs="ia32/bitreader_asm.obj"\r
                                />\r
                        </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release (UTF8)|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="nasm.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/bitreader_asm.nasm -o ia32/bitreader_asm.obj&#x0D;&#x0A;"\r
+                                       AdditionalDependencies="ia32/bitreader_asm.nasm;ia32/nasm.h"\r
+                                       Outputs="ia32/bitreader_asm.obj"\r
+                               />\r
+                       </FileConfiguration>\r
                </File>\r
                <File\r
                        RelativePath=".\ia32\cpu_asm.nasm"\r
                                        Outputs="ia32/cpu_asm.obj"\r
                                />\r
                        </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release (UTF8)|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="nasm.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/cpu_asm.nasm -o ia32/cpu_asm.obj&#x0D;&#x0A;"\r
+                                       AdditionalDependencies="ia32/cpu_asm.nasm;ia32/nasm.h"\r
+                                       Outputs="ia32/cpu_asm.obj"\r
+                               />\r
+                       </FileConfiguration>\r
                </File>\r
                <File\r
                        RelativePath=".\ia32\fixed_asm.nasm"\r
                                        Outputs="ia32/fixed_asm.obj"\r
                                />\r
                        </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release (UTF8)|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="nasm.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/fixed_asm.nasm -o ia32/fixed_asm.obj&#x0D;&#x0A;"\r
+                                       AdditionalDependencies="ia32/fixed_asm.nasm;ia32/nasm.h"\r
+                                       Outputs="ia32/fixed_asm.obj"\r
+                               />\r
+                       </FileConfiguration>\r
                </File>\r
                <File\r
                        RelativePath=".\ia32\lpc_asm.nasm"\r
                                        Outputs="ia32/lpc_asm.obj"\r
                                />\r
                        </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release (UTF8)|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="nasm.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/lpc_asm.nasm -o ia32/lpc_asm.obj&#x0D;&#x0A;"\r
+                                       AdditionalDependencies="ia32/lpc_asm.nasm;ia32/nasm.h"\r
+                                       Outputs="ia32/lpc_asm.obj"\r
+                               />\r
+                       </FileConfiguration>\r
                </File>\r
                <File\r
                        RelativePath=".\ia32\stream_encoder_asm.nasm"\r
                                        Outputs="ia32/stream_encoder_asm.obj"\r
                                />\r
                        </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release (UTF8)|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="nasm.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/stream_encoder_asm.nasm -o ia32/stream_encoder_asm.obj&#x0D;&#x0A;"\r
+                                       AdditionalDependencies="ia32/stream_encoder_asm.nasm;ia32/nasm.h"\r
+                                       Outputs="ia32/stream_encoder_asm.obj"\r
+                               />\r
+                       </FileConfiguration>\r
                </File>\r
        </Files>\r
        <Globals>\r
index 7349ff8..5e1bf88 100644 (file)
@@ -118,8 +118,8 @@ static FLAC__bool open_tempfile_(const char *filename, const char *tempfile_path
 static FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilename, FLAC__Metadata_SimpleIteratorStatus *status);
 static void cleanup_tempfile_(FILE **tempfile, char **tempfilename);
 
-static FLAC__bool get_file_stats_(const char *filename, struct stat *stats);
-static void set_file_stats_(const char *filename, struct stat *stats);
+static FLAC__bool get_file_stats_(const char *filename, struct _flac_stat *stats);
+static void set_file_stats_(const char *filename, struct _flac_stat *stats);
 
 static int fseek_wrapper_(FLAC__IOHandle handle, FLAC__int64 offset, int whence);
 static FLAC__int64 ftell_wrapper_(FLAC__IOHandle handle);
@@ -327,7 +327,7 @@ FLAC_API FLAC__bool FLAC__metadata_get_picture(const char *filename, FLAC__Strea
 struct FLAC__Metadata_SimpleIterator {
        FILE *file;
        char *filename, *tempfile_path_prefix;
-       struct stat stats;
+       struct _flac_stat stats;
        FLAC__bool has_stats;
        FLAC__bool is_writable;
        FLAC__Metadata_SimpleIteratorStatus status;
@@ -420,10 +420,10 @@ static FLAC__bool simple_iterator_prime_input_(FLAC__Metadata_SimpleIterator *it
 
        FLAC__ASSERT(0 != iterator);
 
-       if(read_only || 0 == (iterator->file = fopen(iterator->filename, "r+b"))) {
+       if(read_only || 0 == (iterator->file = flac_fopen(iterator->filename, "r+b"))) {
                iterator->is_writable = false;
                if(read_only || errno == EACCES) {
-                       if(0 == (iterator->file = fopen(iterator->filename, "rb"))) {
+                       if(0 == (iterator->file = flac_fopen(iterator->filename, "rb"))) {
                                iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE;
                                return false;
                        }
@@ -478,7 +478,7 @@ FLAC__bool FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *it
 
 FLAC_API FLAC__bool FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *iterator, const char *filename, FLAC__bool read_only, FLAC__bool preserve_file_stats)
 {
-       const char *tempfile_path_prefix = 0; /*@@@ search for comments near 'rename(...)' for what it will take to finish implementing this */
+       const char *tempfile_path_prefix = 0; /*@@@ search for comments near 'flac_rename(...)' for what it will take to finish implementing this */
 
        FLAC__ASSERT(0 != iterator);
        FLAC__ASSERT(0 != filename);
@@ -1363,7 +1363,7 @@ static FLAC__bool chain_rewrite_metadata_in_place_(FLAC__Metadata_Chain *chain)
 
        FLAC__ASSERT(0 != chain->filename);
 
-       if(0 == (file = fopen(chain->filename, "r+b"))) {
+       if(0 == (file = flac_fopen(chain->filename, "r+b"))) {
                chain->status = FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE;
                return false;
        }
@@ -1388,7 +1388,7 @@ static FLAC__bool chain_rewrite_file_(FLAC__Metadata_Chain *chain, const char *t
        FLAC__ASSERT(0 != chain->head);
 
        /* copy the file prefix (data up to first metadata block */
-       if(0 == (f = fopen(chain->filename, "rb"))) {
+       if(0 == (f = flac_fopen(chain->filename, "rb"))) {
                chain->status = FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE;
                return false;
        }
@@ -1526,7 +1526,7 @@ static FLAC__bool chain_read_(FLAC__Metadata_Chain *chain, const char *filename,
 
        chain->is_ogg = is_ogg;
 
-       if(0 == (file = fopen(filename, "rb"))) {
+       if(0 == (file = flac_fopen(filename, "rb"))) {
                chain->status = FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE;
                return false;
        }
@@ -1630,7 +1630,7 @@ FLAC_API FLAC__bool FLAC__metadata_chain_check_if_tempfile_needed(FLAC__Metadata
 
 FLAC_API FLAC__bool FLAC__metadata_chain_write(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats)
 {
-       struct stat stats;
+       struct _flac_stat stats;
        const char *tempfile_path_prefix = 0;
        FLAC__off_t current_length;
 
@@ -3243,7 +3243,7 @@ FLAC__bool open_tempfile_(const char *filename, const char *tempfile_path_prefix
                local_snprintf(*tempfilename, dest_len, "%s/%s%s", tempfile_path_prefix, p, tempfile_suffix);
        }
 
-       if(0 == (*tempfile = fopen(*tempfilename, "w+b"))) {
+       if(0 == (*tempfile = flac_fopen(*tempfilename, "w+b"))) {
                *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE;
                return false;
        }
@@ -3264,16 +3264,16 @@ FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tem
        *tempfile = 0;
 
 #if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ || defined __EMX__
-       /* on some flavors of windows, rename() will fail if the destination already exists */
-       if(unlink(filename) < 0) {
+       /* on some flavors of windows, flac_rename() will fail if the destination already exists */
+       if(flac_unlink(filename) < 0) {
                cleanup_tempfile_(tempfile, tempfilename);
                *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_UNLINK_ERROR;
                return false;
        }
 #endif
 
-       /*@@@ to fully support the tempfile_path_prefix we need to update this piece to actually copy across filesystems instead of just rename(): */
-       if(0 != rename(*tempfilename, filename)) {
+       /*@@@ to fully support the tempfile_path_prefix we need to update this piece to actually copy across filesystems instead of just flac_rename(): */
+       if(0 != flac_rename(*tempfilename, filename)) {
                cleanup_tempfile_(tempfile, tempfilename);
                *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_RENAME_ERROR;
                return false;
@@ -3292,20 +3292,20 @@ void cleanup_tempfile_(FILE **tempfile, char **tempfilename)
        }
 
        if(0 != *tempfilename) {
-               (void)unlink(*tempfilename);
+               (void)flac_unlink(*tempfilename);
                free(*tempfilename);
                *tempfilename = 0;
        }
 }
 
-FLAC__bool get_file_stats_(const char *filename, struct stat *stats)
+FLAC__bool get_file_stats_(const char *filename, struct _flac_stat *stats)
 {
        FLAC__ASSERT(0 != filename);
        FLAC__ASSERT(0 != stats);
-       return (0 == stat(filename, stats));
+       return (0 == flac_stat(filename, stats));
 }
 
-void set_file_stats_(const char *filename, struct stat *stats)
+void set_file_stats_(const char *filename, struct _flac_stat *stats)
 {
        struct utimbuf srctime;
 
@@ -3314,8 +3314,8 @@ void set_file_stats_(const char *filename, struct stat *stats)
 
        srctime.actime = stats->st_atime;
        srctime.modtime = stats->st_mtime;
-       (void)chmod(filename, stats->st_mode);
-       (void)utime(filename, &srctime);
+       (void)flac_chmod(filename, stats->st_mode);
+       (void)flac_utime(filename, &srctime);
 #if !defined _MSC_VER && !defined __BORLANDC__ && !defined __MINGW32__
        FLAC_CHECK_RETURN(chown(filename, stats->st_uid, -1));
        FLAC_CHECK_RETURN(chown(filename, -1, stats->st_gid));
index 320baa8..753fd23 100644 (file)
@@ -604,7 +604,7 @@ static FLAC__StreamDecoderInitStatus init_file_internal_(
        if(0 == write_callback || 0 == error_callback)
                return decoder->protected_->state = FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS;
 
-       file = filename? fopen(filename, "rb") : stdin;
+       file = filename? flac_fopen(filename, "rb") : stdin;
 
        if(0 == file)
                return FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE;
@@ -3342,20 +3342,12 @@ FLAC__StreamDecoderTellStatus file_tell_callback_(const FLAC__StreamDecoder *dec
 
 FLAC__StreamDecoderLengthStatus file_length_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data)
 {
-#if defined _MSC_VER || defined __MINGW32__
-       struct _stat64 filestats;
-#else
-       struct stat filestats;
-#endif
+       struct _flac_stat filestats;
        (void)client_data;
 
        if(decoder->private_->file == stdin)
                return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED;
-#if defined _MSC_VER || defined __MINGW32__
-       else if(_fstat64(fileno(decoder->private_->file), &filestats) != 0)
-#else
-       else if(fstat(fileno(decoder->private_->file), &filestats) != 0)
-#endif
+       else if(flac_fstat(fileno(decoder->private_->file), &filestats) != 0)
                return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
        else {
                *stream_length = (FLAC__uint64)filestats.st_size;
index f51ba74..6c180fe 100644 (file)
@@ -1250,7 +1250,7 @@ static FLAC__StreamEncoderInitStatus init_file_internal_(
        if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED)
                return FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED;
 
-       file = filename? fopen(filename, "w+b") : stdout;
+       file = filename? flac_fopen(filename, "w+b") : stdout;
 
        if(file == 0) {
                encoder->protected_->state = FLAC__STREAM_ENCODER_IO_ERROR;
index 10baffd..e85d1c2 100644 (file)
@@ -24,6 +24,7 @@
 #include "options.h"
 #include <locale.h>
 #include <stdlib.h>
+#include "share/compat.h"
 
 int main(int argc, char *argv[])
 {
@@ -34,6 +35,12 @@ int main(int argc, char *argv[])
        _response(&argc, &argv);
        _wildcard(&argc, &argv);
 #endif
+#ifdef FLAC__STRINGS_IN_UTF8
+       if (get_utf8_argv(&argc, &argv) != 0) {
+               fprintf(stderr, "%ERROR: failed to convert command line parameters to UTF-8\n");
+               return 1;
+       }
+#endif
 
        setlocale(LC_ALL, "");
        init_options(&options);
index d6637fe..b31e204 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\objs\release\bin"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".;..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="..\..\objs\release\lib\libogg_static.lib"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 84d4941..cd31a3d 100644 (file)
@@ -187,7 +187,7 @@ FLAC__bool do_major_operation__list(const char *filename, FLAC__Metadata_Chain *
                block = FLAC__metadata_iterator_get_block(iterator);
                ok &= (0 != block);
                if(!ok)
-                       fprintf(stderr, "%s: ERROR: couldn't get block from chain\n", filename);
+                       flac_fprintf(stderr, "%s: ERROR: couldn't get block from chain\n", filename);
                else if(passes_filter(options, FLAC__metadata_iterator_get_block(iterator), block_number))
                        write_metadata(filename, block, block_number, !options->utf8_convert, options->application_data_format_is_hexdump);
                block_number++;
@@ -201,7 +201,7 @@ FLAC__bool do_major_operation__list(const char *filename, FLAC__Metadata_Chain *
 FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const CommandLineOptions *options)
 {
        (void) chain, (void) options;
-       fprintf(stderr, "ERROR: --append not implemented yet\n");
+       flac_fprintf(stderr, "ERROR: --append not implemented yet\n");
        return false;
 }
 
@@ -406,7 +406,7 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu
        for(i = 0; i < num_files; i++) {
                FLAC__ASSERT(0 != filenames[i]);
                if(!FLAC__metadata_get_streaminfo(filenames[i], &streaminfo)) {
-                       fprintf(stderr, "%s: ERROR: can't open file or get STREAMINFO block\n", filenames[i]);
+                       flac_fprintf(stderr, "%s: ERROR: can't open file or get STREAMINFO block\n", filenames[i]);
                        return false;
                }
                if(first) {
@@ -417,24 +417,24 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu
                }
                else {
                        if(sample_rate != streaminfo.data.stream_info.sample_rate) {
-                               fprintf(stderr, "%s: ERROR: sample rate of %u Hz does not match previous files' %u Hz\n", filenames[i], streaminfo.data.stream_info.sample_rate, sample_rate);
+                               flac_fprintf(stderr, "%s: ERROR: sample rate of %u Hz does not match previous files' %u Hz\n", filenames[i], streaminfo.data.stream_info.sample_rate, sample_rate);
                                return false;
                        }
                        if(bits_per_sample != streaminfo.data.stream_info.bits_per_sample) {
-                               fprintf(stderr, "%s: ERROR: resolution of %u bps does not match previous files' %u bps\n", filenames[i], streaminfo.data.stream_info.bits_per_sample, bits_per_sample);
+                               flac_fprintf(stderr, "%s: ERROR: resolution of %u bps does not match previous files' %u bps\n", filenames[i], streaminfo.data.stream_info.bits_per_sample, bits_per_sample);
                                return false;
                        }
                        if(channels != streaminfo.data.stream_info.channels) {
-                               fprintf(stderr, "%s: ERROR: # channels (%u) does not match previous files' (%u)\n", filenames[i], streaminfo.data.stream_info.channels, channels);
+                               flac_fprintf(stderr, "%s: ERROR: # channels (%u) does not match previous files' (%u)\n", filenames[i], streaminfo.data.stream_info.channels, channels);
                                return false;
                        }
                }
                if(!grabbag__replaygain_is_valid_sample_frequency(sample_rate)) {
-                       fprintf(stderr, "%s: ERROR: sample rate of %u Hz is not supported\n", filenames[i], sample_rate);
+                       flac_fprintf(stderr, "%s: ERROR: sample rate of %u Hz is not supported\n", filenames[i], sample_rate);
                        return false;
                }
                if(channels != 1 && channels != 2) {
-                       fprintf(stderr, "%s: ERROR: # of channels (%u) is not supported, must be 1 or 2\n", filenames[i], channels);
+                       flac_fprintf(stderr, "%s: ERROR: # of channels (%u) is not supported, must be 1 or 2\n", filenames[i], channels);
                        return false;
                }
        }
@@ -443,7 +443,7 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu
        if(!grabbag__replaygain_init(sample_rate)) {
                FLAC__ASSERT(0);
                /* double protection */
-               fprintf(stderr, "internal error\n");
+               flac_fprintf(stderr, "internal error\n");
                return false;
        }
 
@@ -455,7 +455,7 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu
 
        for(i = 0; i < num_files; i++) {
                if(0 != (error = grabbag__replaygain_analyze_file(filenames[i], title_gains+i, title_peaks+i))) {
-                       fprintf(stderr, "%s: ERROR: during analysis (%s)\n", filenames[i], error);
+                       flac_fprintf(stderr, "%s: ERROR: during analysis (%s)\n", filenames[i], error);
                        free(title_gains);
                        free(title_peaks);
                        return false;
@@ -465,7 +465,7 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu
 
        for(i = 0; i < num_files; i++) {
                if(0 != (error = grabbag__replaygain_store_to_file(filenames[i], album_gain, album_peak, title_gains[i], title_peaks[i], preserve_modtime))) {
-                       fprintf(stderr, "%s: ERROR: writing tags (%s)\n", filenames[i], error);
+                       flac_fprintf(stderr, "%s: ERROR: writing tags (%s)\n", filenames[i], error);
                        free(title_gains);
                        free(title_peaks);
                        return false;
@@ -551,7 +551,7 @@ void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned
        unsigned i, j;
 
 /*@@@ yuck, should do this with a varargs function or something: */
-#define PPR if(filename)printf("%s:",filename);
+#define PPR if(filename)flac_printf("%s:",filename);
        PPR; printf("METADATA block #%u\n", block_number);
        PPR; printf("  type: %u (%s)\n", (unsigned)block->type, block->type < FLAC__METADATA_TYPE_UNDEFINED? FLAC__MetadataTypeString[block->type] : "UNKNOWN");
        PPR; printf("  is last: %s\n", block->is_last? "true":"false");
index f59bc89..10f814b 100644 (file)
@@ -51,7 +51,7 @@ FLAC__bool do_shorthand_operation__cuesheet(const char *filename, FLAC__Metadata
                if(block->type == FLAC__METADATA_TYPE_STREAMINFO) {
                        lead_out_offset = block->data.stream_info.total_samples;
                        if(lead_out_offset == 0) {
-                               fprintf(stderr, "%s: ERROR: FLAC file must have total_samples set in STREAMINFO in order to import/export cuesheet\n", filename);
+                               flac_fprintf(stderr, "%s: ERROR: FLAC file must have total_samples set in STREAMINFO in order to import/export cuesheet\n", filename);
                                FLAC__metadata_iterator_delete(iterator);
                                return false;
                        }
@@ -63,7 +63,7 @@ FLAC__bool do_shorthand_operation__cuesheet(const char *filename, FLAC__Metadata
        } while(FLAC__metadata_iterator_next(iterator));
 
        if(lead_out_offset == 0) {
-               fprintf(stderr, "%s: ERROR: FLAC stream has no STREAMINFO block\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: FLAC stream has no STREAMINFO block\n", filename);
                FLAC__metadata_iterator_delete(iterator);
                return false;
        }
@@ -71,7 +71,7 @@ FLAC__bool do_shorthand_operation__cuesheet(const char *filename, FLAC__Metadata
        switch(operation->type) {
                case OP__IMPORT_CUESHEET_FROM:
                        if(0 != cuesheet) {
-                               fprintf(stderr, "%s: ERROR: FLAC file already has CUESHEET block\n", filename);
+                               flac_fprintf(stderr, "%s: ERROR: FLAC file already has CUESHEET block\n", filename);
                                ok = false;
                        }
                        else {
@@ -90,7 +90,7 @@ FLAC__bool do_shorthand_operation__cuesheet(const char *filename, FLAC__Metadata
                        break;
                case OP__EXPORT_CUESHEET_TO:
                        if(0 == cuesheet) {
-                               fprintf(stderr, "%s: ERROR: FLAC file has no CUESHEET block\n", filename);
+                               flac_fprintf(stderr, "%s: ERROR: FLAC file has no CUESHEET block\n", filename);
                                ok = false;
                        }
                        else
@@ -118,16 +118,16 @@ FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet,
        unsigned last_line_read;
 
        if(0 == cs_filename || strlen(cs_filename) == 0) {
-               fprintf(stderr, "%s: ERROR: empty import file name\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: empty import file name\n", filename);
                return false;
        }
        if(0 == strcmp(cs_filename, "-"))
                f = stdin;
        else
-               f = fopen(cs_filename, "r");
+               f = flac_fopen(cs_filename, "r");
 
        if(0 == f) {
-               fprintf(stderr, "%s: ERROR: can't open import file %s: %s\n", filename, cs_filename, strerror(errno));
+               flac_fprintf(stderr, "%s: ERROR: can't open import file %s: %s\n", filename, cs_filename, strerror(errno));
                return false;
        }
 
@@ -137,18 +137,18 @@ FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet,
                fclose(f);
 
        if(0 == *cuesheet) {
-               fprintf(stderr, "%s: ERROR: while parsing cuesheet \"%s\" on line %u: %s\n", filename, cs_filename, last_line_read, error_message);
+               flac_fprintf(stderr, "%s: ERROR: while parsing cuesheet \"%s\" on line %u: %s\n", filename, cs_filename, last_line_read, error_message);
                return false;
        }
 
        if(!FLAC__format_cuesheet_is_legal(&(*cuesheet)->data.cue_sheet, /*check_cd_da_subset=*/false, &error_message)) {
-               fprintf(stderr, "%s: ERROR parsing cuesheet \"%s\": %s\n", filename, cs_filename, error_message);
+               flac_fprintf(stderr, "%s: ERROR parsing cuesheet \"%s\": %s\n", filename, cs_filename, error_message);
                return false;
        }
 
        /* if we're expecting CDDA, warn about non-compliance */
        if(is_cdda && !FLAC__format_cuesheet_is_legal(&(*cuesheet)->data.cue_sheet, /*check_cd_da_subset=*/true, &error_message)) {
-               fprintf(stderr, "%s: WARNING cuesheet \"%s\" is not audio CD compliant: %s\n", filename, cs_filename, error_message);
+               flac_fprintf(stderr, "%s: WARNING cuesheet \"%s\" is not audio CD compliant: %s\n", filename, cs_filename, error_message);
                (*cuesheet)->data.cue_sheet.is_cd = false;
        }
 
@@ -179,22 +179,22 @@ FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cueshe
        size_t reflen;
 
        if(0 == cs_filename || strlen(cs_filename) == 0) {
-               fprintf(stderr, "%s: ERROR: empty export file name\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: empty export file name\n", filename);
                return false;
        }
        if(0 == strcmp(cs_filename, "-"))
                f = stdout;
        else
-               f = fopen(cs_filename, "w");
+               f = flac_fopen(cs_filename, "w");
 
        if(0 == f) {
-               fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, cs_filename, strerror(errno));
+               flac_fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, cs_filename, strerror(errno));
                return false;
        }
 
        reflen = strlen(filename) + 7 + 1;
        if(0 == (ref = malloc(reflen))) {
-               fprintf(stderr, "%s: ERROR: allocating memory\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: allocating memory\n", filename);
                if(f != stdout)
                        fclose(f);
                return false;
index b0f5ce2..8cfd4cb 100644 (file)
@@ -94,9 +94,9 @@ FLAC__bool do_shorthand_operation__picture(const char *filename, FLAC__Metadata_
                                } while(FLAC__metadata_iterator_next(iterator) && 0 == picture);
                                if(0 == picture) {
                                        if(block_number < 0)
-                                               fprintf(stderr, "%s: ERROR: FLAC file has no PICTURE block\n", filename);
+                                               flac_fprintf(stderr, "%s: ERROR: FLAC file has no PICTURE block\n", filename);
                                        else
-                                               fprintf(stderr, "%s: ERROR: FLAC file has no PICTURE block at block #%d\n", filename, block_number);
+                                               flac_fprintf(stderr, "%s: ERROR: FLAC file has no PICTURE block at block #%d\n", filename, block_number);
                                        ok = false;
                                }
                                else
@@ -122,19 +122,19 @@ FLAC__bool import_pic_from(const char *filename, FLAC__StreamMetadata **picture,
        const char *error_message;
 
        if(0 == specification || strlen(specification) == 0) {
-               fprintf(stderr, "%s: ERROR: empty picture specification\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: empty picture specification\n", filename);
                return false;
        }
 
        *picture = grabbag__picture_parse_specification(specification, &error_message);
 
        if(0 == *picture) {
-               fprintf(stderr, "%s: ERROR: while parsing picture specification \"%s\": %s\n", filename, specification, error_message);
+               flac_fprintf(stderr, "%s: ERROR: while parsing picture specification \"%s\": %s\n", filename, specification, error_message);
                return false;
        }
 
        if(!FLAC__format_picture_is_legal(&(*picture)->data.picture, &error_message)) {
-               fprintf(stderr, "%s: ERROR: new PICTURE block for \"%s\" is illegal: %s\n", filename, specification, error_message);
+               flac_fprintf(stderr, "%s: ERROR: new PICTURE block for \"%s\" is illegal: %s\n", filename, specification, error_message);
                return false;
        }
 
@@ -148,21 +148,21 @@ FLAC__bool export_pic_to(const char *filename, const FLAC__StreamMetadata *pictu
        const FLAC__uint32 len = picture->data.picture.data_length;
 
        if(0 == pic_filename || strlen(pic_filename) == 0) {
-               fprintf(stderr, "%s: ERROR: empty export file name\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: empty export file name\n", filename);
                return false;
        }
        if(0 == strcmp(pic_filename, "-"))
                f = grabbag__file_get_binary_stdout();
        else
-               f = fopen(pic_filename, "wb");
+               f = flac_fopen(pic_filename, "wb");
 
        if(0 == f) {
-               fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, pic_filename, strerror(errno));
+               flac_fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, pic_filename, strerror(errno));
                return false;
        }
 
        if(fwrite(picture->data.picture.data, 1, len, f) != len) {
-               fprintf(stderr, "%s: ERROR: writing PICTURE data to file\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: writing PICTURE data to file\n", filename);
                if(f != stdout)
                        fclose(f);
                return false;
index a06d676..dbc8c53 100644 (file)
@@ -53,7 +53,7 @@ FLAC__bool do_shorthand_operation__add_seekpoints(const char *filename, FLAC__Me
        } while(!found_seektable_block && FLAC__metadata_iterator_next(iterator));
 
        if(total_samples == 0) {
-               fprintf(stderr, "%s: ERROR: cannot add seekpoints because STREAMINFO block does not specify total_samples\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: cannot add seekpoints because STREAMINFO block does not specify total_samples\n", filename);
                return false;
        }
 
@@ -79,7 +79,7 @@ FLAC__bool do_shorthand_operation__add_seekpoints(const char *filename, FLAC__Me
        FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_SEEKTABLE);
 
        if(!grabbag__seektable_convert_specification_to_template(specification, /*only_explicit_placeholders=*/false, total_samples, sample_rate, block, /*spec_has_real_points=*/0)) {
-               fprintf(stderr, "%s: ERROR (internal) preparing seektable with seekpoints\n", filename);
+               flac_fprintf(stderr, "%s: ERROR (internal) preparing seektable with seekpoints\n", filename);
                return false;
        }
 
@@ -178,7 +178,7 @@ FLAC__bool populate_seekpoint_values(const char *filename, FLAC__StreamMetadata
        decoder = FLAC__stream_decoder_new();
 
        if(0 == decoder) {
-               fprintf(stderr, "%s: ERROR (--add-seekpoint) creating the decoder instance\n", filename);
+               flac_fprintf(stderr, "%s: ERROR (--add-seekpoint) creating the decoder instance\n", filename);
                return false;
        }
 
@@ -186,28 +186,28 @@ FLAC__bool populate_seekpoint_values(const char *filename, FLAC__StreamMetadata
        FLAC__stream_decoder_set_metadata_ignore_all(decoder);
 
        if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_, /*metadata_callback=*/0, error_callback_, &client_data) != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
-               fprintf(stderr, "%s: ERROR (--add-seekpoint) initializing the decoder instance (%s)\n", filename, FLAC__stream_decoder_get_resolved_state_string(decoder));
+               flac_fprintf(stderr, "%s: ERROR (--add-seekpoint) initializing the decoder instance (%s)\n", filename, FLAC__stream_decoder_get_resolved_state_string(decoder));
                ok = false;
        }
 
        if(ok && !FLAC__stream_decoder_process_until_end_of_metadata(decoder)) {
-               fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file (%s)\n", filename, FLAC__stream_decoder_get_resolved_state_string(decoder));
+               flac_fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file (%s)\n", filename, FLAC__stream_decoder_get_resolved_state_string(decoder));
                ok = false;
        }
 
        if(ok && !FLAC__stream_decoder_get_decode_position(decoder, &client_data.audio_offset)) {
-               fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file\n", filename);
+               flac_fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file\n", filename);
                ok = false;
        }
        client_data.last_offset = client_data.audio_offset;
 
        if(ok && !FLAC__stream_decoder_process_until_end_of_stream(decoder)) {
-               fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file (%s)\n", filename, FLAC__stream_decoder_get_resolved_state_string(decoder));
+               flac_fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file (%s)\n", filename, FLAC__stream_decoder_get_resolved_state_string(decoder));
                ok = false;
        }
 
        if(ok && client_data.error_occurred) {
-               fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file (%u:%s)\n", filename, (unsigned)client_data.error_status, FLAC__StreamDecoderErrorStatusString[client_data.error_status]);
+               flac_fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file (%u:%s)\n", filename, (unsigned)client_data.error_status, FLAC__StreamDecoderErrorStatusString[client_data.error_status]);
                ok = false;
        }
 
index a392a5a..e37a577 100644 (file)
@@ -46,7 +46,7 @@ FLAC__bool do_shorthand_operation__streaminfo(const char *filename, FLAC__bool p
        FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_STREAMINFO);
 
        if(prefix_with_filename)
-               printf("%s:", filename);
+               flac_printf("%s:", filename);
 
        switch(operation->type) {
                case OP__SHOW_MD5SUM:
index 610e972..61537bf 100644 (file)
@@ -127,7 +127,7 @@ FLAC__bool remove_vc_all(const char *filename, FLAC__StreamMetadata *block, FLAC
        if(0 != block->data.vorbis_comment.comments) {
                FLAC__ASSERT(block->data.vorbis_comment.num_comments > 0);
                if(!FLAC__metadata_object_vorbiscomment_resize_comments(block, 0)) {
-                       fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename);
+                       flac_fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename);
                        return false;
                }
                *needs_write = true;
@@ -148,7 +148,7 @@ FLAC__bool remove_vc_field(const char *filename, FLAC__StreamMetadata *block, co
        n = FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, field_name);
 
        if(n < 0) {
-               fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename);
                return false;
        }
        else if(n > 0)
@@ -166,7 +166,7 @@ FLAC__bool remove_vc_firstfield(const char *filename, FLAC__StreamMetadata *bloc
        n = FLAC__metadata_object_vorbiscomment_remove_entry_matching(block, field_name);
 
        if(n < 0) {
-               fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename);
                return false;
        }
        else if(n > 0)
@@ -191,18 +191,18 @@ FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const
                char *data = 0;
                const FLAC__off_t size = grabbag__file_get_filesize(field->field_value);
                if(size < 0) {
-                       fprintf(stderr, "%s: ERROR: can't open file '%s' for '%s' tag value\n", filename, field->field_value, field->field_name);
+                       flac_fprintf(stderr, "%s: ERROR: can't open file '%s' for '%s' tag value\n", filename, field->field_value, field->field_name);
                        return false;
                }
                if(size >= 0x100000) { /* magic arbitrary limit, actual format limit is near 16MB */
-                       fprintf(stderr, "%s: ERROR: file '%s' for '%s' tag value is too large\n", filename, field->field_value, field->field_name);
+                       flac_fprintf(stderr, "%s: ERROR: file '%s' for '%s' tag value is too large\n", filename, field->field_value, field->field_name);
                        return false;
                }
                if(0 == (data = malloc(size+1)))
                        die("out of memory allocating tag value");
                data[size] = '\0';
-               if(0 == (f = fopen(field->field_value, "rb")) || fread(data, 1, size, f) != (size_t)size) {
-                       fprintf(stderr, "%s: ERROR: while reading file '%s' for '%s' tag value: %s\n", filename, field->field_value, field->field_name, strerror(errno));
+               if(0 == (f = flac_fopen(field->field_value, "rb")) || fread(data, 1, size, f) != (size_t)size) {
+                       flac_fprintf(stderr, "%s: ERROR: while reading file '%s' for '%s' tag value: %s\n", filename, field->field_value, field->field_name, strerror(errno));
                        free(data);
                        if(f)
                                fclose(f);
@@ -211,7 +211,7 @@ FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const
                fclose(f);
                if(strlen(data) != (size_t)size) {
                        free(data);
-                       fprintf(stderr, "%s: ERROR: file '%s' for '%s' tag value has embedded NULs\n", filename, field->field_value, field->field_name);
+                       flac_fprintf(stderr, "%s: ERROR: file '%s' for '%s' tag value has embedded NULs\n", filename, field->field_value, field->field_name);
                        return false;
                }
 
@@ -224,19 +224,19 @@ FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const
                }
                else {
                        free(data);
-                       fprintf(stderr, "%s: ERROR: converting file '%s' contents to UTF-8 for tag value\n", filename, field->field_value);
+                       flac_fprintf(stderr, "%s: ERROR: converting file '%s' contents to UTF-8 for tag value\n", filename, field->field_value);
                        return false;
                }
 
                /* create and entry and append it */
                if(!FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, field->field_name, converted)) {
                        free(converted);
-                       fprintf(stderr, "%s: ERROR: file '%s' for '%s' tag value is not valid UTF-8\n", filename, field->field_value, field->field_name);
+                       flac_fprintf(stderr, "%s: ERROR: file '%s' for '%s' tag value is not valid UTF-8\n", filename, field->field_value, field->field_name);
                        return false;
                }
                free(converted);
                if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/false)) {
-                       fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename);
+                       flac_fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename);
                        return false;
                }
 
@@ -245,6 +245,9 @@ FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const
        }
        else {
                FLAC__bool needs_free = false;
+#ifdef FLAC__STRINGS_IN_UTF8 /* do not convert anything or things will break */
+               entry.entry = (FLAC__byte *)field->field;
+#else
                if(raw) {
                        entry.entry = (FLAC__byte *)field->field;
                }
@@ -253,9 +256,10 @@ FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const
                        needs_free = true;
                }
                else {
-                       fprintf(stderr, "%s: ERROR: converting comment '%s' to UTF-8\n", filename, field->field);
+                       flac_fprintf(stderr, "%s: ERROR: converting comment '%s' to UTF-8\n", filename, field->field);
                        return false;
                }
+#endif
                entry.length = strlen((const char *)entry.entry);
                if(!FLAC__format_vorbiscomment_entry_is_legal(entry.entry, entry.length)) {
                        if(needs_free)
@@ -264,14 +268,14 @@ FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const
                         * our previous parsing has already established that the field
                         * name is OK, so it must be the field value
                         */
-                       fprintf(stderr, "%s: ERROR: tag value for '%s' is not valid UTF-8\n", filename, field->field_name);
+                       flac_fprintf(stderr, "%s: ERROR: tag value for '%s' is not valid UTF-8\n", filename, field->field_name);
                        return false;
                }
 
                if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true)) {
                        if(needs_free)
                                free(converted);
-                       fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename);
+                       flac_fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename);
                        return false;
                }
 
@@ -289,16 +293,16 @@ FLAC__bool import_vc_from(const char *filename, FLAC__StreamMetadata *block, con
        FLAC__bool ret;
 
        if(0 == vc_filename->value || strlen(vc_filename->value) == 0) {
-               fprintf(stderr, "%s: ERROR: empty import file name\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: empty import file name\n", filename);
                return false;
        }
        if(0 == strcmp(vc_filename->value, "-"))
                f = stdin;
        else
-               f = fopen(vc_filename->value, "r");
+               f = flac_fopen(vc_filename->value, "r");
 
        if(0 == f) {
-               fprintf(stderr, "%s: ERROR: can't open import file %s: %s\n", filename, vc_filename->value, strerror(errno));
+               flac_fprintf(stderr, "%s: ERROR: can't open import file %s: %s\n", filename, vc_filename->value, strerror(errno));
                return false;
        }
 
@@ -307,7 +311,7 @@ FLAC__bool import_vc_from(const char *filename, FLAC__StreamMetadata *block, con
                if(!feof(f)) {
                        char *p = strchr(line, '\n');
                        if(0 == p) {
-                               fprintf(stderr, "%s: ERROR: line too long, aborting\n", vc_filename->value);
+                               flac_fprintf(stderr, "%s: ERROR: line too long, aborting\n", vc_filename->value);
                                ret = false;
                        }
                        else {
@@ -318,7 +322,7 @@ FLAC__bool import_vc_from(const char *filename, FLAC__StreamMetadata *block, con
                                field.field_value_from_file = false;
                                if(!parse_vorbis_comment_field(line, &field.field, &field.field_name, &field.field_value, &field.field_value_length, &violation)) {
                                        FLAC__ASSERT(0 != violation);
-                                       fprintf(stderr, "%s: ERROR: malformed vorbis comment field \"%s\",\n       %s\n", vc_filename->value, line, violation);
+                                       flac_fprintf(stderr, "%s: ERROR: malformed vorbis comment field \"%s\",\n       %s\n", vc_filename->value, line, violation);
                                        ret = false;
                                }
                                else {
@@ -345,16 +349,16 @@ FLAC__bool export_vc_to(const char *filename, FLAC__StreamMetadata *block, const
        FLAC__bool ret;
 
        if(0 == vc_filename->value || strlen(vc_filename->value) == 0) {
-               fprintf(stderr, "%s: ERROR: empty export file name\n", filename);
+               flac_fprintf(stderr, "%s: ERROR: empty export file name\n", filename);
                return false;
        }
        if(0 == strcmp(vc_filename->value, "-"))
                f = stdout;
        else
-               f = fopen(vc_filename->value, "w");
+               f = flac_fopen(vc_filename->value, "w");
 
        if(0 == f) {
-               fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, vc_filename->value, strerror(errno));
+               flac_fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, vc_filename->value, strerror(errno));
                return false;
        }
 
index 2ff4ce4..6aded4a 100644 (file)
@@ -178,8 +178,8 @@ FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options)
                options->prefix_with_filename = (argc - share__optind > 1);
 
        if(share__optind >= argc && !options->show_long_help && !options->show_version) {
-               fprintf(stderr,"ERROR: you must specify at least one FLAC file;\n");
-               fprintf(stderr,"       metaflac cannot be used as a pipe\n");
+               flac_fprintf(stderr,"ERROR: you must specify at least one FLAC file;\n");
+               flac_fprintf(stderr,"       metaflac cannot be used as a pipe\n");
                had_error = true;
        }
 
@@ -195,11 +195,11 @@ FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options)
 
        if(options->args.checks.num_major_ops > 0) {
                if(options->args.checks.num_major_ops > 1) {
-                       fprintf(stderr, "ERROR: you may only specify one major operation at a time\n");
+                       flac_fprintf(stderr, "ERROR: you may only specify one major operation at a time\n");
                        had_error = true;
                }
                else if(options->args.checks.num_shorthand_ops > 0) {
-                       fprintf(stderr, "ERROR: you may not mix shorthand and major operations\n");
+                       flac_fprintf(stderr, "ERROR: you may not mix shorthand and major operations\n");
                        had_error = true;
                }
        }
@@ -207,28 +207,28 @@ FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options)
        /* check for only one FLAC file used with certain options */
        if(options->num_files > 1) {
                if(0 != find_shorthand_operation(options, OP__IMPORT_CUESHEET_FROM)) {
-                       fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--import-cuesheet-from'\n");
+                       flac_fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--import-cuesheet-from'\n");
                        had_error = true;
                }
                if(0 != find_shorthand_operation(options, OP__EXPORT_CUESHEET_TO)) {
-                       fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--export-cuesheet-to'\n");
+                       flac_fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--export-cuesheet-to'\n");
                        had_error = true;
                }
                if(0 != find_shorthand_operation(options, OP__EXPORT_PICTURE_TO)) {
-                       fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--export-picture-to'\n");
+                       flac_fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--export-picture-to'\n");
                        had_error = true;
                }
                if(
                        0 != find_shorthand_operation(options, OP__IMPORT_VC_FROM) &&
                        0 == strcmp(find_shorthand_operation(options, OP__IMPORT_VC_FROM)->argument.filename.value, "-")
                ) {
-                       fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--import-tags-from=-'\n");
+                       flac_fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--import-tags-from=-'\n");
                        had_error = true;
                }
        }
 
        if(options->args.checks.has_block_type && options->args.checks.has_except_block_type) {
-               fprintf(stderr, "ERROR: you may not specify both '--block-type' and '--except-block-type'\n");
+               flac_fprintf(stderr, "ERROR: you may not specify both '--block-type' and '--except-block-type'\n");
                had_error = true;
        }
 
@@ -400,7 +400,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                op = append_shorthand_operation(options, OP__SET_MD5SUM);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_md5(option_argument, op->argument.streaminfo_md5.value)) {
-                       fprintf(stderr, "ERROR (--%s): bad MD5 sum\n", opt);
+                       flac_fprintf(stderr, "ERROR (--%s): bad MD5 sum\n", opt);
                        ok = false;
                }
                else
@@ -409,7 +409,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
        else if(0 == strcmp(opt, "set-min-blocksize")) {
                op = append_shorthand_operation(options, OP__SET_MIN_BLOCKSIZE);
                if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value < FLAC__MIN_BLOCK_SIZE || op->argument.streaminfo_uint32.value > FLAC__MAX_BLOCK_SIZE) {
-                       fprintf(stderr, "ERROR (--%s): value must be >= %u and <= %u\n", opt, FLAC__MIN_BLOCK_SIZE, FLAC__MAX_BLOCK_SIZE);
+                       flac_fprintf(stderr, "ERROR (--%s): value must be >= %u and <= %u\n", opt, FLAC__MIN_BLOCK_SIZE, FLAC__MAX_BLOCK_SIZE);
                        ok = false;
                }
                else
@@ -418,7 +418,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
        else if(0 == strcmp(opt, "set-max-blocksize")) {
                op = append_shorthand_operation(options, OP__SET_MAX_BLOCKSIZE);
                if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value < FLAC__MIN_BLOCK_SIZE || op->argument.streaminfo_uint32.value > FLAC__MAX_BLOCK_SIZE) {
-                       fprintf(stderr, "ERROR (--%s): value must be >= %u and <= %u\n", opt, FLAC__MIN_BLOCK_SIZE, FLAC__MAX_BLOCK_SIZE);
+                       flac_fprintf(stderr, "ERROR (--%s): value must be >= %u and <= %u\n", opt, FLAC__MIN_BLOCK_SIZE, FLAC__MAX_BLOCK_SIZE);
                        ok = false;
                }
                else
@@ -427,7 +427,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
        else if(0 == strcmp(opt, "set-min-framesize")) {
                op = append_shorthand_operation(options, OP__SET_MIN_FRAMESIZE);
                if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value >= (1u<<FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN)) {
-                       fprintf(stderr, "ERROR (--%s): value must be a %u-bit unsigned integer\n", opt, FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN);
+                       flac_fprintf(stderr, "ERROR (--%s): value must be a %u-bit unsigned integer\n", opt, FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN);
                        ok = false;
                }
                else
@@ -436,7 +436,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
        else if(0 == strcmp(opt, "set-max-framesize")) {
                op = append_shorthand_operation(options, OP__SET_MAX_FRAMESIZE);
                if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value >= (1u<<FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN)) {
-                       fprintf(stderr, "ERROR (--%s): value must be a %u-bit unsigned integer\n", opt, FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN);
+                       flac_fprintf(stderr, "ERROR (--%s): value must be a %u-bit unsigned integer\n", opt, FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN);
                        ok = false;
                }
                else
@@ -445,7 +445,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
        else if(0 == strcmp(opt, "set-sample-rate")) {
                op = append_shorthand_operation(options, OP__SET_SAMPLE_RATE);
                if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || !FLAC__format_sample_rate_is_valid(op->argument.streaminfo_uint32.value)) {
-                       fprintf(stderr, "ERROR (--%s): invalid sample rate\n", opt);
+                       flac_fprintf(stderr, "ERROR (--%s): invalid sample rate\n", opt);
                        ok = false;
                }
                else
@@ -454,7 +454,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
        else if(0 == strcmp(opt, "set-channels")) {
                op = append_shorthand_operation(options, OP__SET_CHANNELS);
                if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value > FLAC__MAX_CHANNELS) {
-                       fprintf(stderr, "ERROR (--%s): value must be > 0 and <= %u\n", opt, FLAC__MAX_CHANNELS);
+                       flac_fprintf(stderr, "ERROR (--%s): value must be > 0 and <= %u\n", opt, FLAC__MAX_CHANNELS);
                        ok = false;
                }
                else
@@ -463,7 +463,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
        else if(0 == strcmp(opt, "set-bps")) {
                op = append_shorthand_operation(options, OP__SET_BPS);
                if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value < FLAC__MIN_BITS_PER_SAMPLE || op->argument.streaminfo_uint32.value > FLAC__MAX_BITS_PER_SAMPLE) {
-                       fprintf(stderr, "ERROR (--%s): value must be >= %u and <= %u\n", opt, FLAC__MIN_BITS_PER_SAMPLE, FLAC__MAX_BITS_PER_SAMPLE);
+                       flac_fprintf(stderr, "ERROR (--%s): value must be >= %u and <= %u\n", opt, FLAC__MIN_BITS_PER_SAMPLE, FLAC__MAX_BITS_PER_SAMPLE);
                        ok = false;
                }
                else
@@ -472,7 +472,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
        else if(0 == strcmp(opt, "set-total-samples")) {
                op = append_shorthand_operation(options, OP__SET_TOTAL_SAMPLES);
                if(!parse_uint64(option_argument, &(op->argument.streaminfo_uint64.value)) || op->argument.streaminfo_uint64.value >= (((FLAC__uint64)1)<<FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN)) {
-                       fprintf(stderr, "ERROR (--%s): value must be a %u-bit unsigned integer\n", opt, FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN);
+                       flac_fprintf(stderr, "ERROR (--%s): value must be a %u-bit unsigned integer\n", opt, FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN);
                        ok = false;
                }
                else
@@ -487,7 +487,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                FLAC__ASSERT(0 != option_argument);
                if(!parse_vorbis_comment_field_name(option_argument, &(op->argument.vc_field_name.value), &violation)) {
                        FLAC__ASSERT(0 != violation);
-                       fprintf(stderr, "ERROR (--%s): malformed vorbis comment field name \"%s\",\n       %s\n", opt, option_argument, violation);
+                       flac_fprintf(stderr, "ERROR (--%s): malformed vorbis comment field name \"%s\",\n       %s\n", opt, option_argument, violation);
                        ok = false;
                }
        }
@@ -500,7 +500,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                FLAC__ASSERT(0 != option_argument);
                if(!parse_vorbis_comment_field_name(option_argument, &(op->argument.vc_field_name.value), &violation)) {
                        FLAC__ASSERT(0 != violation);
-                       fprintf(stderr, "ERROR (--%s): malformed vorbis comment field name \"%s\",\n       %s\n", opt, option_argument, violation);
+                       flac_fprintf(stderr, "ERROR (--%s): malformed vorbis comment field name \"%s\",\n       %s\n", opt, option_argument, violation);
                        ok = false;
                }
        }
@@ -510,7 +510,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                FLAC__ASSERT(0 != option_argument);
                if(!parse_vorbis_comment_field_name(option_argument, &(op->argument.vc_field_name.value), &violation)) {
                        FLAC__ASSERT(0 != violation);
-                       fprintf(stderr, "ERROR (--%s): malformed vorbis comment field name \"%s\",\n       %s\n", opt, option_argument, violation);
+                       flac_fprintf(stderr, "ERROR (--%s): malformed vorbis comment field name \"%s\",\n       %s\n", opt, option_argument, violation);
                        ok = false;
                }
        }
@@ -521,7 +521,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                op->argument.vc_field.field_value_from_file = false;
                if(!parse_vorbis_comment_field(option_argument, &(op->argument.vc_field.field), &(op->argument.vc_field.field_name), &(op->argument.vc_field.field_value), &(op->argument.vc_field.field_value_length), &violation)) {
                        FLAC__ASSERT(0 != violation);
-                       fprintf(stderr, "ERROR (--%s): malformed vorbis comment field \"%s\",\n       %s\n", opt, option_argument, violation);
+                       flac_fprintf(stderr, "ERROR (--%s): malformed vorbis comment field \"%s\",\n       %s\n", opt, option_argument, violation);
                        ok = false;
                }
        }
@@ -532,7 +532,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                op->argument.vc_field.field_value_from_file = true;
                if(!parse_vorbis_comment_field(option_argument, &(op->argument.vc_field.field), &(op->argument.vc_field.field_name), &(op->argument.vc_field.field_value), &(op->argument.vc_field.field_value_length), &violation)) {
                        FLAC__ASSERT(0 != violation);
-                       fprintf(stderr, "ERROR (--%s): malformed vorbis comment field \"%s\",\n       %s\n", opt, option_argument, violation);
+                       flac_fprintf(stderr, "ERROR (--%s): malformed vorbis comment field \"%s\",\n       %s\n", opt, option_argument, violation);
                        ok = false;
                }
        }
@@ -540,7 +540,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                op = append_shorthand_operation(options, OP__IMPORT_VC_FROM);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_string(option_argument, &(op->argument.filename.value))) {
-                       fprintf(stderr, "ERROR (--%s): missing filename\n", opt);
+                       flac_fprintf(stderr, "ERROR (--%s): missing filename\n", opt);
                        ok = false;
                }
        }
@@ -548,19 +548,19 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                op = append_shorthand_operation(options, OP__EXPORT_VC_TO);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_string(option_argument, &(op->argument.filename.value))) {
-                       fprintf(stderr, "ERROR (--%s): missing filename\n", opt);
+                       flac_fprintf(stderr, "ERROR (--%s): missing filename\n", opt);
                        ok = false;
                }
        }
        else if(0 == strcmp(opt, "import-cuesheet-from")) {
                if(0 != find_shorthand_operation(options, OP__IMPORT_CUESHEET_FROM)) {
-                       fprintf(stderr, "ERROR (--%s): may be specified only once\n", opt);
+                       flac_fprintf(stderr, "ERROR (--%s): may be specified only once\n", opt);
                        ok = false;
                }
                op = append_shorthand_operation(options, OP__IMPORT_CUESHEET_FROM);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_string(option_argument, &(op->argument.import_cuesheet_from.filename))) {
-                       fprintf(stderr, "ERROR (--%s): missing filename\n", opt);
+                       flac_fprintf(stderr, "ERROR (--%s): missing filename\n", opt);
                        ok = false;
                }
        }
@@ -568,7 +568,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                op = append_shorthand_operation(options, OP__EXPORT_CUESHEET_TO);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_string(option_argument, &(op->argument.filename.value))) {
-                       fprintf(stderr, "ERROR (--%s): missing filename\n", opt);
+                       flac_fprintf(stderr, "ERROR (--%s): missing filename\n", opt);
                        ok = false;
                }
        }
@@ -576,7 +576,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                op = append_shorthand_operation(options, OP__IMPORT_PICTURE_FROM);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_string(option_argument, &(op->argument.specification.value))) {
-                       fprintf(stderr, "ERROR (--%s): missing specification\n", opt);
+                       flac_fprintf(stderr, "ERROR (--%s): missing specification\n", opt);
                        ok = false;
                }
        }
@@ -585,7 +585,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                op = append_shorthand_operation(options, OP__EXPORT_PICTURE_TO);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_string(option_argument, &(op->argument.export_picture_to.filename))) {
-                       fprintf(stderr, "ERROR (--%s): missing filename\n", opt);
+                       flac_fprintf(stderr, "ERROR (--%s): missing filename\n", opt);
                        ok = false;
                }
                op->argument.export_picture_to.block_number_link = arg? &(arg->value.block_number) : 0;
@@ -596,7 +596,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                FLAC__ASSERT(0 != option_argument);
                if(!parse_add_seekpoint(option_argument, &spec, &violation)) {
                        FLAC__ASSERT(0 != violation);
-                       fprintf(stderr, "ERROR (--%s): malformed seekpoint specification \"%s\",\n       %s\n", opt, option_argument, violation);
+                       flac_fprintf(stderr, "ERROR (--%s): malformed seekpoint specification \"%s\",\n       %s\n", opt, option_argument, violation);
                        ok = false;
                }
                else {
@@ -629,7 +629,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                op = append_shorthand_operation(options, OP__ADD_PADDING);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_add_padding(option_argument, &(op->argument.add_padding.length))) {
-                       fprintf(stderr, "ERROR (--%s): illegal length \"%s\", length must be >= 0 and < 2^%u\n", opt, option_argument, FLAC__STREAM_METADATA_LENGTH_LEN);
+                       flac_fprintf(stderr, "ERROR (--%s): illegal length \"%s\", length must be >= 0 and < 2^%u\n", opt, option_argument, FLAC__STREAM_METADATA_LENGTH_LEN);
                        ok = false;
                }
        }
@@ -661,7 +661,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                arg = append_argument(options, ARG__BLOCK_NUMBER);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_block_number(option_argument, &(arg->value.block_number))) {
-                       fprintf(stderr, "ERROR: malformed block number specification \"%s\"\n", option_argument);
+                       flac_fprintf(stderr, "ERROR: malformed block number specification \"%s\"\n", option_argument);
                        ok = false;
                }
        }
@@ -669,7 +669,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                arg = append_argument(options, ARG__BLOCK_TYPE);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_block_type(option_argument, &(arg->value.block_type))) {
-                       fprintf(stderr, "ERROR (--%s): malformed block type specification \"%s\"\n", opt, option_argument);
+                       flac_fprintf(stderr, "ERROR (--%s): malformed block type specification \"%s\"\n", opt, option_argument);
                        ok = false;
                }
                options->args.checks.has_block_type = true;
@@ -678,7 +678,7 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                arg = append_argument(options, ARG__EXCEPT_BLOCK_TYPE);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_block_type(option_argument, &(arg->value.block_type))) {
-                       fprintf(stderr, "ERROR (--%s): malformed block type specification \"%s\"\n", opt, option_argument);
+                       flac_fprintf(stderr, "ERROR (--%s): malformed block type specification \"%s\"\n", opt, option_argument);
                        ok = false;
                }
                options->args.checks.has_except_block_type = true;
@@ -687,14 +687,14 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
                arg = append_argument(options, ARG__DATA_FORMAT);
                FLAC__ASSERT(0 != option_argument);
                if(!parse_data_format(option_argument, &(arg->value.data_format))) {
-                       fprintf(stderr, "ERROR (--%s): illegal data format \"%s\"\n", opt, option_argument);
+                       flac_fprintf(stderr, "ERROR (--%s): illegal data format \"%s\"\n", opt, option_argument);
                        ok = false;
                }
        }
        else if(0 == strcmp(opt, "application-data-format")) {
                FLAC__ASSERT(0 != option_argument);
                if(!parse_application_data_format(option_argument, &(options->application_data_format_is_hexdump))) {
-                       fprintf(stderr, "ERROR (--%s): illegal application data format \"%s\"\n", opt, option_argument);
+                       flac_fprintf(stderr, "ERROR (--%s): illegal application data format \"%s\"\n", opt, option_argument);
                        ok = false;
                }
        }
@@ -1084,5 +1084,5 @@ FLAC__bool parse_application_data_format(const char *in, FLAC__bool *out)
 
 void undocumented_warning(const char *opt)
 {
-       fprintf(stderr, "WARNING: undocmented option --%s should be used with caution,\n         only for repairing a damaged STREAMINFO block\n", opt);
+       flac_fprintf(stderr, "WARNING: undocmented option --%s should be used with caution,\n         only for repairing a damaged STREAMINFO block\n", opt);
 }
index b08c497..0b05eee 100644 (file)
@@ -24,6 +24,7 @@
 #include "FLAC/format.h"
 #include <stdarg.h>
 #include <stdio.h>
+#include "share/compat.h"
 
 static void usage_header(FILE *out)
 {
@@ -83,9 +84,9 @@ int short_usage(const char *message, ...)
 
        }
        usage_header(stderr);
-       fprintf(stderr, "\n");
-       fprintf(stderr, "This is the short help; for full help use 'metaflac --help'\n");
-       fprintf(stderr, "\n");
+       flac_fprintf(stderr, "\n");
+       flac_fprintf(stderr, "This is the short help; for full help use 'metaflac --help'\n");
+       flac_fprintf(stderr, "\n");
        usage_summary(stderr);
 
        return message? 1 : 0;
index 13e7cec..934cfcf 100644 (file)
 #include "share/alloc.h"
 #include "share/safe_str.h"
 #include "share/utf8.h"
+#include "share/compat.h"
 
 void die(const char *message)
 {
        FLAC__ASSERT(0 != message);
-       fprintf(stderr, "ERROR: %s\n", message);
+       flac_fprintf(stderr, "ERROR: %s\n", message);
        exit(1);
 }
 
@@ -82,7 +83,7 @@ void hexdump(const char *filename, const FLAC__byte *buf, unsigned bytes, const
        const FLAC__byte *b = buf;
 
        for(i = 0; i < bytes; i += 16) {
-               printf("%s%s%s%08X: "
+               flac_printf("%s%s%s%08X: "
                        "%02X %02X %02X %02X %02X %02X %02X %02X "
                        "%02X %02X %02X %02X %02X %02X %02X %02X "
                        "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",
@@ -139,43 +140,43 @@ void print_error_with_chain_status(FLAC__Metadata_Chain *chain, const char *form
 
        va_end(args);
 
-       fprintf(stderr, ", status = \"%s\"\n", FLAC__Metadata_ChainStatusString[status]);
+       flac_fprintf(stderr, ", status = \"%s\"\n", FLAC__Metadata_ChainStatusString[status]);
 
        if(status == FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE) {
-               fprintf(stderr, "\n"
+               flac_fprintf(stderr, "\n"
                        "The FLAC file could not be opened.  Most likely the file does not exist\n"
                        "or is not readable.\n"
                );
        }
        else if(status == FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE) {
-               fprintf(stderr, "\n"
+               flac_fprintf(stderr, "\n"
                        "The file does not appear to be a FLAC file.\n"
                );
        }
        else if(status == FLAC__METADATA_CHAIN_STATUS_NOT_WRITABLE) {
-               fprintf(stderr, "\n"
+               flac_fprintf(stderr, "\n"
                        "The FLAC file does not have write permissions.\n"
                );
        }
        else if(status == FLAC__METADATA_CHAIN_STATUS_BAD_METADATA) {
-               fprintf(stderr, "\n"
+               flac_fprintf(stderr, "\n"
                        "The metadata to be writted does not conform to the FLAC metadata\n"
                        "specifications.\n"
                );
        }
        else if(status == FLAC__METADATA_CHAIN_STATUS_READ_ERROR) {
-               fprintf(stderr, "\n"
+               flac_fprintf(stderr, "\n"
                        "There was an error while reading the FLAC file.\n"
                );
        }
        else if(status == FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR) {
-               fprintf(stderr, "\n"
+               flac_fprintf(stderr, "\n"
                        "There was an error while writing FLAC file; most probably the disk is\n"
                        "full.\n"
                );
        }
        else if(status == FLAC__METADATA_CHAIN_STATUS_UNLINK_ERROR) {
-               fprintf(stderr, "\n"
+               flac_fprintf(stderr, "\n"
                        "There was an error removing the temporary FLAC file.\n"
                );
        }
index 6c076d4..315d4db 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\objs\release\bin"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 5fc7cbc..bd0f971 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\objs\release\bin"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 502b203..c8e1295 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release_static"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL;FLaC__INLINE=_inline;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\objs\release\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 6f0c7a7..0c9df72 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release_static"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\objs\release\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 04e3aad..601dba5 100644 (file)
 
 void grabbag__file_copy_metadata(const char *srcpath, const char *destpath)
 {
-       struct stat srcstat;
+       struct _flac_stat srcstat;
        struct utimbuf srctime;
 
-       if(0 == stat(srcpath, &srcstat)) {
+       if(0 == flac_stat(srcpath, &srcstat)) {
                srctime.actime = srcstat.st_atime;
                srctime.modtime = srcstat.st_mtime;
-               (void)chmod(destpath, srcstat.st_mode);
-               (void)utime(destpath, &srctime);
+               (void)flac_chmod(destpath, srcstat.st_mode);
+               (void)flac_utime(destpath, &srctime);
        }
 }
 
 FLAC__off_t grabbag__file_get_filesize(const char *srcpath)
 {
-#if defined _MSC_VER || defined __MINGW32__
-       struct _stat64 srcstat;
-
-       if(0 == _stat64(srcpath, &srcstat))
-#else
-       struct stat srcstat;
+       struct _flac_stat srcstat;
 
-       if(0 == stat(srcpath, &srcstat))
-#endif
+       if(0 == flac_stat(srcpath, &srcstat))
                return srcstat.st_size;
        else
                return -1;
@@ -92,9 +86,9 @@ const char *grabbag__file_get_basename(const char *srcpath)
 
 FLAC__bool grabbag__file_change_stats(const char *filename, FLAC__bool read_only)
 {
-       struct stat stats;
+       struct _flac_stat stats;
 
-       if(0 == stat(filename, &stats)) {
+       if(0 == flac_stat(filename, &stats)) {
 #if !defined _MSC_VER && !defined __MINGW32__
                if(read_only) {
                        stats.st_mode &= ~S_IWUSR;
@@ -110,7 +104,7 @@ FLAC__bool grabbag__file_change_stats(const char *filename, FLAC__bool read_only
                else
                        stats.st_mode |= S_IWRITE;
 #endif
-               if(0 != chmod(filename, stats.st_mode))
+               if(0 != flac_chmod(filename, stats.st_mode))
                        return false;
        }
        else
@@ -151,14 +145,14 @@ FLAC__bool grabbag__file_are_same(const char *f1, const char *f2)
                CloseHandle(h2);
        return same;
 #else
-       struct stat s1, s2;
-       return f1 && f2 && stat(f1, &s1) == 0 && stat(f2, &s2) == 0 && s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev;
+       struct _flac_stat s1, s2;
+       return f1 && f2 && flac_stat(f1, &s1) == 0 && flac_stat(f2, &s2) == 0 && s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev;
 #endif
 }
 
 FLAC__bool grabbag__file_remove_file(const char *filename)
 {
-       return grabbag__file_change_stats(filename, /*read_only=*/false) && 0 == unlink(filename);
+       return grabbag__file_change_stats(filename, /*read_only=*/false) && 0 == flac_unlink(filename);
 }
 
 FILE *grabbag__file_get_binary_stdin(void)
index 284bbb8..5a54709 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release_static"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\objs\release\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 965a7b3..1afa1c7 100644 (file)
@@ -365,7 +365,7 @@ FLAC__StreamMetadata *grabbag__picture_parse_specification(const char *spec, con
                                        if(0 == buffer)
                                                *error_message = error_messages[0];
                                        else {
-                                               FILE *f = fopen(spec, "rb");
+                                               FILE *f = flac_fopen(spec, "rb");
                                                if(0 == f) {
                                                        *error_message = error_messages[5];
                                                        free(buffer);
index 34cac63..ba6b98c 100644 (file)
@@ -69,19 +69,19 @@ const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN = (const FLAC__byte
 const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK = (const FLAC__byte * const)"REPLAYGAIN_ALBUM_PEAK";
 
 
-static FLAC__bool get_file_stats_(const char *filename, struct stat *stats)
+static FLAC__bool get_file_stats_(const char *filename, struct _flac_stat *stats)
 {
        FLAC__ASSERT(0 != filename);
        FLAC__ASSERT(0 != stats);
-       return (0 == stat(filename, stats));
+       return (0 == flac_stat(filename, stats));
 }
 
-static void set_file_stats_(const char *filename, struct stat *stats)
+static void set_file_stats_(const char *filename, struct _flac_stat *stats)
 {
        FLAC__ASSERT(0 != filename);
        FLAC__ASSERT(0 != stats);
 
-       (void)chmod(filename, stats->st_mode);
+       (void)flac_chmod(filename, stats->st_mode);
 }
 
 static FLAC__bool append_tag_(FLAC__StreamMetadata *block, const char *format, const FLAC__byte *name, float value)
@@ -478,7 +478,7 @@ static const char *store_to_file_pre_(const char *filename, FLAC__Metadata_Chain
 
 static const char *store_to_file_post_(const char *filename, FLAC__Metadata_Chain *chain, FLAC__bool preserve_modtime)
 {
-       struct stat stats;
+       struct _flac_stat stats;
        const FLAC__bool have_stats = get_file_stats_(filename, &stats);
 
        (void)grabbag__file_change_stats(filename, /*read_only=*/false);
index 38846d9..2b35a71 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release_static"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\..\include\share"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\objs\release\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 6c50b1e..ceb0d87 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release_static"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\..\include;..\..\..\include\share"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\objs\release\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
index 9fe4f8a..cf691ea 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release_static"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\..\include;..\..\..\include\share"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\objs\release\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
diff --git a/src/share/utf8_io/utf8_io.c b/src/share/utf8_io/utf8_io.c
new file mode 100644 (file)
index 0000000..8bae43e
--- /dev/null
@@ -0,0 +1,258 @@
+#ifdef FLAC__STRINGS_IN_UTF8
+
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/utime.h>
+#include <io.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <windows.h> /* for WideCharToMultiByte and MultiByteToWideChar */
+
+/* convert WCHAR stored Unicode string to UTF-8. Caller is responsible for freeing memory */
+char *utf8_from_wchar(const wchar_t *wstr)
+{
+       char *utf8str;
+       int len;
+
+       if (!wstr) return NULL;
+       if ((len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL)) == 0) return NULL;
+       if ((utf8str = (char *)malloc(++len)) == NULL) return NULL;
+       if (WideCharToMultiByte(CP_UTF8, 0, wstr, -1, utf8str, len, NULL, NULL) == 0) {
+               free(utf8str);
+               utf8str = NULL;
+       }
+
+       return utf8str;
+}
+
+/* convert UTF-8 back to WCHAR. Caller is responsible for freeing memory */
+wchar_t *wchar_from_utf8(const char *str)
+{
+       wchar_t *widestr;
+       int len;
+
+       if (!str) return NULL;
+       len=(int)strlen(str)+1;
+       if ((widestr = (wchar_t *)malloc(len*sizeof(wchar_t))) != NULL) {
+               if (MultiByteToWideChar(CP_UTF8, 0, str, len, widestr, len) == 0) {
+                       if (MultiByteToWideChar(CP_ACP, 0, str, len, widestr, len) == 0) { /* try conversion from Ansi in case the initial UTF-8 conversion had failed */
+                               free(widestr);
+                               widestr = NULL;
+                       }
+               }
+       }
+
+       return widestr;
+}
+
+/* retrieve WCHAR commandline, expand wildcards and convert everything to UTF-8 */
+int get_utf8_argv(int *argc, char ***argv)
+{
+       typedef int (__cdecl *__wgetmainargs_)(int*, wchar_t***, wchar_t***, int, int*);
+       __wgetmainargs_ __wgetmainargs;
+       HMODULE handle;
+       int wargc;
+       wchar_t **wargv;
+       wchar_t **wenv;
+       char **utf8argv;
+       int ret, i;
+
+       if ((handle = LoadLibrary("msvcrt.dll")) == NULL) return 1;
+       if ((__wgetmainargs = (__wgetmainargs_)GetProcAddress(handle, "__wgetmainargs")) == NULL) return 1;
+       i = 0;
+       if (__wgetmainargs(&wargc, &wargv, &wenv, 1, &i) != 0) return 1;
+       if ((utf8argv = (char **)malloc(wargc*sizeof(char*))) == NULL) return 1;
+       ret = 0;
+
+       for (i=0; i<wargc; i++) {
+               if ((utf8argv[i] = utf8_from_wchar(wargv[i])) == NULL) {
+                       ret = 1;
+                       break;
+               }
+               if (ret != 0) break;
+       }
+
+       if (ret == 0) {
+               *argc = wargc;
+               *argv = utf8argv;
+       } else {
+               free(utf8argv);
+       }
+
+       return ret;
+}
+
+/* print functions */
+
+int printf_utf8(const char *format, ...)
+{
+       char *utmp = NULL;
+       wchar_t *wout = NULL;
+       int ret = -1;
+
+       while (1) {
+               va_list argptr;
+               if (!(utmp = (char *)malloc(32768*sizeof(char)))) break;
+               va_start(argptr, format);
+               ret = vsprintf(utmp, format, argptr);
+               va_end(argptr);
+               if (ret < 0) break;
+               if (!(wout = wchar_from_utf8(utmp))) {
+                       ret = -1;
+                       break;
+               }
+               ret = wprintf(L"%s", wout);
+               break;
+       }
+       if (utmp) free(utmp);
+       if (wout) free(wout);
+
+       return ret;
+}
+
+int fprintf_utf8(FILE *stream, const char *format, ...)
+{
+       char *utmp = NULL;
+       wchar_t *wout = NULL;
+       int ret = -1;
+
+       while (1) {
+               va_list argptr;
+               if (!(utmp = (char *)malloc(32768*sizeof(char)))) break;
+               va_start(argptr, format);
+               ret = vsprintf(utmp, format, argptr);
+               va_end(argptr);
+               if (ret < 0) break;
+               if (!(wout = wchar_from_utf8(utmp))) {
+                       ret = -1;
+                       break;
+               }
+               ret = fwprintf(stream, L"%s", wout);
+               break;
+       }
+       if (utmp) free(utmp);
+       if (wout) free(wout);
+
+       return ret;
+}
+
+int vfprintf_utf8(FILE *stream, const char *format, va_list argptr)
+{
+       char *utmp = NULL;
+       wchar_t *wout = NULL;
+       int ret = -1;
+
+       while (1) {
+               if (!(utmp = (char *)malloc(32768*sizeof(char)))) break;
+               if ((ret = vsprintf(utmp, format, argptr)) < 0) break;
+               if (!(wout = wchar_from_utf8(utmp))) {
+                       ret = -1;
+                       break;
+               }
+               ret = fwprintf(stream, L"%s", wout);
+               break;
+       }
+       if (utmp) free(utmp);
+       if (wout) free(wout);
+
+       return ret;
+}
+
+/* file functions */
+
+FILE *fopen_utf8(const char *filename, const char *mode)
+{
+       wchar_t *wname = NULL;
+       wchar_t *wmode = NULL;
+       FILE *f = NULL;
+
+       while (1) {
+               if (!(wname = wchar_from_utf8(filename))) break;
+               if (!(wmode = wchar_from_utf8(mode))) break;
+               f = _wfopen(wname, wmode);
+               break;
+       }
+       if (wname) free(wname);
+       if (wmode) free(wmode);
+
+       return f;
+}
+
+int _stat64_utf8(const char *path, struct _stat64 *buffer)
+{
+       wchar_t *wpath;
+       int ret;
+
+       if (!(wpath = wchar_from_utf8(path))) return -1;
+       ret = _wstat64(wpath, buffer);
+       free(wpath);
+
+       return ret;
+}
+
+int chmod_utf8(const char *filename, int pmode)
+{
+       wchar_t *wname;
+       int ret;
+
+       if (!(wname = wchar_from_utf8(filename))) return -1;
+       ret = _wchmod(wname, pmode);
+       free(wname);
+
+       return ret;
+}
+
+int utime_utf8(const char *filename, struct utimbuf *times)
+{
+       wchar_t *wname;
+       struct _utimbuf ut;
+       int ret;
+
+       if (!(wname = wchar_from_utf8(filename))) return -1;
+       ret = _wutime(wname, &ut);
+       free(wname);
+
+       if (ret != -1) {
+               if (sizeof(*times) == sizeof(ut)) {
+                       memcpy(times, &ut, sizeof(ut));
+               } else {
+                       times->actime = ut.actime;
+                       times->modtime = ut.modtime;
+               }
+       }
+
+       return ret;
+}
+
+int unlink_utf8(const char *filename)
+{
+       wchar_t *wname;
+       int ret;
+
+       if (!(wname = wchar_from_utf8(filename))) return -1;
+       ret = _wunlink(wname);
+       free(wname);
+
+       return ret;
+}
+
+int rename_utf8(const char *oldname, const char *newname)
+{
+       wchar_t *wold = NULL;
+       wchar_t *wnew = NULL;
+       int ret = -1;
+
+       while (1) {
+               if (!(wold = wchar_from_utf8(oldname))) break;
+               if (!(wnew = wchar_from_utf8(newname))) break;
+               ret = _wrename(wold, wnew);
+               break;
+       }
+       if (wold) free(wold);
+       if (wnew) free(wnew);
+
+       return ret;
+}
+
+#endif
diff --git a/src/share/utf8_io/utf8_io.vcproj b/src/share/utf8_io/utf8_io.vcproj
new file mode 100644 (file)
index 0000000..c63aeb7
--- /dev/null
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="utf8_io"\r
+       ProjectGUID="{4cefbe02-c215-11db-8314-0800200c9a66}"\r
+       RootNamespace="utf8_io"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="..\..\..\objs\debug\lib"\r
+                       IntermediateDirectory="Debug"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories=".\include;..\..\..\include;..\..\..\include\share"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__NO_DLL;DEBUG"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="1"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="4"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\objs\debug\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="..\..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\..\include;..\..\..\include\share"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\objs\release\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\objs\release\lib"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="4"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".\include;..\..\..\include;..\..\..\include\share"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="..\..\..\objs\release\lib\$(ProjectName).lib"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Public Header Files"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\..\..\include\share\utf8_io.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\utf8_io.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index d04fa4b..002830b 100644 (file)
@@ -44,7 +44,7 @@ static int do_cuesheet(const char *infilename, unsigned sample_rate, FLAC__bool
        if(0 == strcmp(infilename, "-")) {
                fin = stdin;
        }
-       else if(0 == (fin = fopen(infilename, "r"))) {
+       else if(0 == (fin = flac_fopen(infilename, "r"))) {
                fprintf(stderr, "can't open file %s for reading: %s\n", infilename, strerror(errno));
                return 255;
        }
@@ -64,7 +64,7 @@ static int do_cuesheet(const char *infilename, unsigned sample_rate, FLAC__bool
                return 1;
        }
        flac_snprintf(tmpfilename, sizeof (tmpfilename), "%s.1", infilename);
-       if(0 == (fout = fopen(tmpfilename, "w"))) {
+       if(0 == (fout = flac_fopen(tmpfilename, "w"))) {
                fprintf(stderr, "can't open file %s for writing: %s\n", tmpfilename, strerror(errno));
                FLAC__metadata_object_delete(cuesheet);
                return 255;
@@ -76,7 +76,7 @@ static int do_cuesheet(const char *infilename, unsigned sample_rate, FLAC__bool
        /*
         * pass 2
         */
-       if(0 == (fin = fopen(tmpfilename, "r"))) {
+       if(0 == (fin = flac_fopen(tmpfilename, "r"))) {
                fprintf(stderr, "can't open file %s for reading: %s\n", tmpfilename, strerror(errno));
                return 255;
        }
@@ -96,7 +96,7 @@ static int do_cuesheet(const char *infilename, unsigned sample_rate, FLAC__bool
                return 1;
        }
        flac_snprintf(tmpfilename, sizeof (tmpfilename), "%s.2", infilename);
-       if(0 == (fout = fopen(tmpfilename, "w"))) {
+       if(0 == (fout = flac_fopen(tmpfilename, "w"))) {
                fprintf(stderr, "can't open file %s for writing: %s\n", tmpfilename, strerror(errno));
                FLAC__metadata_object_delete(cuesheet);
                return 255;
index 0d72363..56458cb 100644 (file)
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Release (UTF8)|Win32"\r
+                       OutputDirectory="..\..\..\objs\release\bin"\r
+                       IntermediateDirectory="Release"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories=".;..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"\r
+                               RuntimeLibrary="0"\r
+                               BufferSecurityCheck="false"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="0"\r
+                               DisableSpecificWarnings="4267;4996"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               LinkIncremental="1"\r
+                               IgnoreDefaultLibraryNames="uuid.lib"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+  &nb