under Win32. Also fix other compile issues.
# Win32 can't to rename or unlink on an open file
case $host_os in mingw*)
LIBOBJS="$LIBOBJS dirmod.$ac_objext"
-LIBOBJS="$LIBOBJS copydir.$ac_objext" ;;
+LIBOBJS="$LIBOBJS copydir.$ac_objext"
+LIBOBJS="$LIBOBJS gettimeofday.$ac_objext" ;;
esac
if test "$with_readline" = yes; then
dnl Process this file with autoconf to produce a configure script.
-dnl $Header: /cvsroot/pgsql/configure.in,v 1.251 2003/05/15 17:59:17 momjian Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.252 2003/05/16 01:57:51 momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
# Win32 can't to rename or unlink on an open file
case $host_os in mingw*)
AC_LIBOBJ(dirmod)
-AC_LIBOBJ(copydir) ;;
+AC_LIBOBJ(copydir)
+AC_LIBOBJ(gettimeofday) ;;
esac
if test "$with_readline" = yes; then
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: c.h,v 1.146 2003/05/15 23:39:27 tgl Exp $
+ * $Id: c.h,v 1.147 2003/05/16 01:57:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "pg_config.h"
#include "pg_config_manual.h" /* must be after pg_config.h */
+#ifndef WIN32
#include "pg_config_os.h" /* must be before any system header files */
+#endif
#include "postgres_ext.h"
#include <stdio.h>
#include <SupportDefs.h>
#endif
+#ifdef WIN32
+/* We have to redefine some system functions after they are included above */
+#include "pg_config_os.h"
+#endif
+
/* Must be before gettext() games below */
#include <locale.h>
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: port.h,v 1.1 2003/05/15 16:35:29 momjian Exp $
+ * $Id: port.h,v 1.2 2003/05/16 01:57:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
off_t ftello(FILE *stream);
#endif
+#ifdef WIN32
/*
* Win32 doesn't have reliable rename/unlink during concurrent access
*/
-#if defined(WIN32) && !defined(FRONTEND)
+#ifndef FRONTEND
int pgrename(const char *from, const char *to);
int pgunlink(const char *path);
#define rename(from, to) pgrename(from, to)
#define unlink(path) pgunlink(path)
#endif
+extern int copydir(char *fromdir,char *todir);
+extern int gettimeofday(struct timeval *tp, struct timezone *tzp);
+
+#else
+
/*
* Win32 requires a special close for sockets and pipes, while on Unix
* close() does them all.
*/
-#ifndef WIN32
#define closesocket close
#endif
* When necessary, these routines are provided by files in src/port/.
*/
#ifndef HAVE_CRYPT
-char *crypt(const char *key, const char *setting);
+extern char *crypt(const char *key, const char *setting);
#endif
#ifndef HAVE_FSEEKO
#ifndef HAVE_SRANDOM
extern void srandom(unsigned int seed);
#endif
-
#include "postgres.h"
+#undef mkdir /* no reason to use that macro because we ignore the 2nd arg */
+
+#include "dirent.h"
+
+
int
copydir(char *fromdir,char *todir)
{