Giter Club home page Giter Club logo

Comments (2)

apolukhin avatar apolukhin commented on July 18, 2024

(2) shouldn't be needed on it's face because I'm using gcc/libstdc++

There are many people who use other runtimes and there's no known to me way to detect that. How should I warn them to avoid some runtimes or to be ready for leaks?

from stacktrace.

hainest avatar hainest commented on July 18, 2024

@apolukhin I did some exploring on this some time ago for detecting minimum versions of lib{std}c++ using _LIBCPP_GLIBC_PREREQ to detect libc++.

#include <features.h>

int main() {

// Starting with libc++-6, the glibc macro is in the libcpp namespace
#if defined _LIBCPP_GLIBC_PREREQ
# if _LIBCPP_GLIBC_PREREQ(LIBC_MAJOR, LIBC_MINOR)
    return 1;
# endif
#endif

}

It was succesful for gc/clang on Ubuntu, but I didn't ever get around to doing a more thorough anaysis. The comment on namespacing referes to https://reviews.llvm.org/D41892, so this method is not 100% accurate.

It looks like FreeBSD has been using libc++ since version 10 (https://wiki.freebsd.org/NewC%2B%2BStack) and OpenBSD appears to support both via clang (https://man.openbsd.org/intro.3). I'm assuming Mac uses libc++, as well. I know nothing about other platforms.

from stacktrace.

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.