From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 98C003858000; Mon, 7 Aug 2023 14:09:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98C003858000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1691417395; bh=+iq3Vem+ujv6AOwEvVPBkYltWbdzS3waDHIGwT/EKk0=; h=From:To:Subject:Date:From; b=S38NhkMKc9vTrj4ijyEp+S4C76eNM2SdCQPO6U09AFuno9fbOSnkPAVMeSotIKNss bUHo9H/j/BZ7A2cPQ9CaoGLJlA3g/oTz4KNUJzWkSmHC9qRV9g62r4aa7ofUvjjt4y gebwxTC1PECTZHxDpswfJ7rlS6fShFxLx7005mjw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: fix build failure due to redefinition of __restrict in sys/cdefs.h X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: e66c63be6b800ae19ff21fe2f5c12e231986acb6 X-Git-Newrev: 2e7332d6bd0219da491e899e0c3cee335ec8c9ab Message-Id: <20230807140955.98C003858000@sourceware.org> Date: Mon, 7 Aug 2023 14:09:55 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D2e7332d6bd0= 219da491e899e0c3cee335ec8c9ab commit 2e7332d6bd0219da491e899e0c3cee335ec8c9ab Author: Corinna Vinschen AuthorDate: Mon Aug 7 16:04:32 2023 +0200 Commit: Corinna Vinschen CommitDate: Mon Aug 7 16:04:32 2023 +0200 Cygwin: fix build failure due to redefinition of __restrict in sys/cdef= s.h =20 Commit 3c75fac130b5 fixed the __restrict definition in sys/cdefs.h, but uncovered a problem in the definition of lio_listio in Cygwin's aio.h. It uses the C99 extension of using the restrict keyword to define non-overlapping arrays. However, this is not allowed in C++. =20 Use the newly defined __restrict_arr from commit e66c63be6b80 ("sys/cdefs.h: introduce __restrict_arr, as in glibc") =20 Fixes: 3c75fac130b5 ("sys/cdefs.h: fix for use __restrict in C++" Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/aio.cc | 2 +- winsup/cygwin/include/aio.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/aio.cc b/winsup/cygwin/aio.cc index 1c17aa7f657f..c4b3389c46ae 100644 --- a/winsup/cygwin/aio.cc +++ b/winsup/cygwin/aio.cc @@ -905,7 +905,7 @@ aio_write (struct aiocb *aio) } =20 int -lio_listio (int mode, struct aiocb *__restrict const aiolist[__restrict], +lio_listio (int mode, struct aiocb *__restrict const aiolist[__restrict_ar= r], int nent, struct sigevent *__restrict sig) { struct aiocb *aio; diff --git a/winsup/cygwin/include/aio.h b/winsup/cygwin/include/aio.h index 523a47870c6e..7ddd17e83859 100644 --- a/winsup/cygwin/include/aio.h +++ b/winsup/cygwin/include/aio.h @@ -73,7 +73,7 @@ ssize_t aio_return (struct aiocb *); int aio_suspend (const struct aiocb *const [], int, const struct timespec *); int aio_write (struct aiocb *); -int lio_listio (int, struct aiocb *__restrict const [__restrict], int, +int lio_listio (int, struct aiocb *__restrict const [__restrict_arr],= int, struct sigevent *__restrict); =20 #ifdef __cplusplus