* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/port.h,v 1.111 2007/04/13 10:30:30 mha Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.112 2007/07/12 23:28:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#if defined(WIN32) || defined(__CYGWIN__)
/*
- * Win32 doesn't have reliable rename/unlink during concurrent access,
- * and we need special code to do symlinks.
+ * Win32 doesn't have reliable rename/unlink during concurrent access.
*/
extern int pgrename(const char *from, const char *to);
extern int pgunlink(const char *path);
#define rename(from, to) pgrename(from, to)
#define unlink(path) pgunlink(path)
+#endif /* defined(WIN32) || defined(__CYGWIN__) */
+
/*
+ * Win32 also doesn't have symlinks, but we can emulate them with
+ * junction points on newer Win32 versions.
+ *
* Cygwin has its own symlinks which work on Win95/98/ME where
- * junction points don't, so use it instead. We have no way of
+ * junction points don't, so use those instead. We have no way of
* knowing what type of system Cygwin binaries will be run on.
* Note: Some CYGWIN includes might #define WIN32.
*/
#define symlink(oldpath, newpath) pgsymlink(oldpath, newpath)
#endif
-#endif /* defined(WIN32) || defined(__CYGWIN__) */
extern void copydir(char *fromdir, char *todir, bool recurse);
* Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.47 2007/01/19 16:42:24 alvherre Exp $
+ * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.48 2007/07/12 23:28:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
}
return res;
}
+
#endif /* FRONTEND */
return 0;
}
+/* We undefined these above; now redefine for possible use below */
+#define rename(from, to) pgrename(from, to)
+#define unlink(path) pgunlink(path)
+
+#endif /* defined(WIN32) || defined(__CYGWIN__) */
+
-#ifdef WIN32 /* Cygwin has its own symlinks */
+#if defined(WIN32) && !defined(__CYGWIN__) /* Cygwin has its own symlinks */
/*
* pgsymlink support:
return 0;
}
-#endif /* WIN32 */
-#endif /* defined(WIN32) || defined(__CYGWIN__) */
-
-/* We undefined this above, so we redefine it */
-#if defined(WIN32) || defined(__CYGWIN__)
-#define unlink(path) pgunlink(path)
-#endif
+#endif /* defined(WIN32) && !defined(__CYGWIN__) */
/*