See discussion at https://discourse.llvm.org/t/rfc-support-function-attributes-in-user-interface/76624 Demo macro: ```c++ #if !defined(__LIBC_CONST_ATTR) && defined(__cplusplus) && defined(__GNUC__) #if __has_attribute(const) #define __LIBC_CONST_ATTR [[gnu::const]] #endif #endif #if !defined(__LIBC_CONST_ATTR) && defined(__GNUC__) #if __has_attribute(const) #define __LIBC_CONST_ATTR __attribute__((const)) #endif #endif #if !defined(__LIBC_CONST_ATTR) #define __LIBC_CONST_ATTR #endif ```
12 KiB
12 KiB