/
niceSOFT
/
shadow
Обзор
Документация
Войти
/
niceSOFT
/
shadow
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/attr.h
62 строки
1 KB
a1batross
lib/attr.h: exclude MCST LCC compiler from ATTR_MALLOC
23 мар 2026, 00:44
23 мар 2026, 00:44
7758d18
Код
Авторство
О чём код?
#ifndef SHADOW_INCLUDE_LIB_ATTR_H_ #define SHADOW_INCLUDE_LIB_ATTR_H_ #include "config.h" #if !defined(__has_c_attribute) # define __has_c_attribute(x) 0 #endif #if __has_c_attribute(maybe_unused) # define MAYBE_UNUSED [[maybe_unused]] #else # define MAYBE_UNUSED #endif #if __has_c_attribute(noreturn) # define NORETURN [[noreturn]] #else # define NORETURN #endif #if __has_c_attribute(gnu::format) # define format_attr(type, fmt, va) [[gnu::format(type, fmt, va)]] #else # define format_attr(type, fmt, va) #endif #if __has_c_attribute(gnu::access) # define ATTR_ACCESS(...) [[gnu::access(__VA_ARGS__)]] #else # define ATTR_ACCESS(...) #endif #if __has_c_attribute(gnu::alloc_size) # define ATTR_ALLOC_SIZE(...) [[gnu::alloc_size(__VA_ARGS__)]] #else # define ATTR_ALLOC_SIZE(...) #endif #if (__GNUC__ >= 11) && !defined(__clang__) && !defined(__MCST__) # define ATTR_MALLOC(deallocator) [[gnu::malloc(deallocator)]] #else # define ATTR_MALLOC(deallocator) #endif #if __has_c_attribute(gnu::null_terminated_string_arg) # define ATTR_STRING(i) [[gnu::null_terminated_string_arg(i)]] #else # define ATTR_STRING(i) #endif #if __has_c_attribute(gnu::nonstring) # define ATTR_NONSTRING [[gnu::nonstring]] #else # define ATTR_NONSTRING #endif #endif // include guard