mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
Move code inside #ifdef _MSC_VER to compat.h.
This commit is contained in:
@@ -74,3 +74,33 @@
|
|||||||
#else
|
#else
|
||||||
#define FLAC__U64L(x) x##LLU
|
#define FLAC__U64L(x) x##LLU
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
||||||
|
#define FLAC__STRNCASECMP strnicmp
|
||||||
|
#else
|
||||||
|
#define FLAC__STRNCASECMP strncasecmp
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined _MSC_VER || defined __MINGW32__
|
||||||
|
#include <io.h> /* for _setmode() */
|
||||||
|
#include <fcntl.h> /* for _O_BINARY */
|
||||||
|
#endif
|
||||||
|
#if defined __CYGWIN__ || defined __EMX__
|
||||||
|
#include <io.h> /* for setmode(), O_BINARY */
|
||||||
|
#include <fcntl.h> /* for _O_BINARY */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
||||||
|
#if defined __BORLANDC__
|
||||||
|
#include <utime.h> /* for utime() */
|
||||||
|
#else
|
||||||
|
#include <sys/utime.h> /* for utime() */
|
||||||
|
#endif
|
||||||
|
#include <io.h> /* for chmod() */
|
||||||
|
#include <sys/types.h> /* for off_t */
|
||||||
|
#else
|
||||||
|
#include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */
|
||||||
|
#include <utime.h> /* for utime() */
|
||||||
|
#include <unistd.h> /* for chown(), unlink() */
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -38,19 +38,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
|
||||||
#if defined __BORLANDC__
|
|
||||||
#include <utime.h> /* for utime() */
|
|
||||||
#else
|
|
||||||
#include <sys/utime.h> /* for utime() */
|
|
||||||
#endif
|
|
||||||
#include <io.h> /* for chmod() */
|
|
||||||
#include <sys/types.h> /* for off_t */
|
|
||||||
#else
|
|
||||||
#include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */
|
|
||||||
#include <utime.h> /* for utime() */
|
|
||||||
#include <unistd.h> /* for chown(), unlink() */
|
|
||||||
#endif
|
|
||||||
#include <sys/stat.h> /* for stat(), maybe chmod() */
|
#include <sys/stat.h> /* for stat(), maybe chmod() */
|
||||||
|
|
||||||
#include "private/metadata.h"
|
#include "private/metadata.h"
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
#include "FLAC/assert.h"
|
#include "FLAC/assert.h"
|
||||||
#include "share/alloc.h"
|
#include "share/alloc.h"
|
||||||
|
#include "share/compat.h"
|
||||||
|
|
||||||
/* Alias the first (in share/alloc.h) to the second (in src/libFLAC/memory.c). */
|
/* Alias the first (in share/alloc.h) to the second (in src/libFLAC/memory.c). */
|
||||||
#define safe_malloc_mul_2op_ safe_malloc_mul_2op_p
|
#define safe_malloc_mul_2op_ safe_malloc_mul_2op_p
|
||||||
@@ -1379,13 +1380,7 @@ FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_matches(const FLAC
|
|||||||
FLAC__ASSERT(0 != entry.entry && entry.length > 0);
|
FLAC__ASSERT(0 != entry.entry && entry.length > 0);
|
||||||
{
|
{
|
||||||
const FLAC__byte *eq = (FLAC__byte*)memchr(entry.entry, '=', entry.length);
|
const FLAC__byte *eq = (FLAC__byte*)memchr(entry.entry, '=', entry.length);
|
||||||
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
|
||||||
#define FLAC__STRNCASECMP strnicmp
|
|
||||||
#else
|
|
||||||
#define FLAC__STRNCASECMP strncasecmp
|
|
||||||
#endif
|
|
||||||
return (0 != eq && (unsigned)(eq-entry.entry) == field_name_length && 0 == FLAC__STRNCASECMP(field_name, (const char *)entry.entry, field_name_length));
|
return (0 != eq && (unsigned)(eq-entry.entry) == field_name_length && 0 == FLAC__STRNCASECMP(field_name, (const char *)entry.entry, field_name_length));
|
||||||
#undef FLAC__STRNCASECMP
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,6 @@
|
|||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined _MSC_VER || defined __MINGW32__
|
|
||||||
#include <io.h> /* for _setmode() */
|
|
||||||
#include <fcntl.h> /* for _O_BINARY */
|
|
||||||
#endif
|
|
||||||
#if defined __CYGWIN__ || defined __EMX__
|
|
||||||
#include <io.h> /* for setmode(), O_BINARY */
|
|
||||||
#include <fcntl.h> /* for _O_BINARY */
|
|
||||||
#endif
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h> /* for malloc() */
|
#include <stdlib.h> /* for malloc() */
|
||||||
#include <string.h> /* for memset/memcpy() */
|
#include <string.h> /* for memset/memcpy() */
|
||||||
@@ -63,13 +55,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* technically this should be in an "export.c" but this is convenient enough */
|
/* technically this should be in an "export.c" but this is convenient enough */
|
||||||
FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC =
|
FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC = FLAC__HAS_OGG ;
|
||||||
#if FLAC__HAS_OGG
|
|
||||||
1
|
|
||||||
#else
|
|
||||||
0
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|||||||
@@ -33,14 +33,6 @@
|
|||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined _MSC_VER || defined __MINGW32__
|
|
||||||
#include <io.h> /* for _setmode() */
|
|
||||||
#include <fcntl.h> /* for _O_BINARY */
|
|
||||||
#endif
|
|
||||||
#if defined __CYGWIN__ || defined __EMX__
|
|
||||||
#include <io.h> /* for setmode(), O_BINARY */
|
|
||||||
#include <fcntl.h> /* for _O_BINARY */
|
|
||||||
#endif
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h> /* for malloc() */
|
#include <stdlib.h> /* for malloc() */
|
||||||
|
|||||||
Reference in New Issue
Block a user