diff options
author | Ken Brown <kbrown@cornell.edu> | 2019-07-19 21:14:33 +0300 |
---|---|---|
committer | Ken Brown <kbrown@cornell.edu> | 2019-07-19 21:14:33 +0300 |
commit | 6b7723a83032bd355d3c529d957fe209cb35b4d9 (patch) | |
tree | 8cf58dc6bfcc3b761e29d6262f45afc269061e82 /winsup/cygwin/uname.cc | |
parent | 3a956a9bc3275f9052c5d97d4955f10341b1277c (diff) |
Cygwin: unbreak the build with GCC 7
The recent port to GCC 8 used the 'nonstring' attribute, which is
unknown to GCC 7. Define and use an 'ATTRIBUTE_NONSTRING' macro
instead.
Diffstat (limited to 'winsup/cygwin/uname.cc')
-rw-r--r-- | winsup/cygwin/uname.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/uname.cc b/winsup/cygwin/uname.cc index e323335b4..350216681 100644 --- a/winsup/cygwin/uname.cc +++ b/winsup/cygwin/uname.cc @@ -17,6 +17,12 @@ details. */ extern "C" int cygwin_gethostname (char *__name, size_t __len); extern "C" int getdomainname (char *__name, size_t __len); +#if __GNUC__ >= 8 +#define ATTRIBUTE_NONSTRING __attribute__ ((nonstring)) +#else +#define ATTRIBUTE_NONSTRING +#endif + /* uname: POSIX 4.4.1.1 */ /* New entrypoint for applications since API 335 */ @@ -25,7 +31,7 @@ uname_x (struct utsname *name) { __try { - char buf[NI_MAXHOST + 1] __attribute__ ((nonstring)); + char buf[NI_MAXHOST + 1] ATTRIBUTE_NONSTRING; char *snp = strstr (cygwin_version.dll_build_date, "SNP"); memset (name, 0, sizeof (*name)); |