From a5ec2ec77abeb887402451e4fe34a2b54954bc56 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 11 Jan 2007 02:42:31 +0000 Subject: [PATCH] Allow Borland CC to compile libpq and psql. Backpatch to 8.2.X. L Bayuk --- src/include/port/win32.h | 10 +++++++++- src/interfaces/libpq/bcc32.mak | 24 ++++++++++++++++-------- src/interfaces/libpq/win32.mak | 2 -- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/include/port/win32.h b/src/include/port/win32.h index eb086fc043..22d71272d1 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.64 2007/01/02 21:25:50 momjian Exp $ */ +/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.65 2007/01/11 02:42:31 momjian Exp $ */ #if defined(_MSC_VER) || defined(__BORLANDC__) #define WIN32_ONLY_COMPILER @@ -17,7 +17,9 @@ #include #include #include +#ifndef __BORLANDC__ #include /* for non-unicode version */ +#endif #undef near /* Must be here to avoid conflicting with prototype in windows.h */ @@ -149,8 +151,10 @@ int semop(int semId, struct sembuf * sops, int flag); #define SIGTTIN 21 #define SIGTTOU 22 /* Same as SIGABRT -- no problem, I hope */ #define SIGWINCH 28 +#ifndef __BORLANDC__ #define SIGUSR1 30 #define SIGUSR2 31 +#endif struct timezone { @@ -259,8 +263,10 @@ extern void _dosmaperr(unsigned long); /* Things that exist in MingW headers, but need to be added to MSVC */ #ifdef WIN32_ONLY_COMPILER +#ifndef __BORLANDC__ typedef long ssize_t; typedef unsigned short mode_t; +#endif /* * Certain "standard edition" versions of MSVC throw a warning @@ -271,6 +277,7 @@ typedef unsigned short mode_t; #define inline __inline #define __inline__ __inline +#ifndef __BORLANDC__ #define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC) #define _S_IXUSR _S_IEXEC #define _S_IWUSR _S_IWRITE @@ -280,6 +287,7 @@ typedef unsigned short mode_t; #define S_IXUSR _S_IXUSR #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif #define F_OK 0 #define W_OK 2 diff --git a/src/interfaces/libpq/bcc32.mak b/src/interfaces/libpq/bcc32.mak index 30e25a29ab..992bb5b68e 100644 --- a/src/interfaces/libpq/bcc32.mak +++ b/src/interfaces/libpq/bcc32.mak @@ -76,7 +76,6 @@ ALL : config "$(OUTDIR)" "$(OUTDIR)\blibpq.dll" "$(OUTDIR)\blibpq.lib" CLEAN : -@erase "$(INTDIR)\getaddrinfo.obj" -@erase "$(INTDIR)\pgstrcasecmp.obj" - -@erase "$(INTDIR)\strlcpy.obj" -@erase "$(INTDIR)\thread.obj" -@erase "$(INTDIR)\inet_aton.obj" -@erase "$(INTDIR)\crypt.obj" @@ -99,6 +98,8 @@ CLEAN : -@erase "$(INTDIR)\wchar.obj" -@erase "$(INTDIR)\encnames.obj" -@erase "$(INTDIR)\pthread-win32.obj" + -@erase "$(INTDIR)\snprintf.obj" + -@erase "$(INTDIR)\strlcpy.obj" -@erase "$(OUTDIR)\$(OUTFILENAME).lib" -@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib" -@erase "$(OUTDIR)\libpq.res" @@ -113,7 +114,6 @@ LIB32_OBJS= \ "$(INTDIR)\win32.obj" \ "$(INTDIR)\getaddrinfo.obj" \ "$(INTDIR)\pgstrcasecmp.obj" \ - "$(INTDIR)\strlcpy.obj" \ "$(INTDIR)\thread.obj" \ "$(INTDIR)\inet_aton.obj" \ "$(INTDIR)\crypt.obj" \ @@ -133,6 +133,8 @@ LIB32_OBJS= \ "$(INTDIR)\pqsignal.obj" \ "$(INTDIR)\wchar.obj" \ "$(INTDIR)\encnames.obj" \ + "$(INTDIR)\snprintf.obj" \ + "$(INTDIR)\strlcpy.obj" \ "$(INTDIR)\pthread-win32.obj" @@ -162,7 +164,7 @@ LINK32_OBJS= "$(INTDIR)\libpqdll.obj" $(LINK32_FLAGS) + c0d32.obj $(LINK32_OBJS), + $@,, + - "$(OUTDIR)\blibpq.lib" import32.lib cw32mti.lib, + + "$(OUTDIR)\blibpq.lib" import32.lib cw32mt.lib, + blibpqdll.def,"$(INTDIR)\libpq.res" << implib -w "$(OUTDIR)\blibpqdll.lib" blibpqdll.def $@ @@ -187,11 +189,6 @@ LINK32_OBJS= "$(INTDIR)\libpqdll.obj" $(CPP_PROJ) ..\..\port\pgstrcasecmp.c << -"$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c - $(CPP) @<< - $(CPP_PROJ) ..\..\port\strlcpy.c -<< - "$(INTDIR)\thread.obj" : ..\..\port\thread.c $(CPP) @<< $(CPP_PROJ) ..\..\port\thread.c @@ -233,5 +230,16 @@ LINK32_OBJS= "$(INTDIR)\libpqdll.obj" $(CPP_PROJ) /I"." ..\..\backend\utils\mb\encnames.c << +"$(INTDIR)\snprintf.obj" : ..\..\port\snprintf.c + $(CPP) @<< + $(CPP_PROJ) /I"." ..\..\port\snprintf.c +<< + +"$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c + $(CPP) @<< + $(CPP_PROJ) ..\..\port\strlcpy.c +<< + + .c.obj: $(CPP) $(CPP_PROJ) $< diff --git a/src/interfaces/libpq/win32.mak b/src/interfaces/libpq/win32.mak index 0fd56eb174..ca5f4326aa 100644 --- a/src/interfaces/libpq/win32.mak +++ b/src/interfaces/libpq/win32.mak @@ -74,8 +74,6 @@ CLEAN : -@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib" -@erase "$(OUTDIR)\libpq.res" -@erase "$(OUTDIR)\$(OUTFILENAME).dll" -# -@erase "*.pch" -# -@erase "$(OUTDIR)\libpq.pch" -@erase "$(OUTDIR)\$(OUTFILENAME)dll.exp" -@erase "$(INTDIR)\pg_config_paths.h" -- 2.40.0