aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2008-04-16 14:24:38 +0000
committerAndrew Dunstan <andrew@dunslane.net>2008-04-16 14:24:38 +0000
commit79522dfb35301eb13b2b94a9b09501a2169cdfc6 (patch)
tree281debea8238012dac0dff36750404af0afc39e7 /src
parent6faae172dffcd05412b6410a2da0266ef4a66ed1 (diff)
downloadpostgresql-79522dfb35301eb13b2b94a9b09501a2169cdfc6.tar.gz
postgresql-79522dfb35301eb13b2b94a9b09501a2169cdfc6.zip
Avoid using unnecessary pgwin32_safestat in libpq.
Diffstat (limited to 'src')
-rw-r--r--src/include/port.h7
-rw-r--r--src/interfaces/libpq/Makefile4
-rw-r--r--src/tools/msvc/mkvcbuild.pl1
3 files changed, 8 insertions, 4 deletions
diff --git a/src/include/port.h b/src/include/port.h
index 04450a5a6f8..0d7775094ef 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/port.h,v 1.106.2.5 2008/04/12 00:00:08 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.106.2.6 2008/04/16 14:24:38 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@@ -280,8 +280,11 @@ extern bool rmtree(char *path, bool rmtopdir);
*
* We must pull in sys/stat.h here so the system header definition
* goes in first, and we redefine that, and not the other way around.
+ *
+ * Some frontends don't need the size from stat, so if UNSAFE_STAT_OK
+ * is defined we don't bother with this.
*/
-#if defined(WIN32) && !defined(__CYGWIN__)
+#if defined(WIN32) && !defined(__CYGWIN__) && !defined(UNSAFE_STAT_OK)
#include <sys/stat.h>
extern int pgwin32_safestat(const char *path, struct stat *buf);
#define stat(a,b) pgwin32_safestat(a,b)
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index 538652e6bec..8d50a5d1630 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.149.2.3 2007/11/30 16:21:22 mha Exp $
+# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.149.2.4 2008/04/16 14:24:38 adunstan Exp $
#
#-------------------------------------------------------------------------
@@ -20,7 +20,7 @@ SO_MAJOR_VERSION= 5
SO_MINOR_VERSION= 0
DLTYPE= library
-override CPPFLAGS := -DFRONTEND -I$(srcdir) $(CPPFLAGS) -I$(top_builddir)/src/port
+override CPPFLAGS := -DFRONTEND -DUNSAFE_STAT_OK -I$(srcdir) $(CPPFLAGS) -I$(top_builddir)/src/port
ifneq ($(PORTNAME), win32)
override CFLAGS += $(PTHREAD_CFLAGS)
endif
diff --git a/src/tools/msvc/mkvcbuild.pl b/src/tools/msvc/mkvcbuild.pl
index 421629db525..9f4a3c11e87 100644
--- a/src/tools/msvc/mkvcbuild.pl
+++ b/src/tools/msvc/mkvcbuild.pl
@@ -79,6 +79,7 @@ if ($solution->{options}->{tcl}) {
my $libpq = $solution->AddProject('libpq','dll','interfaces','src\interfaces\libpq');
$libpq->AddDefine('FRONTEND');
+$libpq->AddDefine('UNSAFE_STAT_OK');
$libpq->AddIncludeDir('src\port');
$libpq->AddLibrary('wsock32.lib');
$libpq->AddLibrary('wldap32.lib') if ($solution->{options}->{ldap});