Merge default into minor

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2016-10-30 01:07:39 -03:00
13 changed files with 144 additions and 15 deletions
+11 -5
View File
@@ -712,12 +712,18 @@ static int stbi__sse2_available()
static int stbi__sse2_available()
{
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later
// GCC 4.8+ has a nice way to do this
return __builtin_cpu_supports("sse2");
#if defined(STBI__X64_TARGET)
// on x64, SSE2 can be assumed to be available.
return 1;
#elif defined(LOVE_STBI_SSE2_OVERRIDE)
return 1;
#else
// portable way to do this, preferably without using GCC inline ASM?
// just bail for now.
# warning "stb_image compiled without SSE2 support, define LOVE_STBI_SSE2_OVERRIDE to force SSE2 support"
// __builtin_cpu_supports is buggy on GCC 5 and above, causing problems if
// referenced in a shared object, giving missing __cpu_model hidden symbol errors.
// To get around that, just assume that SSE2 is not available on x86.
//
// See https://github.com/nothings/stb/issues/280 for more information.
return 0;
#endif
}