Skip to content

No clear way to #undefine C definitions that are superfluous or unnecessary (such as UINT8_MAX equivalents) in apinotes #89242

@bruxisma

Description

@bruxisma

Description

Some C or C++ projects will attempt to run on various strange or bizarre platforms that are typically outside the area that Swift currently targets. In some cases these libraries define custom redefinitions of C standard library macros, such as UINT8_MAX. At present there does not seem to be a documented way to remove these entirely from accessibility in Swift via .apinote files, as they are not considered globals and there is no Macros: section for apinotes, nor are they considered Typedefs.

Reproduction

Try marking macros in a .apinote to have an Availability of nonswift

Expected behavior

That they can be removed or undefined in some capacity

Environment

Swift version 6.3.2 (swift-6.3.2-RELEASE)
Target: x86_64-unknown-windows-msvc
Build config: +assertions

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage neededThis issue needs more specific labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions