From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75034 invoked by alias); 30 Jul 2018 08:52:18 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 74943 invoked by uid 10080); 30 Jul 2018 08:52:17 -0000 Date: Mon, 30 Jul 2018 08:52:00 -0000 Message-ID: <20180730085217.74939.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] FreeBSD compat. __alloc_size(), __alloc_align() X-Act-Checkin: newlib-cygwin X-Git-Author: Sebastian Huber X-Git-Refname: refs/heads/master X-Git-Oldrev: 271e856a49731edb88427f4a7aeb388825e366c3 X-Git-Newrev: a31a7bad6a26bd64ef017e95d6ee0e994b6ca87b X-SW-Source: 2018-q3/txt/msg00029.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a31a7bad6a26bd64ef017e95d6ee0e994b6ca87b commit a31a7bad6a26bd64ef017e95d6ee0e994b6ca87b Author: Sebastian Huber Date: Thu Jul 26 10:36:06 2018 +0200 FreeBSD compat. __alloc_size(), __alloc_align() Restore FreeBSD compatibility for __alloc_size() and __alloc_align(). This is a follow-up to commit e494b560350cabef94126a4478096aae89ae35a0. Signed-off-by: Sebastian Huber Diff: --- newlib/libc/include/stdlib.h | 6 +++--- newlib/libc/include/sys/cdefs.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h index 564ce8a..a805736 100644 --- a/newlib/libc/include/stdlib.h +++ b/newlib/libc/include/stdlib.h @@ -140,7 +140,7 @@ void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t _compar); int rand (void); void * realloc (void *__r, size_t __size) _NOTHROW; #if __BSD_VISIBLE -void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size((2,3)); +void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size2(2, 3); void * reallocf (void *__r, size_t __size); #endif #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 @@ -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 __ISO_C_VISIBLE >= 2011 -void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align((1)) - __alloc_size((2)); +void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1) + __alloc_size(2); int at_quick_exit(void (*)(void)); _Noreturn void quick_exit(int); diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h index 7c2aa3b..ccb47ea 100644 --- a/newlib/libc/include/sys/cdefs.h +++ b/newlib/libc/include/sys/cdefs.h @@ -249,14 +249,14 @@ #define __section(x) __attribute__((__section__(x))) #endif #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))) #define __alloc_size2(n, x) __attribute__((__alloc_size__(n, x))) #else #define __alloc_size(x) #define __alloc_size2(n, x) #endif #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 #define __alloc_align(x) #endif