Contrib: more complete patch against FLAC, made by Jonathan Yong
[vlc.git] / extras / contrib / src / Patches / flac-win32.patch
1 From c70feed35606875b5e136c271e80b153c3d87889 Mon Sep 17 00:00:00 2001
2 From: jonY <jon_y@users.sourceforge.net>
3 Date: Wed, 12 Aug 2009 16:03:51 +0800
4 Subject: [PATCH] fix some _MSC_VER_ misuse
5
6 ---
7  src/flac/analyze.c                             |    2 +-
8  src/libFLAC/lpc.c                              |   12 ++++++------
9  src/metaflac/operations.c                      |   10 +++++-----
10  src/metaflac/operations_shorthand_cuesheet.c   |    4 ++--
11  src/metaflac/operations_shorthand_streaminfo.c |    2 +-
12  src/share/grabbag/cuesheet.c                   |    6 +++---
13  src/test_libFLAC++/encoders.cpp                |    2 +-
14  src/test_libFLAC/encoders.c                    |    2 +-
15  src/test_libFLAC/metadata_object.c             |    8 ++++----
16  src/test_libs_common/metadata_utils.c          |   12 ++++++------
17  src/test_seeking/main.c                        |    8 ++++----
18  11 files changed, 34 insertions(+), 34 deletions(-)
19
20 diff --git a/src/flac/analyze.c b/src/flac/analyze.c
21 index 47a5e76..578bbd8 100644
22 --- a/src/flac/analyze.c
23 +++ b/src/flac/analyze.c
24 @@ -66,7 +66,7 @@ void flac__analyze_frame(const FLAC__Frame *frame, unsigned frame_number, FLAC__
25         unsigned i, channel, partitions;
26  
27         /* do the human-readable part first */
28 -#ifdef _MSC_VER
29 +#ifdef __MSVCRT__
30         fprintf(fout, "frame=%u\toffset=%I64u\tbits=%u\tblocksize=%u\tsample_rate=%u\tchannels=%u\tchannel_assignment=%s\n", frame_number, frame_offset, frame_bytes*8, frame->header.blocksize, frame->header.sample_rate, channels, FLAC__ChannelAssignmentString[frame->header.channel_assignment]);
31  #else
32         fprintf(fout, "frame=%u\toffset=%llu\tbits=%u\tblocksize=%u\tsample_rate=%u\tchannels=%u\tchannel_assignment=%s\n", frame_number, (unsigned long long)frame_offset, frame_bytes*8, frame->header.blocksize, frame->header.sample_rate, channels, FLAC__ChannelAssignmentString[frame->header.channel_assignment]);
33 diff --git a/src/libFLAC/lpc.c b/src/libFLAC/lpc.c
34 index 7806348..cf81400 100644
35 --- a/src/libFLAC/lpc.c
36 +++ b/src/libFLAC/lpc.c
37 @@ -285,7 +285,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, u
38                 for(j = 0; j < order; j++) {
39                         sum += qlp_coeff[j] * (*(--history));
40                         sumo += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*history);
41 -#if defined _MSC_VER
42 +#if defined __MSVCRT__
43                         if(sumo > 2147483647I64 || sumo < -2147483648I64)
44                                 fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients: OVERFLOW, i=%u, j=%u, c=%d, d=%d, sumo=%I64d\n",i,j,qlp_coeff[j],*history,sumo);
45  #else
46 @@ -549,7 +549,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *da
47                 for(j = 0; j < order; j++)
48                         sum += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*(--history));
49                 if(FLAC__bitmath_silog2_wide(sum >> lp_quantization) > 32) {
50 -#if defined _MSC_VER
51 +#if defined __MSVCRT__
52                         fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, sum=%I64d\n", i, sum >> lp_quantization);
53  #else
54                         fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, sum=%lld\n", i, (long long)(sum >> lp_quantization));
55 @@ -557,7 +557,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *da
56                         break;
57                 }
58                 if(FLAC__bitmath_silog2_wide((FLAC__int64)(*data) - (sum >> lp_quantization)) > 32) {
59 -#if defined _MSC_VER
60 +#if defined __MSVCRT__
61                         fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, data=%d, sum=%I64d, residual=%I64d\n", i, *data, sum >> lp_quantization, (FLAC__int64)(*data) - (sum >> lp_quantization));
62  #else
63                         fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, data=%d, sum=%lld, residual=%lld\n", i, *data, (long long)(sum >> lp_quantization), (long long)((FLAC__int64)(*data) - (sum >> lp_quantization)));
64 @@ -815,7 +815,7 @@ void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, c
65                 for(j = 0; j < order; j++) {
66                         sum += qlp_coeff[j] * (*(--history));
67                         sumo += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*history);
68 -#if defined _MSC_VER
69 +#if defined __MSVCRT__
70                         if(sumo > 2147483647I64 || sumo < -2147483648I64)
71                                 fprintf(stderr,"FLAC__lpc_restore_signal: OVERFLOW, i=%u, j=%u, c=%d, d=%d, sumo=%I64d\n",i,j,qlp_coeff[j],*history,sumo);
72  #else
73 @@ -1079,7 +1079,7 @@ void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_l
74                 for(j = 0; j < order; j++)
75                         sum += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*(--history));
76                 if(FLAC__bitmath_silog2_wide(sum >> lp_quantization) > 32) {
77 -#ifdef _MSC_VER
78 +#ifdef __MSVCRT__
79                         fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, sum=%I64d\n", i, sum >> lp_quantization);
80  #else
81                         fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, sum=%lld\n", i, (long long)(sum >> lp_quantization));
82 @@ -1087,7 +1087,7 @@ void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_l
83                         break;
84                 }
85                 if(FLAC__bitmath_silog2_wide((FLAC__int64)(*r) + (sum >> lp_quantization)) > 32) {
86 -#ifdef _MSC_VER
87 +#ifdef __MSVCRT__
88                         fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, residual=%d, sum=%I64d, data=%I64d\n", i, *r, sum >> lp_quantization, (FLAC__int64)(*r) + (sum >> lp_quantization));
89  #else
90                         fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, residual=%d, sum=%lld, data=%lld\n", i, *r, (long long)(sum >> lp_quantization), (long long)((FLAC__int64)(*r) + (sum >> lp_quantization)));
91 diff --git a/src/metaflac/operations.c b/src/metaflac/operations.c
92 index 54774bf..9a5bcb7 100644
93 --- a/src/metaflac/operations.c
94 +++ b/src/metaflac/operations.c
95 @@ -565,7 +565,7 @@ void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned
96                         PPR; printf("  sample_rate: %u Hz\n", block->data.stream_info.sample_rate);
97                         PPR; printf("  channels: %u\n", block->data.stream_info.channels);
98                         PPR; printf("  bits-per-sample: %u\n", block->data.stream_info.bits_per_sample);
99 -#ifdef _MSC_VER
100 +#ifdef __MSVCRT__
101                         PPR; printf("  total samples: %I64u\n", block->data.stream_info.total_samples);
102  #else
103                         PPR; printf("  total samples: %llu\n", (unsigned long long)block->data.stream_info.total_samples);
104 @@ -596,7 +596,7 @@ void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned
105                         PPR; printf("  seek points: %u\n", block->data.seek_table.num_points);
106                         for(i = 0; i < block->data.seek_table.num_points; i++) {
107                                 if(block->data.seek_table.points[i].sample_number != FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER) {
108 -#ifdef _MSC_VER
109 +#ifdef __MSVCRT__
110                                         PPR; printf("    point %u: sample_number=%I64u, stream_offset=%I64u, frame_samples=%u\n", i, block->data.seek_table.points[i].sample_number, block->data.seek_table.points[i].stream_offset, block->data.seek_table.points[i].frame_samples);
111  #else
112                                         PPR; printf("    point %u: sample_number=%llu, stream_offset=%llu, frame_samples=%u\n", i, (unsigned long long)block->data.seek_table.points[i].sample_number, (unsigned long long)block->data.seek_table.points[i].stream_offset, block->data.seek_table.points[i].frame_samples);
113 @@ -618,7 +618,7 @@ void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned
114                         break;
115                 case FLAC__METADATA_TYPE_CUESHEET:
116                         PPR; printf("  media catalog number: %s\n", block->data.cue_sheet.media_catalog_number);
117 -#ifdef _MSC_VER
118 +#ifdef __MSVCRT__
119                         PPR; printf("  lead-in: %I64u\n", block->data.cue_sheet.lead_in);
120  #else
121                         PPR; printf("  lead-in: %llu\n", (unsigned long long)block->data.cue_sheet.lead_in);
122 @@ -630,7 +630,7 @@ void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned
123                                 const FLAC__bool is_last = (i == block->data.cue_sheet.num_tracks-1);
124                                 const FLAC__bool is_leadout = is_last && track->num_indices == 0;
125                                 PPR; printf("    track[%u]\n", i);
126 -#ifdef _MSC_VER
127 +#ifdef __MSVCRT__
128                                 PPR; printf("      offset: %I64u\n", track->offset);
129  #else
130                                 PPR; printf("      offset: %llu\n", (unsigned long long)track->offset);
131 @@ -649,7 +649,7 @@ void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned
132                                         for(j = 0; j < track->num_indices; j++) {
133                                                 const FLAC__StreamMetadata_CueSheet_Index *index = track->indices+j;
134                                                 PPR; printf("        index[%u]\n", j);
135 -#ifdef _MSC_VER
136 +#ifdef __MSVCRT__
137                                                 PPR; printf("          offset: %I64u\n", index->offset);
138  #else
139                                                 PPR; printf("          offset: %llu\n", (unsigned long long)index->offset);
140 diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c
141 index 14912c1..580ae62 100644
142 --- a/src/metaflac/operations_shorthand_cuesheet.c
143 +++ b/src/metaflac/operations_shorthand_cuesheet.c
144 @@ -160,7 +160,7 @@ FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet,
145                 for(track = 0; track < cs->num_tracks; track++) {
146                         const FLAC__StreamMetadata_CueSheet_Track *tr = cs->tracks+track;
147                         for(index = 0; index < tr->num_indices; index++) {
148 -#ifdef _MSC_VER
149 +#ifdef __MSVCRT__
150                                 sprintf(spec, "%I64u;", tr->offset + tr->indices[index].offset);
151  #else
152                                 sprintf(spec, "%llu;", (unsigned long long)(tr->offset + tr->indices[index].offset));
153 @@ -200,7 +200,7 @@ FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cueshe
154                 return false;
155         }
156  
157 -#if defined _MSC_VER || defined __MINGW32__
158 +#if defined __MSVCRT__
159         _snprintf(ref, reflen, "\"%s\" FLAC", filename);
160  #else
161         snprintf(ref, reflen, "\"%s\" FLAC", filename);
162 diff --git a/src/metaflac/operations_shorthand_streaminfo.c b/src/metaflac/operations_shorthand_streaminfo.c
163 index b4593f5..754655e 100644
164 --- a/src/metaflac/operations_shorthand_streaminfo.c
165 +++ b/src/metaflac/operations_shorthand_streaminfo.c
166 @@ -75,7 +75,7 @@ FLAC__bool do_shorthand_operation__streaminfo(const char *filename, FLAC__bool p
167                         printf("%u\n", block->data.stream_info.bits_per_sample);
168                         break;
169                 case OP__SHOW_TOTAL_SAMPLES:
170 -#ifdef _MSC_VER
171 +#ifdef __MSVCRT__
172                         printf("%I64u\n", block->data.stream_info.total_samples);
173  #else
174                         printf("%llu\n", (unsigned long long)block->data.stream_info.total_samples);
175 diff --git a/src/share/grabbag/cuesheet.c b/src/share/grabbag/cuesheet.c
176 index 03f7cda..3fc9555 100644
177 --- a/src/share/grabbag/cuesheet.c
178 +++ b/src/share/grabbag/cuesheet.c
179 @@ -200,7 +200,7 @@ static char *local__get_field_(char **s, FLAC__bool allow_quotes)
180  
181  static FLAC__bool local__cuesheet_parse_(FILE *file, const char **error_message, unsigned *last_line_read, FLAC__StreamMetadata *cuesheet, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset)
182  {
183 -#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__
184 +#if defined __MSVCRT__ || defined __EMX__
185  #define FLAC__STRCASECMP stricmp
186  #else
187  #define FLAC__STRCASECMP strcasecmp
188 @@ -593,7 +593,7 @@ void grabbag__cuesheet_emit(FILE *file, const FLAC__StreamMetadata *cuesheet, co
189                                 fprintf(file, "%02u:%02u:%02u\n", m, s, f);
190                         }
191                         else
192 -#ifdef _MSC_VER
193 +#ifdef __MSVCRT__
194                                 fprintf(file, "%I64u\n", track->offset + index->offset);
195  #else
196                                 fprintf(file, "%llu\n", (unsigned long long)(track->offset + index->offset));
197 @@ -601,7 +601,7 @@ void grabbag__cuesheet_emit(FILE *file, const FLAC__StreamMetadata *cuesheet, co
198                 }
199         }
200  
201 -#ifdef _MSC_VER
202 +#ifdef __MSVCRT__
203         fprintf(file, "REM FLAC__lead-in %I64u\n", cs->lead_in);
204         fprintf(file, "REM FLAC__lead-out %u %I64u\n", (unsigned)cs->tracks[track_num].number, cs->tracks[track_num].offset);
205  #else
206 diff --git a/src/test_libFLAC++/encoders.cpp b/src/test_libFLAC++/encoders.cpp
207 index 6b1ab69..cde7634 100644
208 --- a/src/test_libFLAC++/encoders.cpp
209 +++ b/src/test_libFLAC++/encoders.cpp
210 @@ -478,7 +478,7 @@ static bool test_stream_encoder(Layer layer, bool is_ogg)
211  
212         printf("testing get_total_samples_estimate()... ");
213         if(encoder->get_total_samples_estimate() != streaminfo_.data.stream_info.total_samples) {
214 -#ifdef _MSC_VER
215 +#ifdef __MSVCRT__
216                 printf("FAILED, expected %I64u, got %I64u\n", streaminfo_.data.stream_info.total_samples, encoder->get_total_samples_estimate());
217  #else
218                 printf("FAILED, expected %llu, got %llu\n", (unsigned long long)streaminfo_.data.stream_info.total_samples, (unsigned long long)encoder->get_total_samples_estimate());
219 diff --git a/src/test_libFLAC/encoders.c b/src/test_libFLAC/encoders.c
220 index 5927cb8..728dd18 100644
221 --- a/src/test_libFLAC/encoders.c
222 +++ b/src/test_libFLAC/encoders.c
223 @@ -449,7 +449,7 @@ static FLAC__bool test_stream_encoder(Layer layer, FLAC__bool is_ogg)
224  
225         printf("testing FLAC__stream_encoder_get_total_samples_estimate()... ");
226         if(FLAC__stream_encoder_get_total_samples_estimate(encoder) != streaminfo_.data.stream_info.total_samples) {
227 -#ifdef _MSC_VER
228 +#ifdef __MSVCRT__
229                 printf("FAILED, expected %I64u, got %I64u\n", streaminfo_.data.stream_info.total_samples, FLAC__stream_encoder_get_total_samples_estimate(encoder));
230  #else
231                 printf("FAILED, expected %llu, got %llu\n", (unsigned long long)streaminfo_.data.stream_info.total_samples, (unsigned long long)FLAC__stream_encoder_get_total_samples_estimate(encoder));
232 diff --git a/src/test_libFLAC/metadata_object.c b/src/test_libFLAC/metadata_object.c
233 index 617248f..4a0ab56 100644
234 --- a/src/test_libFLAC/metadata_object.c
235 +++ b/src/test_libFLAC/metadata_object.c
236 @@ -47,7 +47,7 @@ static FLAC__bool compare_track_(const FLAC__StreamMetadata_CueSheet_Track *from
237         unsigned i;
238  
239         if(from->offset != to->offset) {
240 -#ifdef _MSC_VER
241 +#ifdef __MSVCRT__
242                 printf("FAILED, track offset mismatch, expected %I64u, got %I64u\n", to->offset, from->offset);
243  #else
244                 printf("FAILED, track offset mismatch, expected %llu, got %llu\n", (unsigned long long)to->offset, (unsigned long long)from->offset);
245 @@ -83,7 +83,7 @@ static FLAC__bool compare_track_(const FLAC__StreamMetadata_CueSheet_Track *from
246         else {
247                 for(i = 0; i < to->num_indices; i++) {
248                         if(from->indices[i].offset != to->indices[i].offset) {
249 -#ifdef _MSC_VER
250 +#ifdef __MSVCRT__
251                                 printf("FAILED, track indices[%u].offset mismatch, expected %I64u, got %I64u\n", i, to->indices[i].offset, from->indices[i].offset);
252  #else
253                                 printf("FAILED, track indices[%u].offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)to->indices[i].offset, (unsigned long long)from->indices[i].offset);
254 @@ -109,7 +109,7 @@ static FLAC__bool compare_seekpoint_array_(const FLAC__StreamMetadata_SeekPoint
255  
256         for(i = 0; i < n; i++) {
257                 if(from[i].sample_number != to[i].sample_number) {
258 -#ifdef _MSC_VER
259 +#ifdef __MSVCRT__
260                         printf("FAILED, point[%u].sample_number mismatch, expected %I64u, got %I64u\n", i, to[i].sample_number, from[i].sample_number);
261  #else
262                         printf("FAILED, point[%u].sample_number mismatch, expected %llu, got %llu\n", i, (unsigned long long)to[i].sample_number, (unsigned long long)from[i].sample_number);
263 @@ -117,7 +117,7 @@ static FLAC__bool compare_seekpoint_array_(const FLAC__StreamMetadata_SeekPoint
264                         return false;
265                 }
266                 if(from[i].stream_offset != to[i].stream_offset) {
267 -#ifdef _MSC_VER
268 +#ifdef __MSVCRT__
269                         printf("FAILED, point[%u].stream_offset mismatch, expected %I64u, got %I64u\n", i, to[i].stream_offset, from[i].stream_offset);
270  #else
271                         printf("FAILED, point[%u].stream_offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)to[i].stream_offset, (unsigned long long)from[i].stream_offset);
272 diff --git a/src/test_libs_common/metadata_utils.c b/src/test_libs_common/metadata_utils.c
273 index fe192e7..75ad60f 100644
274 --- a/src/test_libs_common/metadata_utils.c
275 +++ b/src/test_libs_common/metadata_utils.c
276 @@ -61,7 +61,7 @@ FLAC__bool mutils__compare_block_data_streaminfo(const FLAC__StreamMetadata_Stre
277                 return false;
278         }
279         if(blockcopy->total_samples != block->total_samples) {
280 -#ifdef _MSC_VER
281 +#ifdef __MSVCRT__
282                 printf("FAILED, total_samples mismatch, expected %I64u, got %I64u\n", block->total_samples, blockcopy->total_samples);
283  #else
284                 printf("FAILED, total_samples mismatch, expected %llu, got %llu\n", (unsigned long long)block->total_samples, (unsigned long long)blockcopy->total_samples);
285 @@ -166,7 +166,7 @@ FLAC__bool mutils__compare_block_data_seektable(const FLAC__StreamMetadata_SeekT
286         }
287         for(i = 0; i < block->num_points; i++) {
288                 if(blockcopy->points[i].sample_number != block->points[i].sample_number) {
289 -#ifdef _MSC_VER
290 +#ifdef __MSVCRT__
291                         printf("FAILED, points[%u].sample_number mismatch, expected %I64u, got %I64u\n", i, block->points[i].sample_number, blockcopy->points[i].sample_number);
292  #else
293                         printf("FAILED, points[%u].sample_number mismatch, expected %llu, got %llu\n", i, (unsigned long long)block->points[i].sample_number, (unsigned long long)blockcopy->points[i].sample_number);
294 @@ -174,7 +174,7 @@ FLAC__bool mutils__compare_block_data_seektable(const FLAC__StreamMetadata_SeekT
295                         return false;
296                 }
297                 if(blockcopy->points[i].stream_offset != block->points[i].stream_offset) {
298 -#ifdef _MSC_VER
299 +#ifdef __MSVCRT__
300                         printf("FAILED, points[%u].stream_offset mismatch, expected %I64u, got %I64u\n", i, block->points[i].stream_offset, blockcopy->points[i].stream_offset);
301  #else
302                         printf("FAILED, points[%u].stream_offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)block->points[i].stream_offset, (unsigned long long)blockcopy->points[i].stream_offset);
303 @@ -240,7 +240,7 @@ FLAC__bool mutils__compare_block_data_cuesheet(const FLAC__StreamMetadata_CueShe
304                 return false;
305         }
306         if(blockcopy->lead_in != block->lead_in) {
307 -#ifdef _MSC_VER
308 +#ifdef __MSVCRT__
309                 printf("FAILED, lead_in mismatch, expected %I64u, got %I64u\n", block->lead_in, blockcopy->lead_in);
310  #else
311                 printf("FAILED, lead_in mismatch, expected %llu, got %llu\n", (unsigned long long)block->lead_in, (unsigned long long)blockcopy->lead_in);
312 @@ -257,7 +257,7 @@ FLAC__bool mutils__compare_block_data_cuesheet(const FLAC__StreamMetadata_CueShe
313         }
314         for(i = 0; i < block->num_tracks; i++) {
315                 if(blockcopy->tracks[i].offset != block->tracks[i].offset) {
316 -#ifdef _MSC_VER
317 +#ifdef __MSVCRT__
318                         printf("FAILED, tracks[%u].offset mismatch, expected %I64u, got %I64u\n", i, block->tracks[i].offset, blockcopy->tracks[i].offset);
319  #else
320                         printf("FAILED, tracks[%u].offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)block->tracks[i].offset, (unsigned long long)blockcopy->tracks[i].offset);
321 @@ -295,7 +295,7 @@ FLAC__bool mutils__compare_block_data_cuesheet(const FLAC__StreamMetadata_CueShe
322                         else {
323                                 for(j = 0; j < block->tracks[i].num_indices; j++) {
324                                         if(blockcopy->tracks[i].indices[j].offset != block->tracks[i].indices[j].offset) {
325 -#ifdef _MSC_VER
326 +#ifdef __MSVCRT__
327                                                 printf("FAILED, tracks[%u].indices[%u].offset mismatch, expected %I64u, got %I64u\n", i, j, block->tracks[i].indices[j].offset, blockcopy->tracks[i].indices[j].offset);
328  #else
329                                                 printf("FAILED, tracks[%u].indices[%u].offset mismatch, expected %llu, got %llu\n", i, j, (unsigned long long)block->tracks[i].indices[j].offset, (unsigned long long)blockcopy->tracks[i].indices[j].offset);
330 diff --git a/src/test_seeking/main.c b/src/test_seeking/main.c
331 index 11b549a..985378e 100644
332 --- a/src/test_seeking/main.c
333 +++ b/src/test_seeking/main.c
334 @@ -24,7 +24,7 @@
335  #include <stdio.h>
336  #include <stdlib.h>
337  #include <string.h>
338 -#if defined _MSC_VER || defined __MINGW32__
339 +#if defined __MSVCRT__
340  #include <time.h>
341  #else
342  #include <sys/time.h>
343 @@ -200,7 +200,7 @@ static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder
344  
345         FLAC__ASSERT(frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER); /* decoder guarantees this */
346         if (!dcd->quiet)
347 -#ifdef _MSC_VER
348 +#ifdef __MSVCRT__
349                 printf("frame@%I64u(%u)... ", frame->header.number.sample_number, frame->header.blocksize);
350  #else
351                 printf("frame@%llu(%u)... ", (unsigned long long)frame->header.number.sample_number, frame->header.blocksize);
352 @@ -309,7 +309,7 @@ static FLAC__bool seek_barrage(FLAC__bool is_ogg, const char *filename, off_t fi
353                         return die_s_("expected FLAC__STREAM_DECODER_END_OF_STREAM", decoder);
354         }
355  
356 -#ifdef _MSC_VER
357 +#ifdef __MSVCRT__
358         printf("file's total_samples is %I64u\n", decoder_client_data.total_samples);
359  #else
360         printf("file's total_samples is %llu\n", (unsigned long long)decoder_client_data.total_samples);
361 @@ -347,7 +347,7 @@ static FLAC__bool seek_barrage(FLAC__bool is_ogg, const char *filename, off_t fi
362                         pos = (FLAC__uint64)(local_rand_() % n);
363                 }
364  
365 -#ifdef _MSC_VER
366 +#ifdef __MSVCRT__
367                 printf("#%u:seek(%I64u)... ", i, pos);
368  #else
369                 printf("#%u:seek(%llu)... ", i, (unsigned long long)pos);
370 -- 
371 1.6.4.53.g3f55e
372