|
59 | 59 | #define __ptr_t void * |
60 | 60 | #define __long_double_t long double |
61 | 61 |
|
62 | | -#define __attribute_malloc__ |
63 | | -#define __attribute_pure__ |
64 | | -#define __attribute_format_strfmon__(a,b) |
65 | | -#define __flexarr [0] |
66 | | - |
67 | 62 | #ifndef __BOUNDED_POINTERS__ |
68 | 63 | # define __bounded /* nothing */ |
69 | 64 | # define __unbounded /* nothing */ |
|
89 | 84 | #define __has_builtin(x) 0 |
90 | 85 | #endif |
91 | 86 |
|
| 87 | +#if __has_attribute(__pure__) |
| 88 | +# define __attribute_pure__ __attribute__((__pure__)) |
| 89 | +#else |
| 90 | +# define __attribute_pure__ |
| 91 | +#endif |
| 92 | + |
| 93 | +#if __has_attribute(__format__) |
| 94 | +# define __attribute_format_strfmon__(a,b) \ |
| 95 | + __attribute__((__format__(__strfmon__, a, b))) |
| 96 | +#else |
| 97 | +# define __attribute_format_strfmon__(a,b) |
| 98 | +#endif |
| 99 | + |
| 100 | +#if __has_attribute(__nonnull__) |
| 101 | +# define __attribute_nonnull__(params) __attribute__((__nonnull__ params)) |
| 102 | +#else |
| 103 | +# define __attribute_nonnull__(params) |
| 104 | +#endif |
| 105 | + |
| 106 | +#if __has_attribute(__returns_nonnull__) |
| 107 | +# define __returns_nonnull __attribute__((__returns_nonnull__)) |
| 108 | +#else |
| 109 | +# define __returns_nonnull |
| 110 | +#endif |
| 111 | + |
| 112 | +#if __has_attribute (__malloc__) |
| 113 | +# define __attribute_malloc__ __attribute__ ((__malloc__)) |
| 114 | +#else |
| 115 | +# define __attribute_malloc__ |
| 116 | +#endif |
| 117 | + |
| 118 | +#if __has_attribute(__alloc_size__) |
| 119 | +# define __attribute_alloc_size__(params) __attribute__ ((__alloc_size__ params)) |
| 120 | +#else |
| 121 | +# define __attribute_alloc_size__(params) |
| 122 | +#endif |
| 123 | + |
| 124 | +#if __has_attribute (__alloc_align__) |
| 125 | +# define __attribute_alloc_align__(param) __attribute__ ((__alloc_align__ param)) |
| 126 | +#else |
| 127 | +# define __attribute_alloc_align__(param) |
| 128 | +#endif |
| 129 | + |
| 130 | +#define __flexarr [] |
| 131 | + |
92 | 132 | #if defined(__cplusplus) |
93 | 133 | #define __BEGIN_DECLS extern "C" { |
94 | 134 | #define __END_DECLS } |
|
402 | 442 | #endif |
403 | 443 |
|
404 | 444 | #define __malloc_like __malloc_like_with_free(free, 1) |
| 445 | +#define __attr_dealloc_free __malloc_like_with_free(__builtin_free, 1) |
405 | 446 |
|
406 | 447 | #ifndef __always_inline |
407 | 448 | #if __GNUC_PREREQ__(3, 1) |
|
0 commit comments