If we are not to use 64 bit file size (and time),
#undef stat may be sufficient. The #undef should be
before the prototype of pgwin32_safestat because the
#define stat _stat64 affect both the function and struct stat.
The #undef stat necessitate #undef fstat as the parameter
struct stat * is changed.
Additional change are for the macro redefinition warnings.
(Suppress warnings, but perhaps not very different)
The patch is tested to compile on
x86_64-w64-mingw32-gcc 4.7.0 20111203 (experimental)
gcc version 4.6.1 on MingW/MSYS
@@ -334,6 +334,12 @@ extern bool rmtree(const char *path, bool rmtopdir);
#if defined(WIN32) && !defined(__CYGWIN__) && !defined(UNSAFE_STAT_OK)
extern int pgwin32_safestat(const char *path, struct stat * buf);
#define stat(a,b) pgwin32_safestat(a,b)
If this is not sufficient, we might need to change all call of stat, lstat, and fstat
to some wrapper functions? : It's theoretically doable, but could be quite difficult
for a huge software.
In response to
pgsql-hackers by date
|Next:||From: Ross Reedstrom||Date: 2011-12-05 15:29:53|
|Subject: Re: Command Triggers|
|Previous:||From: Merlin Moncure||Date: 2011-12-05 14:01:52|
|Subject: Re: planner fails on HEAD|