public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin/main] Cygwin: fix build failure due to redefinition of __restrict in sys/cdefs.h
Date: Mon,  7 Aug 2023 14:09:55 +0000 (GMT)	[thread overview]
Message-ID: <20230807140955.98C003858000@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2e7332d6bd0219da491e899e0c3cee335ec8c9ab

commit 2e7332d6bd0219da491e899e0c3cee335ec8c9ab
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Mon Aug 7 16:04:32 2023 +0200
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Mon Aug 7 16:04:32 2023 +0200

    Cygwin: fix build failure due to redefinition of __restrict in sys/cdefs.h
    
    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++.
    
    Use the newly defined __restrict_arr from commit e66c63be6b80
    ("sys/cdefs.h: introduce __restrict_arr, as in glibc")
    
    Fixes: 3c75fac130b5 ("sys/cdefs.h: fix for use __restrict in C++"
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

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)
 }
 
 int
-lio_listio (int mode, struct aiocb *__restrict const aiolist[__restrict],
+lio_listio (int mode, struct aiocb *__restrict const aiolist[__restrict_arr],
             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);
 
 #ifdef __cplusplus

                 reply	other threads:[~2023-08-07 14:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230807140955.98C003858000@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).