[PATCH] libc/sys/cygwin and some Cygwin specifc tweaks
Doug Evans
dje@transmeta.com
Mon May 12 14:59:00 GMT 2003
Corinna Vinschen writes:
> * libc/locale/ldpart.c (__part_load_locale): Use 64 bit stat call
> if __CYGWIN_USE_BIG_TYPES__ is set.
Note on style: IMO it shouldn't be done this way.
"cygwin" shouldn't appear in non-cygwin directories.
The way to do this is define a generic "have feature x" macro,
use that in the generic directories, and have cygwin define that macro.
i.e. throughout your patch replace __CYGWIN_USE_BIG_TYPES__
with something more generic and then have the cygwin port define that
macro. I hesitate to suggest __USE_BIG_TYPES__ because that seems
a bit ambiguous (big types for what?).
> Index: libc/locale/ldpart.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/locale/ldpart.c,v
> retrieving revision 1.1
> diff -p -u -r1.1 ldpart.c
> --- libc/locale/ldpart.c 23 Aug 2002 01:56:03 -0000 1.1
> +++ libc/locale/ldpart.c 12 May 2003 10:52:26 -0000
> @@ -98,7 +98,11 @@ __part_load_locale(const char *name,
> fd = open(filename, O_RDONLY);
> if (fd < 0)
> goto no_locale;
> +#ifdef __CYGWIN_USE_BIG_TYPES__
> + if (fstat64(fd, &st) != 0)
> +#else
> if (fstat(fd, &st) != 0)
> +#endif
> goto bad_locale;
> if (st.st_size <= 0)
> goto bad_locale;
More information about the Newlib
mailing list