X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FBits.cpp;h=7571078efbdd0bf4812d96539b9b060a894add76;hb=a3bd593ad9374cd3a1db31066874b9bad1cf74b4;hp=76ceb0fa0fe5d16a08b7e9f33bd0378005c38bd0;hpb=681e46770a9045f8c9c98ae13d3f6205f2be6c85;p=folly.git diff --git a/folly/Bits.cpp b/folly/Bits.cpp index 76ceb0fa..7571078e 100644 --- a/folly/Bits.cpp +++ b/folly/Bits.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013 Facebook, Inc. + * Copyright 2016 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,14 @@ * limitations under the License. */ -#include "folly/Bits.h" +#include -#include "folly/CpuId.h" -#include "folly/Portability.h" +#include +#include // None of this is necessary if we're compiling for a target that supports -// popcnt -#ifndef __POPCNT__ - +// popcnt, which includes MSVC +#if !defined(__POPCNT__) && !defined(_MSC_VER) namespace { int popcount_builtin(unsigned int x) { @@ -74,7 +73,7 @@ namespace detail { // or popcount_builtin int popcount(unsigned int x) #if FOLLY_HAVE_IFUNC && !defined(FOLLY_SANITIZE_ADDRESS) - __attribute__((ifunc("folly_popcount_ifunc"))); + __attribute__((__ifunc__("folly_popcount_ifunc"))); #else { return popcount_builtin(x); } #endif @@ -83,7 +82,7 @@ int popcount(unsigned int x) // or popcountll_builtin int popcountll(unsigned long long x) #if FOLLY_HAVE_IFUNC && !defined(FOLLY_SANITIZE_ADDRESS) - __attribute__((ifunc("folly_popcountll_ifunc"))); + __attribute__((__ifunc__("folly_popcountll_ifunc"))); #else { return popcountll_builtin(x); } #endif