Fix alloc_align and alloc_size macros for multiple arguments

https://sourceware.org/ml/newlib/2018/msg00263.html

This is a follow-up to commit 4564b30f33.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
This commit is contained in:
Yaakov Selkowitz 2018-03-14 10:17:51 -05:00
parent 134f93f313
commit e494b56035
2 changed files with 4 additions and 4 deletions

View File

@ -324,8 +324,8 @@ extern long double strtold (const char *__restrict, char **__restrict);
* If we're in a mode greater than C99, expose C11 functions. * If we're in a mode greater than C99, expose C11 functions.
*/ */
#if __ISO_C_VISIBLE >= 2011 #if __ISO_C_VISIBLE >= 2011
void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1) void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align((1))
__alloc_size(2); __alloc_size((2));
int at_quick_exit(void (*)(void)); int at_quick_exit(void (*)(void));
_Noreturn void _Noreturn void
quick_exit(int); quick_exit(int);

View File

@ -258,12 +258,12 @@
#define __section(x) __attribute__((__section__(x))) #define __section(x) __attribute__((__section__(x)))
#endif #endif
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__) #if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__)
#define __alloc_size(x) __attribute__((__alloc_size__(x))) #define __alloc_size(x) __attribute__((__alloc_size__ x))
#else #else
#define __alloc_size(x) #define __alloc_size(x)
#endif #endif
#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__) #if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__)
#define __alloc_align(x) __attribute__((__alloc_align__(x))) #define __alloc_align(x) __attribute__((__alloc_align__ x))
#else #else
#define __alloc_align(x) #define __alloc_align(x)
#endif #endif