X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstat.c;h=f888130d26339d141f3bc1372658bfc336c70e83;hb=23eecb48e39afd0d267d64d40ba6bf97aa865e13;hp=1397aa93290a0210734366edbae83b3a1ca41d22;hpb=a9298c67d0c2d9cc35f5ed4bfc260bcd3cbed9ee;p=gnulib.git diff --git a/lib/stat.c b/lib/stat.c index 1397aa932..f888130d2 100644 --- a/lib/stat.c +++ b/lib/stat.c @@ -1,5 +1,5 @@ /* Work around platform bugs in stat. - Copyright (C) 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,7 +27,22 @@ #include #undef __need_system_sys_stat_h -static inline int +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if _GL_WINDOWS_64_BIT_ST_SIZE +# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */ +# define stat _stati64 +# define REPLACE_FUNC_STAT_DIR 1 +# undef REPLACE_FUNC_STAT_FILE +# elif REPLACE_FUNC_STAT_FILE +/* mingw64 has a broken stat() function, based on _stat(), in libmingwex.a. + Bypass it. */ +# define stat _stat +# define REPLACE_FUNC_STAT_DIR 1 +# undef REPLACE_FUNC_STAT_FILE +# endif +#endif + +static int orig_stat (const char *filename, struct stat *buf) { return stat (filename, buf);