6
6
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
9
- * $PostgreSQL: pgsql/src/include/port.h,v 1.119 2008/04/10 16:58:51 mha Exp $
9
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.120 2008/04/11 23:53:00 tgl Exp $
10
10
*
11
11
*-------------------------------------------------------------------------
12
12
*/
@@ -281,9 +281,23 @@ extern void copydir(char *fromdir, char *todir, bool recurse);
281
281
282
282
extern bool rmtree (char * path , bool rmtopdir );
283
283
284
+ /*
285
+ * stat() is not guaranteed to set the st_size field on win32, so we
286
+ * redefine it to our own implementation that is.
287
+ *
288
+ * We must pull in sys/stat.h here so the system header definition
289
+ * goes in first, and we redefine that, and not the other way around.
290
+ */
291
+ #if defined(WIN32 ) && !defined(__CYGWIN__ )
292
+ #include <sys/stat.h>
293
+ extern int pgwin32_safestat (const char * path , struct stat * buf );
294
+ #define stat (a ,b ) pgwin32_safestat(a,b)
295
+ #endif
296
+
284
297
#if defined(WIN32 ) && !defined(__CYGWIN__ )
285
298
286
- /* open() and fopen() replacements to allow deletion of open files and
299
+ /*
300
+ * open() and fopen() replacements to allow deletion of open files and
287
301
* passing of other special options.
288
302
*/
289
303
#define O_DIRECT 0x80000000
@@ -298,19 +312,6 @@ extern FILE *pgwin32_fopen(const char *, const char *);
298
312
#define popen (a ,b ) _popen(a,b)
299
313
#define pclose (a ) _pclose(a)
300
314
301
- /*
302
- * stat() is not guaranteed to set the st_size field on win32, so we
303
- * redefine it to our own implementation that is.
304
- *
305
- * We must pull in sys/stat.h here so the system header definition
306
- * goes in first, and we redefine that, and not the other way around.
307
- */
308
- extern int pgwin32_safestat (const char * path , struct stat * buf );
309
- #if !defined(FRONTEND ) && !defined(_DIRMOD_C )
310
- #include <sys/stat.h>
311
- #define stat (a ,b ) pgwin32_safestat(a,b)
312
- #endif
313
-
314
315
/* Missing rand functions */
315
316
extern long lrand48 (void );
316
317
extern void srand48 (long seed );
0 commit comments