]> granicus.if.org Git - postgresql/commitdiff
Avoid using unnecessary pgwin32_safestat in libpq.
authorAndrew Dunstan <andrew@dunslane.net>
Wed, 16 Apr 2008 14:21:23 +0000 (14:21 +0000)
committerAndrew Dunstan <andrew@dunslane.net>
Wed, 16 Apr 2008 14:21:23 +0000 (14:21 +0000)
src/include/port.h
src/interfaces/libpq/Makefile
src/tools/msvc/Mkvcbuild.pm

index c818f538a3fb19ca158bad68ce0bdcaf43e1bf63..f6ccfaecba7a3fca405821277d78c5f310b7b5ae 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/port.h,v 1.116.2.3 2008/04/11 23:59:49 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.116.2.4 2008/04/16 14:21:22 adunstan Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -286,8 +286,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)
index 002ec246cc700d2934863c53a7c5fab442971430..67e868bed1eed1af80e49e9e51a4e7bb6dee8ecf 100644 (file)
@@ -5,7 +5,7 @@
 # Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
 # Portions Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.159.2.1 2008/03/05 05:39:17 tgl Exp $
+# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.159.2.2 2008/04/16 14:21:22 adunstan Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -20,7 +20,7 @@ SO_MAJOR_VERSION= 5
 SO_MINOR_VERSION= 1
 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
index 3d564f83b87749244838e3e9881e99c469cee0c0..151b591986d20998b6371ecb8189011605071df0 100644 (file)
@@ -3,7 +3,7 @@ package Mkvcbuild;
 #
 # Package that generates build files for msvc build
 #
-# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.25.2.1 2008/02/28 12:18:03 mha Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.25.2.2 2008/04/16 14:21:23 adunstan Exp $
 #
 use Carp;
 use Win32;
@@ -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');