diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2023-01-12 10:51:39 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-01-12 10:51:39 +0100 |
commit | e5880bef39fd0593bfa51a01b12485f87de4251a (patch) | |
tree | a384b92b3d1e850d7049735815aa504b1a45ae38 | |
parent | e7d0f0eb411f952f708ed12768ad556c136030e6 (diff) | |
download | newlib-e5880bef39fd0593bfa51a01b12485f87de4251a.zip newlib-e5880bef39fd0593bfa51a01b12485f87de4251a.tar.gz newlib-e5880bef39fd0593bfa51a01b12485f87de4251a.tar.bz2 |
Cygwin: wincap.h: clarify NO_COPY_RO usage
...and drop one unnecessary usage of NO_COPY_RO.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/forkable.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/local_includes/winsup.h | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/forkable.cc b/winsup/cygwin/forkable.cc index 350a95c..fbc30ae 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[] = { /* text textfunc mutex_from_dir create */ { L"<cygroot>", rootname, false, false, }, diff --git a/winsup/cygwin/local_includes/winsup.h b/winsup/cygwin/local_includes/winsup.h index c54440f..c9788de 100644 --- a/winsup/cygwin/local_includes/winsup.h +++ b/winsup/cygwin/local_includes/winsup.h @@ -10,6 +10,12 @@ details. */ #define __INSIDE_CYGWIN__ +/* Use "static NO_COPY_RO" instead of "static const", if the datastructure + should be R/O, but without the "const" qualifier. Typically this is only + required if the static datastructure is "const" in reality, but the Windows + 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(".rdata_cygwin_nocopy"))) #define NO_COPY __attribute__((nocommon)) __attribute__((section(".data_cygwin_nocopy"))) #define NO_COPY_INIT __attribute__((section(".data_cygwin_nocopy"))) |