From cd5e39ef5066d8b11d5c5c5dd0023efdd94631f1 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Mon, 30 Apr 2001 10:40:50 +0000 Subject: Bart 14144: fix compilation problem on current Cygwin 1.3.1 (macros were changed to external variables and cannot be used to initialize static array). Modified by me __CYGWIN -> __CYGWIN__ --- Src/Modules/stat.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'Src') diff --git a/Src/Modules/stat.c b/Src/Modules/stat.c index d0f80829c..053d0ace0 100644 --- a/Src/Modules/stat.c +++ b/Src/Modules/stat.c @@ -54,13 +54,33 @@ statmodeprint(mode_t mode, char *outbuf, int flags) } if (flags & STF_STRING) { static const char *modes = "?rwxrwxrwx"; - static const mode_t mflags[] = { S_IRUSR, S_IWUSR, S_IXUSR, - S_IRGRP, S_IWGRP, S_IXGRP, - S_IROTH, S_IWOTH, S_IXOTH }; + static const mode_t mflags[9] = { +#ifdef __CYGWIN__ + 0 +#else + S_IRUSR, S_IWUSR, S_IXUSR, + S_IRGRP, S_IWGRP, S_IXGRP, + S_IROTH, S_IWOTH, S_IXOTH +#endif + }; const mode_t *mfp = mflags; char pm[11]; int i; +#ifdef __CYGWIN__ + if (mflags[0] == 0) { + mflags[0] = S_IRUSR; + mflags[1] = S_IWUSR; + mflags[2] = S_IXUSR; + mflags[3] = S_IRGRP; + mflags[4] = S_IWGRP; + mflags[5] = S_IXGRP; + mflags[6] = S_IROTH; + mflags[7] = S_IWOTH; + mflags[8] = S_IXOTH; + } +#endif + if (S_ISBLK(mode)) *pm = 'b'; else if (S_ISCHR(mode)) -- cgit 1.4.1