#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);
}
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__) */
/*