Commit a832ef32 authored by Josh Coalson's avatar Josh Coalson
Browse files

fixes for windows builds (SF#1676822:...

fixes for windows builds (SF#1676822: https://sourceforge.net/tracker2/?func=detail&aid=1676822&group_id=13478&atid=113478)
parent f3a8e5ca
......@@ -48,9 +48,9 @@ all default: $(DEFAULT_BUILD)
VERSION=\"1.2.1\"
ifeq ($(OS),Darwin)
CONFIG_CFLAGS=-DHAVE_INTTYPES_H -DHAVE_ICONV -DHAVE_LANGINFO_CODESET -DFLAC__HAS_OGG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFLAC__SYS_DARWIN -DWORDS_BIGENDIAN
CONFIG_CFLAGS=-DHAVE_STDINT_H -DHAVE_ICONV -DHAVE_LANGINFO_CODESET -DFLAC__HAS_OGG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFLAC__SYS_DARWIN -DWORDS_BIGENDIAN
else
CONFIG_CFLAGS=-DHAVE_INTTYPES_H -DHAVE_ICONV -DHAVE_LANGINFO_CODESET -DHAVE_SOCKLEN_T -DFLAC__HAS_OGG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
CONFIG_CFLAGS=-DHAVE_STDINT_H -DHAVE_ICONV -DHAVE_LANGINFO_CODESET -DHAVE_SOCKLEN_T -DFLAC__HAS_OGG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
endif
OGG_INCLUDE_DIR=$(HOME)/local/include
......
......@@ -102,7 +102,8 @@
<li>
build system:
<ul>
<li>Fix #includes for gcc 4.3 (<a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1834168&group_id=13478&atid=313478">SF #1834168</a>).</li>
<li>Fix #includes for gcc 4.3 (<a href="https://sourceforge.net/tracker2/?func=detail&aid=1834168&group_id=13478&atid=113478">SF #1834168</a>).</li>
<li>Fixes for windows builds (<a href="https://sourceforge.net/tracker2/?func=detail&aid=1676822&group_id=13478&atid=113478">SF #1676822</a>).</li>
</ul>
</li>
<li>
......
......@@ -524,12 +524,6 @@ int do_it(void)
flac__utils_printf(stderr, 1, "ERROR: filename too long: %s", option_values.filenames[i]);
return 1;
}
if(0 == strcmp(option_values.filenames[i], "-")) {
FLAC__ASSERT(0);
/* double protection */
flac__utils_printf(stderr, 1, "internal error\n");
return 2;
}
if(0 != (error = grabbag__replaygain_store_to_file_album(outfilename, album_gain, album_peak, option_values.preserve_modtime))) {
flac__utils_printf(stderr, 1, "%s: ERROR writing ReplayGain album tags (%s)\n", outfilename, error);
retval = 1;
......@@ -1834,7 +1828,7 @@ int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_
}
}
if(/*@@@@@@why no stdin?*/encode_infile == stdin || option_values.force_to_stdout) {
if(option_values.force_to_stdout) {
if(option_values.replay_gain) {
conditional_fclose(encode_infile);
return usage_error("ERROR: --replay-gain cannot be used when encoding to stdout\n");
......
......@@ -152,6 +152,11 @@ void flac__utils_printf(FILE *stream, int level, const char *format, ...)
(void) vfprintf(stream, format, args);
va_end(args);
#ifdef _MSC_VER
if(stream == stderr)
fflush(stream); /* for some reason stderr is buffered in at least some if not all MSC libs */
#endif
}
}
......
......@@ -36,13 +36,16 @@
#include <stdlib.h> /* for malloc() */
#include <string.h> /* for memcpy(), memset() */
#ifdef _MSC_VER
#include <winsock.h> /* for ntohl() */
# include <winsock.h> /* for ntohl() */
# if _MSC_VER >= 1310
# include <winsock2.h> /* for ntohl(), sometimes it is not in winsock.h */
# endif
#elif defined FLAC__SYS_DARWIN
#include <machine/endian.h> /* for ntohl() */
# include <machine/endian.h> /* for ntohl() */
#elif defined __MINGW32__
#include <winsock.h> /* for ntohl() */
# include <winsock.h> /* for ntohl() */
#else
#include <netinet/in.h> /* for ntohl() */
# include <netinet/in.h> /* for ntohl() */
#endif
#include "private/bitmath.h"
#include "private/bitreader.h"
......
......@@ -36,13 +36,16 @@
#include <stdlib.h> /* for malloc() */
#include <string.h> /* for memcpy(), memset() */
#ifdef _MSC_VER
#include <winsock.h> /* for ntohl() */
# include <winsock.h> /* for ntohl() */
# if _MSC_VER >= 1310
# include <winsock2.h> /* for ntohl(), sometimes it is not in winsock.h */
# endif
#elif defined FLAC__SYS_DARWIN
#include <machine/endian.h> /* for ntohl() */
# include <machine/endian.h> /* for ntohl() */
#elif defined __MINGW32__
#include <winsock.h> /* for ntohl() */
# include <winsock.h> /* for ntohl() */
#else
#include <netinet/in.h> /* for ntohl() */
# include <netinet/in.h> /* for ntohl() */
#endif
#if 0 /* UNUSED */
#include "private/bitmath.h"
......
......@@ -136,7 +136,7 @@ static const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXTMMX = 0x00400000;
# endif
# elif defined(_MSC_VER)
# include <windows.h>
# undef USE_TRY_CATCH_FLAVOR /* #define this to use the try/catch method for catching illegal opcode exception */
# define USE_TRY_CATCH_FLAVOR /* sigill_handler flavor resulted in several crash reports on win32 */
# ifdef USE_TRY_CATCH_FLAVOR
# else
LONG CALLBACK sigill_handler_sse_os(EXCEPTION_POINTERS *ep)
......
......@@ -2155,6 +2155,8 @@ void set_defaults_(FLAC__StreamEncoder *encoder)
#if FLAC__HAS_OGG
FLAC__ogg_encoder_aspect_set_defaults(&encoder->protected_->ogg_encoder_aspect);
#endif
FLAC__stream_encoder_set_compression_level(encoder, 5);
}
void free_(FLAC__StreamEncoder *encoder)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment