Skip to content

Commit a5ec2ec

Browse files
committed
Allow Borland CC to compile libpq and psql.
Backpatch to 8.2.X. L Bayuk
1 parent 945d0b4 commit a5ec2ec

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

src/include/port/win32.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.64 2007/01/02 21:25:50 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.65 2007/01/11 02:42:31 momjian Exp $ */
22

33
#if defined(_MSC_VER) || defined(__BORLANDC__)
44
#define WIN32_ONLY_COMPILER
@@ -17,7 +17,9 @@
1717
#include <signal.h>
1818
#include <errno.h>
1919
#include <direct.h>
20+
#ifndef __BORLANDC__
2021
#include <sys/utime.h> /* for non-unicode version */
22+
#endif
2123
#undef near
2224

2325
/* Must be here to avoid conflicting with prototype in windows.h */
@@ -149,8 +151,10 @@ int semop(int semId, struct sembuf * sops, int flag);
149151
#define SIGTTIN 21
150152
#define SIGTTOU 22 /* Same as SIGABRT -- no problem, I hope */
151153
#define SIGWINCH 28
154+
#ifndef __BORLANDC__
152155
#define SIGUSR1 30
153156
#define SIGUSR2 31
157+
#endif
154158

155159
struct timezone
156160
{
@@ -259,8 +263,10 @@ extern void _dosmaperr(unsigned long);
259263

260264
/* Things that exist in MingW headers, but need to be added to MSVC */
261265
#ifdef WIN32_ONLY_COMPILER
266+
#ifndef __BORLANDC__
262267
typedef long ssize_t;
263268
typedef unsigned short mode_t;
269+
#endif
264270

265271
/*
266272
* Certain "standard edition" versions of MSVC throw a warning
@@ -271,6 +277,7 @@ typedef unsigned short mode_t;
271277
#define inline __inline
272278
#define __inline__ __inline
273279

280+
#ifndef __BORLANDC__
274281
#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
275282
#define _S_IXUSR _S_IEXEC
276283
#define _S_IWUSR _S_IWRITE
@@ -280,6 +287,7 @@ typedef unsigned short mode_t;
280287
#define S_IXUSR _S_IXUSR
281288
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
282289
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
290+
#endif
283291

284292
#define F_OK 0
285293
#define W_OK 2

src/interfaces/libpq/bcc32.mak

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ ALL : config "$(OUTDIR)" "$(OUTDIR)\blibpq.dll" "$(OUTDIR)\blibpq.lib"
7676
CLEAN :
7777
-@erase "$(INTDIR)\getaddrinfo.obj"
7878
-@erase "$(INTDIR)\pgstrcasecmp.obj"
79-
-@erase "$(INTDIR)\strlcpy.obj"
8079
-@erase "$(INTDIR)\thread.obj"
8180
-@erase "$(INTDIR)\inet_aton.obj"
8281
-@erase "$(INTDIR)\crypt.obj"
@@ -99,6 +98,8 @@ CLEAN :
9998
-@erase "$(INTDIR)\wchar.obj"
10099
-@erase "$(INTDIR)\encnames.obj"
101100
-@erase "$(INTDIR)\pthread-win32.obj"
101+
-@erase "$(INTDIR)\snprintf.obj"
102+
-@erase "$(INTDIR)\strlcpy.obj"
102103
-@erase "$(OUTDIR)\$(OUTFILENAME).lib"
103104
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
104105
-@erase "$(OUTDIR)\libpq.res"
@@ -113,7 +114,6 @@ LIB32_OBJS= \
113114
"$(INTDIR)\win32.obj" \
114115
"$(INTDIR)\getaddrinfo.obj" \
115116
"$(INTDIR)\pgstrcasecmp.obj" \
116-
"$(INTDIR)\strlcpy.obj" \
117117
"$(INTDIR)\thread.obj" \
118118
"$(INTDIR)\inet_aton.obj" \
119119
"$(INTDIR)\crypt.obj" \
@@ -133,6 +133,8 @@ LIB32_OBJS= \
133133
"$(INTDIR)\pqsignal.obj" \
134134
"$(INTDIR)\wchar.obj" \
135135
"$(INTDIR)\encnames.obj" \
136+
"$(INTDIR)\snprintf.obj" \
137+
"$(INTDIR)\strlcpy.obj" \
136138
"$(INTDIR)\pthread-win32.obj"
137139

138140

@@ -162,7 +164,7 @@ LINK32_OBJS= "$(INTDIR)\libpqdll.obj"
162164
$(LINK32_FLAGS) +
163165
c0d32.obj $(LINK32_OBJS), +
164166
$@,, +
165-
"$(OUTDIR)\blibpq.lib" import32.lib cw32mti.lib, +
167+
"$(OUTDIR)\blibpq.lib" import32.lib cw32mt.lib, +
166168
blibpqdll.def,"$(INTDIR)\libpq.res"
167169
<<
168170
implib -w "$(OUTDIR)\blibpqdll.lib" blibpqdll.def $@
@@ -187,11 +189,6 @@ LINK32_OBJS= "$(INTDIR)\libpqdll.obj"
187189
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
188190
<<
189191

190-
"$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c
191-
$(CPP) @<<
192-
$(CPP_PROJ) ..\..\port\strlcpy.c
193-
<<
194-
195192
"$(INTDIR)\thread.obj" : ..\..\port\thread.c
196193
$(CPP) @<<
197194
$(CPP_PROJ) ..\..\port\thread.c
@@ -233,5 +230,16 @@ LINK32_OBJS= "$(INTDIR)\libpqdll.obj"
233230
$(CPP_PROJ) /I"." ..\..\backend\utils\mb\encnames.c
234231
<<
235232

233+
"$(INTDIR)\snprintf.obj" : ..\..\port\snprintf.c
234+
$(CPP) @<<
235+
$(CPP_PROJ) /I"." ..\..\port\snprintf.c
236+
<<
237+
238+
"$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c
239+
$(CPP) @<<
240+
$(CPP_PROJ) ..\..\port\strlcpy.c
241+
<<
242+
243+
236244
.c.obj:
237245
$(CPP) $(CPP_PROJ) $<

src/interfaces/libpq/win32.mak

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ CLEAN :
7474
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
7575
-@erase "$(OUTDIR)\libpq.res"
7676
-@erase "$(OUTDIR)\$(OUTFILENAME).dll"
77-
# -@erase "*.pch"
78-
# -@erase "$(OUTDIR)\libpq.pch"
7977
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.exp"
8078
-@erase "$(INTDIR)\pg_config_paths.h"
8179

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