Skip to content

[libc] casting macro for user headers #127238

Closed
@nickdesaulniers

Description

@nickdesaulniers

@enh-google saw our endian.h and mentioned __BIONIC_CAST.
https://android.googlesource.com/platform/bionic/+/main/libc/include/sys/cdefs.h#57

#if defined(__cplusplus)
#define __BIONIC_CAST(_k,_t,_v) (_k<_t>(_v))
#else
#define __BIONIC_CAST(_k,_t,_v) ((_t) (_v))
#endif

maybe interesting to add that to libc/include/__llvm-libc-common.h and use more in our user facing headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions