libpgport routines need nonstandard palloc to work on Windows.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 3 Sep 2005 15:55:00 +0000 (15:55 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 3 Sep 2005 15:55:00 +0000 (15:55 +0000)
Propagate hack that's in dirmod.c to copydir.c.

src/port/copydir.c

index 4820917cda4b9093732f57996ab7d1776075b94f..a5cd967ed70425c3f1063ceea002b69b2e5a6d3b 100644 (file)
@@ -11,7 +11,7 @@
  *     as a service.
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/port/copydir.c,v 1.13 2005/09/02 18:55:32 tgl Exp $
+ *       $PostgreSQL: pgsql/src/port/copydir.c,v 1.14 2005/09/03 15:55:00 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 #include "storage/fd.h"
 
+/*
+ *     On Windows, call non-macro versions of palloc; we can't reference
+ *     CurrentMemoryContext in this file because of DLLIMPORT conflict.
+ */
+#if defined(WIN32) || defined(__CYGWIN__)
+#undef palloc
+#undef pstrdup
+#define palloc(sz)             pgport_palloc(sz)
+#define pstrdup(str)   pgport_pstrdup(str)
+#endif
+
 
 static void copy_file(char *fromfile, char *tofile);