Skip to content

Commit 0476bbb

Browse files
committed
Several Cygwin fixes pointed out by Reini Urban.
1 parent f94aea9 commit 0476bbb

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/backend/utils/mmgr/mcxt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.47 2004/08/08 06:44:32 momjian Exp $
17+
* $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.48 2004/08/29 02:58:50 momjian Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -631,7 +631,7 @@ MemoryContextStrdup(MemoryContext context, const char *string)
631631
}
632632

633633

634-
#ifdef WIN32
634+
#if defined(WIN32) || defined(__CYGWIN__)
635635
/*
636636
* Memory support routines for libpgport on Win32
637637
*
@@ -649,6 +649,7 @@ pgport_palloc(Size sz)
649649
return palloc(sz);
650650
}
651651

652+
652653
char *
653654
pgport_pstrdup(const char *str)
654655
{

src/port/dirmod.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.19 2004/08/29 01:44:02 momjian Exp $
13+
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.20 2004/08/29 02:58:50 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -31,18 +31,27 @@
3131

3232
#if defined(WIN32) || defined(__CYGWIN__)
3333

34-
3534
#include "miscadmin.h"
36-
#include <winioctl.h>
3735

3836
#undef rename
3937
#undef unlink
4038

39+
#ifdef __WIN32__
40+
#include <winioctl.h>
41+
#else
42+
/* __CYGWIN__ */
43+
#include <windows.h>
44+
#include <w32api/winioctl.h>
45+
#endif
46+
4147
#ifndef FRONTEND
4248
/*
4349
* Call non-macro versions of palloc, can't reference CurrentMemoryContext
4450
* because of DLLIMPORT.
4551
*/
52+
#undef palloc
53+
#undef pstrdup
54+
#undef pfree
4655
#define palloc(sz) pgport_palloc(sz)
4756
#define pstrdup(str) pgport_pstrdup(str)
4857
#define pfree(pointer) pgport_pfree(pointer)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy