Giter Club home page Giter Club logo

Comments (4)

thagberg avatar thagberg commented on May 30, 2024

I had this issue with MSVC and was able to solve it with this in misc/platform.h:

#if defined(_MSC_VER) && !defined(__clang__)
#if !defined(_MSVC_LANG) || _MSVC_LANG < 201703L
__forceinline uint32_t __builtin_clz(uint32_t x) {
    unsigned long r = 0;
    _BitScanReverse(&r, x);
    return uint32_t(31 - r);
}
#endif
#endif

__builtin_clz appears to be defined for C++17 in MSVC, so this prevents it from being redefined.

from dascript.

AlvaroBarua avatar AlvaroBarua commented on May 30, 2024

Hi, sorry to comment on a closed issue, but I just changed my project from c++14 to c++17 for a test and I am getting '__builtin_clz' not found.
I am using VS2019 Community Edition.

I had to revert the changes made here so that it compiles. Not sure what to make of it to be honest, but from what I tested, __builtin_clz is nowhere to be found in MSVC17 or MSVC20.

from dascript.

thagberg avatar thagberg commented on May 30, 2024

After a VS update I started seeing the same thing, but I've been unable to find anything in release notes to pin down what changed.

from dascript.

AlvaroBarua avatar AlvaroBarua commented on May 30, 2024

I guess that it could have been a fluke in MSVC at the time or something with the use case at the time you tested.
Just to make sure, I tried on an empty project and still the same result.
It might be good to revert this change and see if anyone gets an error in the future.

from dascript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.