From c3347de3bf269cbf3580fac3500e386482405b54 Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 26 Jun 2015 23:23:08 -0400 Subject: [PATCH] attempted fix for cpu_id issues on ubuntu --- src/cpuid.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cpuid.cpp b/src/cpuid.cpp index 9e1719a08..ee97b9ecc 100644 --- a/src/cpuid.cpp +++ b/src/cpuid.cpp @@ -40,6 +40,10 @@ POSSIBILITY OF SUCH DAMAGE. #include #endif +#if TORRENT_HAS_SSE && defined __GNUC__ +#include +#endif + namespace libtorrent { namespace aux { namespace { @@ -51,9 +55,7 @@ namespace libtorrent { namespace aux __cpuid((int*)info, type); #elif TORRENT_HAS_SSE && defined __GNUC__ - asm volatile - ("cpuid" : "=a" (info[0]), "=b" (info[1]), "=c" (info[2]), "=d" (info[3]) - : "a" (type), "c" (0)); + __get_cpuid(type, &info[0], &info[1], &info[2], &info[3]); #else // for non-x86 and non-amd64, just return zeroes std::memset(&info[0], 0, sizeof(unsigned int) * 4);