libFLAC/cpu.c : Simplify OS SSE support detection.
commit6a28facd7cd70f7ad0c6bc37e3a661dbfd850b45
authorErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 28 Jul 2014 10:49:09 +0000 (28 20:49 +1000)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 28 Jul 2014 10:49:17 +0000 (28 20:49 +1000)
treee129137a446db2a2080ca7c81e8bf90cbc1ec886
parent02591f6b4b09e7c6e26bd2ae7225ff2810b227bb
libFLAC/cpu.c : Simplify OS SSE support detection.

Simplify the code that tries to detect whether OS supports SSE instructions.

a) Linux: "old" vs "new" sigaction

OBSOLETE_SIGCONTEXT_FLAVOR was disabled in Mar 2007 in commit 1ca3a445f.
According to <http://unixhelp.ed.ac.uk/CGI/man-cgi?sigaction>: "Support for
SA_SIGINFO was added in Linux 2.2" (released in Jan 1999). If noone wants to
use FLAC with Linux kernel 2.0 then it's safe to delete this code.

b) MSVC: try/catch vs. sigill_handler

TRY_CATCH_FLAVOR was enabled in Jan 2009 in commit a832ef32. According to the
comment in cpu.c, "sigill_handler flavor resulted in several crash reports on
win32". Also this sigill_handler flavor is not thread-safe.

c) MinGW: fxsave/fxrestore vs. sigill_handler

The code was added Mar 2014 in commit 99d5154f. It's better to use FXSR flavor
instead of sigill_handler flavor. The reasons are the same as for MSVC.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
src/libFLAC/cpu.c