Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd8f75d4

Browse files
committed
Fix Win32/Cygwin problems:
After updating to the latest cvs, and also building most of the addons(like PLs), the following patch is neededf for win32 + Visual C++.* Switch to use the new win32 semaphore code* Rename win32_open to pgwin32_open. win32_open collides with symbolsdefined in Perl. MingW didn't detect ig, MSVC did. And it's a bit toogeneric a name to export globally, imho...* Python defines some partially broken #pragmas in the headers whendoing a debug build. Workaround.Magnus Hagander
1 parentac7a126 commitd8f75d4

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

‎src/include/pg_config.h.win32

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,14 +628,17 @@
628628
/* #undef USE_SSL */
629629

630630
/* Define to select SysV-style semaphores. */
631-
#define USE_SYSV_SEMAPHORES1
631+
/* #undef USE_SYSV_SEMAPHORES*/
632632

633633
/* Define to select SysV-style shared memory. */
634634
#define USE_SYSV_SHARED_MEMORY 1
635635

636636
/* Define to select unnamed POSIX semaphores. */
637637
/* #undef USE_UNNAMED_POSIX_SEMAPHORES */
638638

639+
/* Define to select Win32-style semaphores. */
640+
#define USE_WIN32_SEMAPHORES
641+
639642
/* Number of bits in a file offset, on hosts where this is settable. */
640643
/* #undef _FILE_OFFSET_BITS */
641644

‎src/include/port.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.92 2006/06/07 22:24:45 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.93 2006/06/25 00:18:24 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -246,10 +246,10 @@ extern bool rmtree(char *path, bool rmtopdir);
246246

247247
/* open() replacement to allow delete of held files and passing
248248
* of special options. */
249-
externintwin32_open(constchar*,int,...);
249+
externintpgwin32_open(constchar*,int,...);
250250

251251
#ifndefFRONTEND
252-
#defineopen(a,b,c)win32_open(a,b,c)
252+
#defineopen(a,b,c)pgwin32_open(a,b,c)
253253
#endif
254254

255255
#definepopen(a,b) _popen(a,b)

‎src/pl/plpython/plpython.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
/**********************************************************************
22
* plpython.c - python as a procedural language for PostgreSQL
33
*
4-
*$PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.82 2006/06/1618:42:23 tgl Exp $
4+
*$PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.83 2006/06/25 00:18:24 momjian Exp $
55
*
66
*********************************************************************
77
*/
88

9+
#if defined(_MSC_VER)&& defined(_DEBUG)
10+
/* Python uses #pragma to bring in a non-default libpython on VC++ if
11+
* _DEBUG is defined */
12+
#undef _DEBUG
913
#include<Python.h>
14+
#define_DEBUG
15+
#else
16+
#include<Python.h>
17+
#endif
1018
#include"postgres.h"
1119

1220
/* system stuff */

‎src/port/open.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
88
*
9-
* $PostgreSQL: pgsql/src/port/open.c,v 1.12 2006/03/05 15:59:10 momjian Exp $
9+
* $PostgreSQL: pgsql/src/port/open.c,v 1.13 2006/06/25 00:18:24 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -19,7 +19,7 @@
1919
#include<fcntl.h>
2020
#include<assert.h>
2121

22-
intwin32_open(constchar*fileName,intfileFlags,...);
22+
intpgwin32_open(constchar*fileName,intfileFlags,...);
2323

2424
staticint
2525
openFlagsToCreateFileFlags(intopenFlags)
@@ -54,7 +54,7 @@ openFlagsToCreateFileFlags(int openFlags)
5454
* - handle other flags? (eg FILE_FLAG_NO_BUFFERING/FILE_FLAG_WRITE_THROUGH)
5555
*/
5656
int
57-
win32_open(constchar*fileName,intfileFlags,...)
57+
pgwin32_open(constchar*fileName,intfileFlags,...)
5858
{
5959
intfd;
6060
HANDLEh;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp