Add file include/share/compat.h and start moving CPP hackery into it.

This commit is contained in:
Erik de Castro Lopo
2012-02-04 16:13:37 +11:00
parent 494919106a
commit 59afe36f71
19 changed files with 85 additions and 128 deletions

View File

@@ -46,19 +46,10 @@
#include <stdlib.h> /* for malloc() */
#include <string.h> /* for memcpy() */
#include <sys/types.h> /* for off_t */
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
#if _MSC_VER <= 1600 || defined __BORLANDC__ /* @@@ [2G limit] */
#ifndef fseeko
#define fseeko fseek
#endif
#ifndef ftello
#define ftello ftell
#endif
#endif
#endif
#include "FLAC/assert.h"
#include "FLAC/stream_decoder.h"
#include "share/alloc.h"
#include "share/compat.h"
#include "protected/stream_encoder.h"
#include "private/bitwriter.h"
#include "private/bitmath.h"
@@ -100,7 +91,7 @@
* parameter estimation in this encoder is very good, almost always
* yielding compression within 0.1% of the optimal parameters.
*/
#undef ENABLE_RICE_PARAMETER_SEARCH
#undef ENABLE_RICE_PARAMETER_SEARCH
typedef struct {
@@ -236,7 +227,7 @@ static unsigned evaluate_lpc_subframe_(
#endif
static unsigned evaluate_verbatim_subframe_(
FLAC__StreamEncoder *encoder,
FLAC__StreamEncoder *encoder,
const FLAC__int32 signal[],
unsigned blocksize,
unsigned subframe_bps,
@@ -824,7 +815,7 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_(
metadata_picture_has_type1 = true;
/* standard icon must be 32x32 pixel PNG */
if(
m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD &&
m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD &&
(
(strcmp(m->data.picture.mime_type, "image/png") && strcmp(m->data.picture.mime_type, "-->")) ||
m->data.picture.width != 32 ||
@@ -1173,7 +1164,7 @@ FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_stream(
/*is_ogg=*/true
);
}
static FLAC__StreamEncoderInitStatus init_FILE_internal_(
FLAC__StreamEncoder *encoder,
FILE *file,
@@ -1235,7 +1226,7 @@ static FLAC__StreamEncoderInitStatus init_FILE_internal_(
return init_status;
}
FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE(
FLAC__StreamEncoder *encoder,
FILE *file,
@@ -1245,7 +1236,7 @@ FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE(
{
return init_FILE_internal_(encoder, file, progress_callback, client_data, /*is_ogg=*/false);
}
FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_FILE(
FLAC__StreamEncoder *encoder,
FILE *file,