Skip to content

[libcxx] std::get_new_handler is not declared when building for VC runtime #158731

@FatihBAKIR

Description

@FatihBAKIR

new_handler.h for libc++ is currently implemented as the following when building for the VC runtime, and not declaring any other symbol, where the new.h resolves to ucrt/new.h in the Windows SDK.

#if defined(_LIBCPP_ABI_VCRUNTIME)
#  include <new.h>
#else

However, new.h does not declare std::get_new_handler, and builds of programs using std::get_new_handler fail. I run into this when building mimalloc for instance.

Is this a known issue? Adding the declaration to new_handler.h fixes the build problems and all mimalloc tests pass. Are there any concerns with such a fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions