mirror of https://github.com/xiph/flac
Enable utf8 I/O stuff when compiling with MinGW.
This commit is contained in:
parent
b3c3e2ac4f
commit
2199d08692
|
@ -69,3 +69,4 @@ test/metaflac-test-files/out.meta
|
|||
test/metaflac.flac
|
||||
test/picture.diff
|
||||
test/picture.log
|
||||
.dirstamp
|
||||
|
|
|
@ -124,16 +124,19 @@ case "$host" in
|
|||
esac
|
||||
AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
|
||||
|
||||
os_is_windows=no
|
||||
case "$host" in
|
||||
*-*-cygwin|*mingw*|*emx*)
|
||||
# define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
|
||||
LT_NO_UNDEFINED="-no-undefined"
|
||||
os_is_windows=yes
|
||||
;;
|
||||
*)
|
||||
LT_NO_UNDEFINED=
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(LT_NO_UNDEFINED)
|
||||
AM_CONDITIONAL(OS_IS_WINDOWS, test "x$os_is_windows" = xyes)
|
||||
|
||||
case "$host" in
|
||||
*-pc-linux-gnu)
|
||||
|
|
|
@ -141,7 +141,8 @@
|
|||
# endif
|
||||
#endif /* defined _MSC_VER */
|
||||
|
||||
#ifdef FLAC__STRINGS_IN_UTF8 /* all char* strings are in UTF-8 format. Added to support Unicode files on Windows */
|
||||
#ifdef _WIN32
|
||||
/* All char* strings are in UTF-8 format. Added to support Unicode files on Windows */
|
||||
#include "share/win_utf8_io.h"
|
||||
|
||||
#define flac_printf printf_utf8
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifdef FLAC__STRINGS_IN_UTF8
|
||||
#ifdef _WIN32
|
||||
|
||||
#ifndef flac__win_utf8_io_h
|
||||
#define flac__win_utf8_io_h
|
||||
|
|
|
@ -24,8 +24,8 @@ CPPLIBS_DIRS = libFLAC++ test_libFLAC++
|
|||
endif
|
||||
|
||||
SUBDIRS = \
|
||||
libFLAC \
|
||||
share \
|
||||
libFLAC \
|
||||
flac \
|
||||
metaflac \
|
||||
monkeys_audio_utilities \
|
||||
|
|
|
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
|
|||
size_t i;
|
||||
FLAC__uint32 size;
|
||||
|
||||
#ifdef FLAC__STRINGS_IN_UTF8
|
||||
#ifdef _WIN32
|
||||
if (get_utf8_argv(&argc, &argv) != 0) {
|
||||
fprintf(stderr, "%ERROR: failed to convert command line parameters to UTF-8\n");
|
||||
return 1;
|
||||
|
|
|
@ -304,7 +304,7 @@ int main(int argc, char *argv[])
|
|||
_response(&argc, &argv);
|
||||
_wildcard(&argc, &argv);
|
||||
#endif
|
||||
#ifdef FLAC__STRINGS_IN_UTF8
|
||||
#ifdef _WIN32
|
||||
if (get_utf8_argv(&argc, &argv) != 0) {
|
||||
fprintf(stderr, "ERROR: failed to convert command line parameters to UTF-8\n");
|
||||
return 1;
|
||||
|
|
|
@ -170,7 +170,7 @@ static FLAC__bool set_vc_field(FLAC__StreamMetadata *block, const Argument_VcFie
|
|||
}
|
||||
else {
|
||||
FLAC__bool needs_free = false;
|
||||
#ifdef FLAC__STRINGS_IN_UTF8 /* everything in UTF-8 already. Must not alter */
|
||||
#ifdef _WIN32 /* everything in UTF-8 already. Must not alter */
|
||||
entry.entry = (FLAC__byte *)field->field;
|
||||
#else
|
||||
if(raw) {
|
||||
|
|
|
@ -82,7 +82,11 @@ endif
|
|||
endif
|
||||
endif
|
||||
|
||||
libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ -lm
|
||||
if OS_IS_WINDOWS
|
||||
win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la
|
||||
endif
|
||||
|
||||
libFLAC_la_LIBADD = $(win_utf8_lib) $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ -lm
|
||||
|
||||
SUBDIRS = $(ARCH_SUBDIRS) include .
|
||||
|
||||
|
@ -106,6 +110,7 @@ extra_ogg_sources = \
|
|||
ogg_helper.c \
|
||||
ogg_mapping.c
|
||||
endif
|
||||
|
||||
# see 'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' for numbering convention
|
||||
libFLAC_la_LDFLAGS = -version-info 11:0:3 $(LOCAL_EXTRA_LDFLAGS) @LT_NO_UNDEFINED@
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ int main(int argc, char *argv[])
|
|||
_response(&argc, &argv);
|
||||
_wildcard(&argc, &argv);
|
||||
#endif
|
||||
#ifdef FLAC__STRINGS_IN_UTF8
|
||||
#ifdef _WIN32
|
||||
if (get_utf8_argv(&argc, &argv) != 0) {
|
||||
fprintf(stderr, "%ERROR: failed to convert command line parameters to UTF-8\n");
|
||||
return 1;
|
||||
|
|
|
@ -245,7 +245,7 @@ FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const
|
|||
}
|
||||
else {
|
||||
FLAC__bool needs_free = false;
|
||||
#ifdef FLAC__STRINGS_IN_UTF8 /* do not convert anything or things will break */
|
||||
#ifdef _WIN32 /* do not convert anything or things will break */
|
||||
entry.entry = (FLAC__byte *)field->field;
|
||||
#else
|
||||
if(raw) {
|
||||
|
|
|
@ -45,10 +45,18 @@ noinst_LTLIBRARIES = \
|
|||
getopt/libgetopt.la \
|
||||
grabbag/libgrabbag.la \
|
||||
utf8/libutf8.la \
|
||||
win_utf8_io/libwin_utf8_io.la \
|
||||
replaygain_analysis/libreplaygain_analysis.la \
|
||||
replaygain_synthesis/libreplaygain_synthesis.la
|
||||
|
||||
|
||||
if OS_IS_WINDOWS
|
||||
win_utf8_io_libwin_utf8_io_la_SOURCES = win_utf8_io/win_utf8_io.c
|
||||
else
|
||||
win_utf8_io_libwin_utf8_io_la_SOURCES =
|
||||
endif
|
||||
|
||||
|
||||
getopt_libgetopt_la_SOURCES = getopt/getopt.c getopt/getopt1.c
|
||||
|
||||
grabbag_libgrabbag_la_SOURCES = \
|
||||
|
@ -64,8 +72,7 @@ utf8_libutf8_la_SOURCES = \
|
|||
utf8/charset.c \
|
||||
utf8/charset.h \
|
||||
utf8/iconvert.c \
|
||||
utf8/utf8.c \
|
||||
win_utf8_io/win_utf8_io.c
|
||||
utf8/utf8.c
|
||||
|
||||
replaygain_analysis_libreplaygain_analysis_la_SOURCES = replaygain_analysis/replaygain_analysis.c
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#ifdef FLAC__STRINGS_IN_UTF8
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -12,6 +11,7 @@
|
|||
#include "share/win_utf8_io.h"
|
||||
|
||||
/* convert WCHAR stored Unicode string to UTF-8. Caller is responsible for freeing memory */
|
||||
static
|
||||
char *utf8_from_wchar(const wchar_t *wstr)
|
||||
{
|
||||
char *utf8str;
|
||||
|
@ -29,6 +29,7 @@ char *utf8_from_wchar(const wchar_t *wstr)
|
|||
}
|
||||
|
||||
/* convert UTF-8 back to WCHAR. Caller is responsible for freeing memory */
|
||||
static
|
||||
wchar_t *wchar_from_utf8(const char *str)
|
||||
{
|
||||
wchar_t *widestr;
|
||||
|
@ -256,5 +257,3 @@ int rename_utf8(const char *oldname, const char *newname)
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -22,12 +22,17 @@ EXTRA_DIST = \
|
|||
AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src/libFLAC/include
|
||||
|
||||
noinst_PROGRAMS = test_libFLAC
|
||||
|
||||
if OS_IS_WINDOWS
|
||||
win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la
|
||||
endif
|
||||
|
||||
test_libFLAC_LDADD = \
|
||||
$(top_builddir)/src/share/grabbag/libgrabbag.la \
|
||||
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
|
||||
$(top_builddir)/src/test_libs_common/libtest_libs_common.la \
|
||||
$(top_builddir)/src/libFLAC/libFLAC-static.la \
|
||||
@OGG_LIBS@ \
|
||||
$(win_utf8_lib) @OGG_LIBS@ \
|
||||
-lm
|
||||
|
||||
test_libFLAC_SOURCES = \
|
||||
|
|
|
@ -24,6 +24,10 @@ noinst_PROGRAMS = test_streams
|
|||
test_streams_SOURCES = \
|
||||
main.c
|
||||
|
||||
test_streams_LDADD = $(top_builddir)/src/share/grabbag/libgrabbag.la -lm
|
||||
if OS_IS_WINDOWS
|
||||
win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la
|
||||
endif
|
||||
|
||||
test_streams_LDADD = $(win_utf8_lib) $(top_builddir)/src/share/grabbag/libgrabbag.la -lm
|
||||
|
||||
CLEANFILES = test_streams.exe
|
||||
|
|
Loading…
Reference in New Issue