diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c
index 43592ad..3c7a84b 100644
--- a/src/libFLAC/cpu.c
+++ b/src/libFLAC/cpu.c
@@ -142,7 +142,7 @@ static const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXTMMX = 0x00400000;
 #  define USE_TRY_CATCH_FLAVOR /* sigill_handler flavor resulted in several crash reports on win32 */
 #  ifdef USE_TRY_CATCH_FLAVOR
 #  else
-	LONG CALLBACK sigill_handler_sse_os(EXCEPTION_POINTERS *ep)
+	LONG WINAPI sigill_handler_sse_os(EXCEPTION_POINTERS *ep)
 	{
 		if(ep->ExceptionRecord->ExceptionCode == EXCEPTION_ILLEGAL_INSTRUCTION) {
 			ep->ContextRecord->Eip += 3 + 3 + 6;
@@ -151,6 +151,17 @@ static const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXTMMX = 0x00400000;
 		return EXCEPTION_CONTINUE_SEARCH;
 	}
 #  endif
+# elif defined(_WIN32)
+#  include <windows.h>
+	LONG WINAPI sigill_handler_sse_os(EXCEPTION_POINTERS *ep); /* to suppress GCC warning */
+	LONG WINAPI sigill_handler_sse_os(EXCEPTION_POINTERS *ep)
+	{
+		if(ep->ExceptionRecord->ExceptionCode == EXCEPTION_ILLEGAL_INSTRUCTION) {
+			ep->ContextRecord->Eip += 3 + 3 + 6;
+			return EXCEPTION_CONTINUE_EXECUTION;
+		}
+		return EXCEPTION_CONTINUE_SEARCH;
+	}
 # endif
 #endif
 
@@ -312,26 +323,47 @@ void FLAC__cpu_info(FLAC__CPUInfo *info)
 			int sse = 0;
 			LPTOP_LEVEL_EXCEPTION_FILTER save = SetUnhandledExceptionFilter(sigill_handler_sse_os);
 			/* see GCC version above for explanation */
-			/*  http://msdn2.microsoft.com/en-us/library/4ks26t93.aspx */
-			/*  http://www.codeproject.com/cpp/gccasm.asp */
-			/*  http://www.hick.org/~mmiller/msvc_inline_asm.html */
+			/*  http://msdn.microsoft.com/en-us/library/4ks26t93.aspx */
+			/*  http://www.codeproject.com/Articles/5267/Inline-Assembly-in-GCC-Vs-VC */
 			__asm {
 				xorps xmm0,xmm0
-				inc sse
-				nop
-				nop
-				nop
-				nop
+				inc dword ptr [sse]
+				nop /* SIGILL jump lands here if "inc" is 9 bytes */
 				nop
 				nop
+				nop /* SIGILL jump lands here if "inc" is 6 bytes */
 				nop
 				nop
+				nop /* SIGILL jump lands here if "inc" is 3 bytes */
 				nop
+				nop /* SIGILL jump lands here if "inc" is 1 byte  */
 			}
 			SetUnhandledExceptionFilter(save);
 			if(!sse)
 				info->ia32.fxsr = info->ia32.sse = info->ia32.sse2 = info->ia32.sse3 = info->ia32.ssse3 = info->ia32.sse41 = info->ia32.sse42 = false;
 # endif
+#elif defined(_WIN32) && defined(__GNUC__)
+			int sse = 0;
+			LPTOP_LEVEL_EXCEPTION_FILTER save = SetUnhandledExceptionFilter(sigill_handler_sse_os);
+			/* see above for explanation */
+			asm volatile (
+				"xorps %%xmm0,%%xmm0\n\t"
+				"incl %0\n\t"
+				"nop\n\t" /* SIGILL jump lands here if "inc" is 9 bytes */
+				"nop\n\t"
+				"nop\n\t"
+				"nop\n\t" /* SIGILL jump lands here if "inc" is 6 bytes */
+				"nop\n\t"
+				"nop\n\t"
+				"nop\n\t" /* SIGILL jump lands here if "inc" is 3 bytes */
+				"nop\n\t"
+				"nop"     /* SIGILL jump lands here if "inc" is 1 byte  */
+				: "=m"(sse)
+				: "m"(sse)
+			);
+			SetUnhandledExceptionFilter(save);
+			if(sse != 1)
+				info->ia32.fxsr = info->ia32.sse = info->ia32.sse2 = info->ia32.sse3 = info->ia32.ssse3 = info->ia32.sse41 = info->ia32.sse42 = false;
 #else
 			/* no way to test, disable to be safe */
 			info->ia32.fxsr = info->ia32.sse = info->ia32.sse2 = info->ia32.sse3 = info->ia32.ssse3 = info->ia32.sse41 = info->ia32.sse42 = false;
