From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 4F3A93858C74; Thu, 12 Jan 2023 09:52:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F3A93858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673517177; bh=jS/m9NzgGHyQVSC2eYAXIQiThrCQtcR6PStRxN7nuns=; h=From:To:Subject:Date:From; b=vSXNAE6qsemVoPAfzS3G6Ro5VyJIUEmqX1oxvd/WvqvqIeRtGw5a5QiuVfJbttuHi QV4G7RIsiXSURTPpmfkn9wuuLkWnIr8yfzs1FP02F3Z6KC4p/qAQkLkxsmNB0l+CbM s1IRq8yIkw29uLmmbJDam4z96viM0HNObc4Rb664= 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: wincap.h: clarify NO_COPY_RO usage X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: e7d0f0eb411f952f708ed12768ad556c136030e6 X-Git-Newrev: e5880bef39fd0593bfa51a01b12485f87de4251a Message-Id: <20230112095257.4F3A93858C74@sourceware.org> Date: Thu, 12 Jan 2023 09:52:57 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3De5880bef39f= d0593bfa51a01b12485f87de4251a commit e5880bef39fd0593bfa51a01b12485f87de4251a Author: Corinna Vinschen AuthorDate: Thu Jan 12 10:51:39 2023 +0100 Commit: Corinna Vinschen CommitDate: Thu Jan 12 10:51:39 2023 +0100 Cygwin: wincap.h: clarify NO_COPY_RO usage =20 ...and drop one unnecessary usage of NO_COPY_RO. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/forkable.cc | 2 +- winsup/cygwin/local_includes/winsup.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/forkable.cc b/winsup/cygwin/forkable.cc index 350a95c3e416..fbc30ae3028f 100644 --- a/winsup/cygwin/forkable.cc +++ b/winsup/cygwin/forkable.cc @@ -313,7 +313,7 @@ struct namepart { bool create_dir; }; /* mutex name is formed along dir names */ -static namepart NO_COPY_RO const +static namepart const forkable_nameparts[] =3D { /* text textfunc mutex_from_dir create */ { L"", rootname, false, false, }, diff --git a/winsup/cygwin/local_includes/winsup.h b/winsup/cygwin/local_in= cludes/winsup.h index c54440fa808d..c9788de8f012 100644 --- a/winsup/cygwin/local_includes/winsup.h +++ b/winsup/cygwin/local_includes/winsup.h @@ -10,6 +10,12 @@ details. */ =20 #define __INSIDE_CYGWIN__ =20 +/* Use "static NO_COPY_RO" instead of "static const", if the datastructure + should be R/O, but without the "const" qualifier. Typically this is on= ly + required if the static datastructure is "const" in reality, but the Win= dows + function is defined with a R/W type as argument. Unfortunately this is + often the case. However, make sure to try "const" first, and use + "NO_COPY_RO" as seldom as possible. */ #define NO_COPY_RO __attribute__((nocommon)) __attribute__((section(".rdat= a_cygwin_nocopy"))) #define NO_COPY __attribute__((nocommon)) __attribute__((section(".data_cy= gwin_nocopy"))) #define NO_COPY_INIT __attribute__((section(".data_cygwin_nocopy")))