summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunstan2008-04-16 14:21:23 +0000
committerAndrew Dunstan2008-04-16 14:21:23 +0000
commit6ca011a8df7262e8a5f5a2538ba37fac238cbcee (patch)
treed8b990e94e5b2f62b386353c069c5aaf7b85f8d8
parent360c437ff45b9405f95627bd35688003485c6e4b (diff)
Avoid using unnecessary pgwin32_safestat in libpq.
-rw-r--r--src/include/port.h5
-rw-r--r--src/interfaces/libpq/Makefile2
-rw-r--r--src/tools/msvc/Mkvcbuild.pm1
3 files changed, 6 insertions, 2 deletions
diff --git a/src/include/port.h b/src/include/port.h
index 6b57620a87..a14c8dbbef 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -287,8 +287,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 62c6b70ea9..cdcd898675 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -19,7 +19,7 @@ NAME= pq
SO_MAJOR_VERSION= 5
SO_MINOR_VERSION= 2
-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.pm b/src/tools/msvc/Mkvcbuild.pm
index 0c1aeb3cc9..bff1ef900d 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -127,6 +127,7 @@ sub mkvcbuild
$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('secur32.lib');