bpa wrote: 
> My own preference would be to use strtod_l and then make sure it only
> uses the "C" locale - using strtod with different untested locales may
> still have surprises.
> 
> Windows Flac.exe was built with VS so I'm trying to setup it up so I can
> rebuild flac with extra message to be sure it is behaving OK on Windows
> - but MS makes setting up VS2019 for simple command line C applications
> painful. I have an old system with VS2015 setup for socketwrapper which
> is the fallback.

I've drafted up a second version of a patch, which uses the -strtod_l-
approach as you suggest. This is should be resilient to any unexpected
'locale' decimal separator definitions that may emerge in the future.
(Are there any that use anything other than a singleton '.' or ',' at
present ?).

Platform set up is rather more complicated, and I see this as a
drawback, because complexity breed errors.

I've tested it on macOS and on a linux box, and it seems to work as
expected. But I've no idea about the other platforms, or older versions
of libc, etc. You'll see that I've dealt with Windows MSC in what I
think is an appropriate manner, but I haven't been able to test it.

The tests I use are:

Code:
--------------------
    
  LANG=pt_BR.UTF-8 ./flac -c --compression-level-0 --skip=2:36.08 
--until=7:29.28 -- flactest.wav >test1.flac
  LANG=pt_BR.UTF-8 ./flac -c --compression-level-0 --skip=2:36,08 
--until=7:29,28 -- flactest.wav >test2.flac
  LANG=en_GB.UTF-8 ./flac -c --compression-level-0 --skip=2:36.08 
--until=7:29.28 -- flactest.wav >test3.flac
  LANG=en_GB.UTF-8 ./flac -c --compression-level-0 --skip=2:36,08 
--until=7:29,28 -- flactest.wav >test4.flac
  
--------------------

The first three tests should succeed and the fourth should fail, because
en_GB doesn't understand ',' as a decimal separator.


+-------------------------------------------------------------------+
|Filename: 02-flac-skip-method2_draft2.patch                        |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=28039|
+-------------------------------------------------------------------+

------------------------------------------------------------------------
mrw's Profile: http://forums.slimdevices.com/member.php?userid=38299
View this thread: http://forums.slimdevices.com/showthread.php?t=110871

_______________________________________________
Squeezecenter mailing list
Squeezecenter@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/squeezecenter

Reply via email to