Re: [PATCHES] libpq build problem with <io.h>

Andreas Pflug <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32,gmane.comp.db.postgresql.devel.patches
Message-ID <[email protected]>
Bruce,

I posted the attached patch 4 days ago, with the comment
"The attached patch will redefine unlink and rename only if FRONTEND is 
not defined.".

I still believe this a good way to fix it.

Tom Lane wrote:
> 
> 
> To put that in a more positive light: we like to think that our code is
> Posix-compliant and runs in a Posix-compliant environment.  We're not
> thrilled about introducing non-Posix-isms for the convenience of one
> platform ... especially if there's no easy way to enforce that the
> nonstandard coding convention be used.
> 
> Back on track: if rename() does exist under Windows then my idea is
> unreliable.  Any other thoughts?  How about #including <io.h> in port.h
> (for Windows only of course) before we #define these things?

Probably won't work, because pgrename and rename do not have the same 
definition/linkage.

Regards,
Andreas


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match
port.h.diff (text/x-patch, 567 B)
Index: port.h
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/include/port.h,v
retrieving revision 1.52
diff -u -r1.52 port.h
--- port.h	12 Aug 2004 18:32:43 -0000	1.52
+++ port.h	13 Aug 2004 15:58:19 -0000
@@ -141,7 +141,7 @@
 
 extern int pclose_check(FILE *stream);
 
-#if defined(WIN32) || defined(__CYGWIN__)
+#if (defined(WIN32) || defined(__CYGWIN__)) && !defined(FRONTEND)
 /*
  *	Win32 doesn't have reliable rename/unlink during concurrent access,
  *	and we need special code to do symlinks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.