Patch: binutils/rename.c -Werror fixes for _WIN32
Danny Smith
danny_smith_0000@yahoo.co.nz
Fri Mar 25 14:44:00 GMT 2005
The static function simple_copy() in rename.c is not used by
__MINGW32__. Nor is the preserve_dates arg of smart_rename.
This fixes -Werror failure.
Tested with i686-pc-mingw32, gcc version 4.1.0 20050321 (experimental)
Changelog
2005-03-24 Danny Smith <dannysmith@users.sourceforge.net>
* rename.c (simple_copy): Remove unneeded prototype. Guard
definition with !defined (_WIN32) || defined (__CYGWIN__).
(smart_rename): Mark preserve_dates arg as unused.
Spell __CYGWIN32__ as __CYGWIN__.
Index: rename.c
===================================================================
RCS file: /cvs/src/src/binutils/rename.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 rename.c
*** rename.c 27 Nov 2003 08:24:01 -0000 1.8
--- rename.c 25 Mar 2005 00:55:47 -0000
***************
*** 37,44 ****
#define O_BINARY 0
#endif
- static int simple_copy (const char *, const char *);
/* The number of bytes to copy at once. */
#define COPY_BUF 8192
--- 37,44 ----
#define O_BINARY 0
#endif
+ #if !defined (_WIN32) || defined (__CYGWIN__)
/* The number of bytes to copy at once. */
#define COPY_BUF 8192
*************** simple_copy (const char *from, const cha
*** 88,93 ****
--- 88,94 ----
}
return 0;
}
+ #endif /* !defined (_WIN32) || defined (__CYGWIN__) */
/* Set the times of the file DESTINATION to be the same as those in
STATBUF. */
*************** set_times (const char *destination, cons
*** 140,146 ****
Return 0 if ok, -1 if error. */
int
! smart_rename (const char *from, const char *to, int preserve_dates)
{
bfd_boolean exists;
struct stat s;
--- 141,148 ----
Return 0 if ok, -1 if error. */
int
! smart_rename (const char *from, const char *to,
! int preserve_dates ATTRIBUTE_UNUSED)
{
bfd_boolean exists;
struct stat s;
*************** smart_rename (const char *from, const ch
*** 148,154 ****
exists = lstat (to, &s) == 0;
! #if defined (_WIN32) && !defined (__CYGWIN32__)
/* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
fail instead. Also, chown is not present. */
--- 150,156 ----
exists = lstat (to, &s) == 0;
! #if defined (_WIN32) && !defined (__CYGWIN__)
/* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
fail instead. Also, chown is not present. */
*************** smart_rename (const char *from, const ch
*** 211,217 ****
set_times (to, &s);
unlink (from);
}
! #endif /* _WIN32 && !__CYGWIN32__ */
return ret;
}
--- 213,219 ----
set_times (to, &s);
unlink (from);
}
! #endif /* _WIN32 && !__CYGWIN__ */
return ret;
}
Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com
More information about the Binutils
mailing list