EventCountTest cleanups
[folly.git] / folly / CpuId.h
index facabe18cd046504ec5f3e6caa4531690e1f855b..4a70e1464dca70a664992d421aefeeb26e257d96 100644 (file)
@@ -18,7 +18,7 @@
 #define FOLLY_CPUID_H_
 
 #include <cstdint>
-#include "folly/Portability.h"
+#include <folly/Portability.h>
 
 namespace folly {
 
@@ -30,7 +30,14 @@ namespace folly {
 class CpuId {
  public:
   CpuId() {
-#if FOLLY_X64 || defined(__i386__)
+#ifdef _MSC_VER
+    int reg[4];
+
+    __cpuid((int *)reg, 1);
+    c_ = reg[2];
+    d_ = reg[3];
+
+#elif FOLLY_X64 || defined(__i386__)
     __asm__("cpuid" : "=c"(c_), "=d"(d_) : "a"(1) : "ebx");
 #else
     // On non-Intel, none of these features exist; at least not in the same form