test_streams currently depends on grabbag and (on Windows) on win_utf8_io libs. It depends on win_utf8_io only because it uses flac_fopen() function. It will become to depend on libFLAC when all file functions will be moved from win_utf8_io to libFLAC. Not a big problem, but it is possible to avoid this dependency by replacing flac_fopen() with fopen(). test_streams doesn't open/create files with unicode filenames, so it won't affect its functionality. So, what's better: a) replace all flac_fopen() calls inside test_streams/main.c with fopen() b) leave it as is, so that on Windows build of test_streams will depend on libFLAC
My assumption is that the code was written to call flac_fopen() so that it is portable to every operating system, even those without fopen(). If you replace flac_fopen() with fopen(), then the tests won't compile on systems that don't have fopen(). You could simply have the following: #if defined _MSC_VER || defined __MINGW32__ #define flac_fopen fopen #endif In a header, or simply at the top of test_streams/main.c where there's already some conditional compilation. Brian On Jan 31, 2016, at 7:45 AM, lvqcl <lvqcl.mail at gmail.com> wrote:> test_streams currently depends on grabbag and (on Windows) on win_utf8_io libs. > It depends on win_utf8_io only because it uses flac_fopen() function. > > It will become to depend on libFLAC when all file functions will be moved > from win_utf8_io to libFLAC. Not a big problem, but it is possible to avoid > this dependency by replacing flac_fopen() with fopen(). > > test_streams doesn't open/create files with unicode filenames, so it won't > affect its functionality. > > So, what's better: > a) replace all flac_fopen() calls inside test_streams/main.c with fopen() > b) leave it as is, so that on Windows build of test_streams will depend on libFLAC
Brian Willoughby <brianw at audiobanshee.com> ?????(?) ? ????? ?????? Sun, 31 Jan 2016 22:26:40 +0300:> My assumption is that the code was written to call flac_fopen() so that it is portable to every operating system, even those without fopen(). If you replace flac_fopen() with fopen(), then the tests won't compile on systems that don't have fopen().I REALLY doubt it. Even if such systems exist, there's little reason to support test_streams on them. fopen() was changed to flac_fopen() here: https://git.xiph.org/?p=flac.git;a=commitdiff;h=5705b4d7b2c3c5311138e9f4b66658c51f3cc22b#patch64 as a part of "Huge Windows utf8 I/O patch from Janne Hyv?rinen".> You could simply have the following: > > #if defined _MSC_VER || defined __MINGW32__ > #define flac_fopen fopen > #endif > > In a header, or simply at the top of test_streams/main.c where there's already some conditional compilation.Currently flac_fopen is already defined as fopen on non-MS systems. So it's simpler to change flac_fopen back to fopen in this file.
lvqcl wrote:> a) replace all flac_fopen() calls inside test_streams/main.c with > fopen()fopen() is part of the original ISO C spec from the 1980s. I don't think we support anything wouldn't have a working fopen(). Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/