mingw uses __thread instead of __declspec(thread)
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h
index 288eb20..ec0f556 100644
--- a/xbyak/xbyak.h
+++ b/xbyak/xbyak.h
@@ -77,7 +77,11 @@
 	#endif
 	#include <windows.h>
 	#include <malloc.h>
-	#define XBYAK_TLS __declspec(thread)
+	#ifdef _MSC_VER
+		#define XBYAK_TLS __declspec(thread)
+	#else
+		#define XBYAK_TLS __thread
+	#endif
 #elif defined(__GNUC__)
 	#include <unistd.h>
 	#include <sys/mman.h>