Huge Windows utf8 I/O patch.

Patch from Janne Hyvärinen <cse@sci.fi>.
This commit is contained in:
Erik de Castro Lopo
2013-03-21 19:18:49 +11:00
parent 9b8fdafe3a
commit 5705b4d7b2
68 changed files with 3200 additions and 299 deletions

View File

@@ -221,7 +221,7 @@ static FLAC__bool generate_01(void)
FILE *f;
FLAC__int16 x = -32768;
if(0 == (f = fopen("test01.raw", "wb")))
if(0 == (f = flac_fopen("test01.raw", "wb")))
return false;
if(!write_little_endian_int16(f, x))
@@ -240,7 +240,7 @@ static FLAC__bool generate_02(void)
FILE *f;
FLAC__int16 xl = -32768, xr = 32767;
if(0 == (f = fopen("test02.raw", "wb")))
if(0 == (f = flac_fopen("test02.raw", "wb")))
return false;
if(!write_little_endian_int16(f, xl))
@@ -262,7 +262,7 @@ static FLAC__bool generate_03(void)
FLAC__int16 x[] = { -25, 0, 25, 50, 100 };
unsigned i;
if(0 == (f = fopen("test03.raw", "wb")))
if(0 == (f = flac_fopen("test03.raw", "wb")))
return false;
for(i = 0; i < 5; i++)
@@ -283,7 +283,7 @@ static FLAC__bool generate_04(void)
FLAC__int16 x[] = { -25, 500, 0, 400, 25, 300, 50, 200, 100, 100 };
unsigned i;
if(0 == (f = fopen("test04.raw", "wb")))
if(0 == (f = flac_fopen("test04.raw", "wb")))
return false;
for(i = 0; i < 10; i++)
@@ -305,7 +305,7 @@ static FLAC__bool generate_fsd8(const char *fn, const int pattern[], unsigned re
FLAC__ASSERT(pattern != 0);
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(rep = 0; rep < reps; rep++) {
@@ -331,7 +331,7 @@ static FLAC__bool generate_fsd16(const char *fn, const int pattern[], unsigned r
FLAC__ASSERT(pattern != 0);
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(rep = 0; rep < reps; rep++) {
@@ -355,7 +355,7 @@ static FLAC__bool generate_wbps16(const char *fn, unsigned samples)
FILE *f;
unsigned sample;
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(sample = 0; sample < samples; sample++) {
@@ -382,7 +382,7 @@ static FLAC__bool generate_fsd24(const char *fn, const int pattern[], unsigned r
FLAC__ASSERT(pattern != 0);
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(rep = 0; rep < reps; rep++) {
@@ -410,7 +410,7 @@ static FLAC__bool generate_sine8_1(const char *fn, const double sample_rate, con
double theta1, theta2;
unsigned i;
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -437,7 +437,7 @@ static FLAC__bool generate_sine8_2(const char *fn, const double sample_rate, con
double theta1, theta2;
unsigned i;
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -468,7 +468,7 @@ static FLAC__bool generate_sine16_1(const char *fn, const double sample_rate, co
double theta1, theta2;
unsigned i;
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -495,7 +495,7 @@ static FLAC__bool generate_sine16_2(const char *fn, const double sample_rate, co
double theta1, theta2;
unsigned i;
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -526,7 +526,7 @@ static FLAC__bool generate_sine24_1(const char *fn, const double sample_rate, co
double theta1, theta2;
unsigned i;
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -553,7 +553,7 @@ static FLAC__bool generate_sine24_2(const char *fn, const double sample_rate, co
double theta1, theta2;
unsigned i;
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -579,7 +579,7 @@ static FLAC__bool generate_noise(const char *fn, unsigned bytes)
FILE *f;
unsigned b;
if(0 == (f = fopen(fn, "wb")))
if(0 == (f = flac_fopen(fn, "wb")))
return false;
for(b = 0; b < bytes; b++) {
@@ -609,7 +609,7 @@ static FLAC__bool generate_raw(const char *filename, unsigned channels, unsigned
FILE *f;
unsigned i, j;
if(0 == (f = fopen(filename, "wb")))
if(0 == (f = flac_fopen(filename, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -642,7 +642,7 @@ static FLAC__bool generate_aiff(const char *filename, unsigned sample_rate, unsi
FILE *f;
unsigned i, j;
if(0 == (f = fopen(filename, "wb")))
if(0 == (f = flac_fopen(filename, "wb")))
return false;
if(fwrite("FORM", 1, 4, f) < 4)
goto foo;
@@ -706,7 +706,7 @@ static FLAC__bool generate_wav(const char *filename, unsigned sample_rate, unsig
FILE *f;
unsigned i, j;
if(0 == (f = fopen(filename, "wb")))
if(0 == (f = flac_fopen(filename, "wb")))
return false;
/* RIFFxxxxWAVE or equivalent: */
switch(flavor) {
@@ -852,14 +852,14 @@ static FLAC__bool generate_wackywavs(void)
4, 0, 0, 0, 'b', 'l', 'a', 'h'
};
if(0 == (f = fopen("wacky1.wav", "wb")))
if(0 == (f = flac_fopen("wacky1.wav", "wb")))
return false;
if(fwrite(wav, 1, 84, f) < 84)
goto foo;
fclose(f);
wav[4] += 12;
if(0 == (f = fopen("wacky2.wav", "wb")))
if(0 == (f = flac_fopen("wacky2.wav", "wb")))
return false;
if(fwrite(wav, 1, 96, f) < 96)
goto foo;
@@ -886,7 +886,7 @@ static FLAC__bool generate_noisy_sine(void)
double sample, last_val = 0.0;
int k;
if(0 == (f = fopen("noisy-sine.wav", "wb")))
if(0 == (f = flac_fopen("noisy-sine.wav", "wb")))
return false;
if(fwrite(wav, 1, sizeof (wav), f) < sizeof (wav))
goto foo;
@@ -948,14 +948,14 @@ static FLAC__bool generate_wackywav64s(void)
'b', 'l', 'a', 'h', 'b', 'l', 'a', 'h'
};
if(0 == (f = fopen("wacky1.w64", "wb")))
if(0 == (f = flac_fopen("wacky1.w64", "wb")))
return false;
if(fwrite(wav, 1, wav[16], f) < wav[16])
goto foo;
fclose(f);
wav[16] += 32;
if(0 == (f = fopen("wacky2.w64", "wb")))
if(0 == (f = flac_fopen("wacky2.w64", "wb")))
return false;
if(fwrite(wav, 1, wav[16], f) < wav[16])
goto foo;
@@ -990,14 +990,14 @@ static FLAC__bool generate_wackyrf64s(void)
4, 0, 0, 0, 'b', 'l', 'a', 'h'
};
if(0 == (f = fopen("wacky1.rf64", "wb")))
if(0 == (f = flac_fopen("wacky1.rf64", "wb")))
return false;
if(fwrite(wav, 1, 120, f) < 120)
goto foo;
fclose(f);
wav[20] += 12;
if(0 == (f = fopen("wacky2.rf64", "wb")))
if(0 == (f = flac_fopen("wacky2.rf64", "wb")))
return false;
if(fwrite(wav, 1, 132, f) < 132)
goto foo;

View File

@@ -170,6 +170,86 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release (UTF8)|Win32"
OutputDirectory="..\..\objs\release\bin"
IntermediateDirectory="Release"
ConfigurationType="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories=".;..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL;FLAC__STRINGS_IN_UTF8"
RuntimeLibrary="0"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
CompileAs="0"
DisableSpecificWarnings="4267;4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
IgnoreDefaultLibraryNames="uuid.lib"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
LinkTimeCodeGeneration="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>