Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ce53791

Browse files
committed
Assorted portability fixes for Borland C, from Pavel Golub.
1 parent 85128e5 commit ce53791

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

src/include/libpq/libpq-be.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.69 2009/01/01 17:23:59 momjian Exp $
14+
* $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.70 2009/04/19 22:37:13 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -47,6 +47,9 @@
4747

4848
#ifdef ENABLE_SSPI
4949
#define SECURITY_WIN32
50+
#if defined(WIN32) && !defined(WIN32_ONLY_COMPILER)
51+
#include <ntsecapi.h>
52+
#endif
5053
#include <security.h>
5154
#undef SECURITY_WIN32
5255

src/include/port/win32.h

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.86 2009/01/21 10:30:02 mha Exp $ */
1+
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.87 2009/04/19 22:37:13 tgl Exp $ */
22

33
#if defined(_MSC_VER) || defined(__BORLANDC__)
44
#define WIN32_ONLY_COMPILER
@@ -297,7 +297,7 @@ extern void pgwin32_unsetenv(const char *);
297297
#define putenv(x) pgwin32_putenv(x)
298298
#define unsetenv(x) pgwin32_unsetenv(x)
299299

300-
/* Things that exist in MingW headers, but need to be added to MSVC */
300+
/* Things that exist in MingW headers, but need to be added to MSVC & BCC */
301301
#ifdef WIN32_ONLY_COMPILER
302302
typedef long ssize_t;
303303
#ifndef __BORLANDC__
@@ -335,4 +335,22 @@ typedef unsigned short mode_t;
335335
/* Pulled from Makefile.port in mingw */
336336
#define DLSUFFIX ".dll"
337337

338+
#ifdef __BORLANDC__
339+
340+
/* for port/dirent.c */
341+
#ifndef INVALID_FILE_ATTRIBUTES
342+
#define INVALID_FILE_ATTRIBUTES ((DWORD) -1)
343+
#endif
344+
345+
/* for port/open.c */
346+
#ifndef O_RANDOM
347+
#define O_RANDOM 0x0010 /* File access is primarily random */
348+
#define O_SEQUENTIAL 0x0020 /* File access is primarily sequential */
349+
#define O_TEMPORARY 0x0040 /* Temporary file bit */
350+
#define O_SHORT_LIVED 0x1000 /* Temporary storage file, try not to flush */
351+
#define _O_SHORT_LIVED O_SHORT_LIVED
352+
#endif /* ifndef O_RANDOM */
353+
354+
#endif /* __BORLANDC__ */
355+
338356
#endif

src/interfaces/libpq/bcc32.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ OUTFILENAME=blibpq
6262
USERDEFINES=FRONTEND;NDEBUG;WIN32;_WINDOWS
6363

6464
CPP=bcc32.exe
65-
CPP_PROJ = -I$(BCB)\include;..\..\include;..\..\include\port\win32;..\..\include\port\win32_msvc;..\..\port -n"$(INTDIR)" -WD -c -D$(USERDEFINES) -tWM \
65+
CPP_PROJ = -I..\..\include\port\win32_msvc;$(BCB)\include;..\..\include;..\..\include\port\win32;..\..\port -n"$(INTDIR)" -WD -c -D$(USERDEFINES) -tWM \
6666
-a8 -X -w-use -w-par -w-pia -w-csu -w-aus -w-ccc
6767

6868
!IFDEF DEBUG

src/interfaces/libpq/libpq-int.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.139 2009/01/01 17:24:03 momjian Exp $
15+
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.140 2009/04/19 22:37:13 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -55,6 +55,9 @@
5555

5656
#ifdef ENABLE_SSPI
5757
#define SECURITY_WIN32
58+
#if defined(WIN32) && !defined(WIN32_ONLY_COMPILER)
59+
#include <ntsecapi.h>
60+
#endif
5861
#include <security.h>
5962
#undef SECURITY_WIN32
6063

0 commit comments

Comments
 (0)