From 945d0b4b09624db3bfa7b3e91c0625cf6a6b72b2 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 11 Jan 2007 02:39:52 +0000 Subject: [PATCH] Allow Borland CC to compile libpq and psql. L Bayuk --- src/bin/psql/bcc32.mak | 35 ++++++++++++++++++++++++++++++++--- src/include/c.h | 4 ++-- src/include/port.h | 4 ++-- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/bin/psql/bcc32.mak b/src/bin/psql/bcc32.mak index d429a5b9e4..9115a136b6 100644 --- a/src/bin/psql/bcc32.mak +++ b/src/bin/psql/bcc32.mak @@ -60,7 +60,7 @@ INTDIR=.\Release !endif REFDOCDIR=../../../doc/src/sgml/ref -CPP_PROJ = -I$(BCB)\include;..\..\include;..\..\interfaces\libpq;..\..\include\port\win32 \ +CPP_PROJ = -I$(BCB)\include;..\..\include;..\..\interfaces\libpq;..\..\include\port\win32;..\..\include\port\win32_msvc;..\pg_dump;..\..\backend \ -c -D$(USERDEFINES) -DFRONTEND -n"$(INTDIR)" -tWM -tWC -q -5 -a8 -pc -X -w-use \ -w-par -w-pia -w-csu -w-aus -w-ccc @@ -98,6 +98,7 @@ CLEAN : -@erase "$(INTDIR)\mbprint.obj" -@erase "$(INTDIR)\print.obj" -@erase "$(INTDIR)\prompt.obj" + -@erase "$(INTDIR)\psqlscan.obj" -@erase "$(INTDIR)\startup.obj" -@erase "$(INTDIR)\stringutils.obj" -@erase "$(INTDIR)\tab-complete.obj" @@ -105,9 +106,13 @@ CLEAN : -@erase "$(INTDIR)\exec.obj" -@erase "$(INTDIR)\getopt.obj" -@erase "$(INTDIR)\getopt_long.obj" + -@erase "$(INTDIR)\snprintf.obj" -@erase "$(INTDIR)\path.obj" + -@erase "$(INTDIR)\strlcpy.obj" -@erase "$(INTDIR)\pgstrcasecmp.obj" -@erase "$(INTDIR)\sprompt.obj" + -@erase "$(INTDIR)\dumputils.obj" + -@erase "$(INTDIR)\keywords.obj" -@erase "$(INTDIR)\psql.ilc" -@erase "$(INTDIR)\psql.ild" -@erase "$(INTDIR)\psql.tds" @@ -138,9 +143,13 @@ LINK32_OBJS= \ "$(INTDIR)\exec.obj" \ "$(INTDIR)\getopt.obj" \ "$(INTDIR)\getopt_long.obj" \ + "$(INTDIR)\snprintf.obj" \ "$(INTDIR)\path.obj" \ + "$(INTDIR)\strlcpy.obj" \ "$(INTDIR)\pgstrcasecmp.obj" \ - "$(INTDIR)\sprompt.obj" + "$(INTDIR)\sprompt.obj" \ + "$(INTDIR)\dumputils.obj" \ + "$(INTDIR)\keywords.obj" !IFDEF DEBUG LINK32_OBJS = $(LINK32_OBJS) "..\..\interfaces\libpq\Debug\blibpqddll.lib" @@ -149,7 +158,7 @@ LINK32_OBJS = $(LINK32_OBJS) "..\..\interfaces\libpq\Release\blibpqdll.lib" !ENDIF # Have to use \# so # isn't treated as a comment, but MSVC doesn't like this -"..\..\port\pg_config_paths.h": win32.mak +"..\..\port\pg_config_paths.h": bcc32.mak echo \#define PGBINDIR "" >$@ echo \#define PGSHAREDIR "" >>$@ echo \#define SYSCONFDIR "" >>$@ @@ -188,11 +197,21 @@ LINK32_OBJS = $(LINK32_OBJS) "..\..\interfaces\libpq\Release\blibpqdll.lib" $(CPP_PROJ) ..\..\port\getopt_long.c << +"$(INTDIR)\snprintf.obj" : "$(INTDIR)" ..\..\port\snprintf.c + $(CPP) @<< + $(CPP_PROJ) ..\..\port\snprintf.c +<< + "$(INTDIR)\path.obj" : "$(INTDIR)" ..\..\port\path.c $(CPP) @<< $(CPP_PROJ) ..\..\port\path.c << +"$(INTDIR)\strlcpy.obj" : "$(INTDIR)" ..\..\port\strlcpy.c + $(CPP) @<< + $(CPP_PROJ) ..\..\port\strlcpy.c +<< + "$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c $(CPP) @<< $(CPP_PROJ) ..\..\port\pgstrcasecmp.c @@ -203,6 +222,16 @@ LINK32_OBJS = $(LINK32_OBJS) "..\..\interfaces\libpq\Release\blibpqdll.lib" $(CPP_PROJ) ..\..\port\sprompt.c << +"$(INTDIR)\dumputils.obj" : "$(INTDIR)" ..\pg_dump\dumputils.c + $(CPP) @<< + $(CPP_PROJ) ..\pg_dump\dumputils.c +<< + +"$(INTDIR)\keywords.obj" : "$(INTDIR)" ..\..\backend\parser\keywords.c + $(CPP) @<< + $(CPP_PROJ) ..\..\backend\parser\keywords.c +<< + "sql_help.h": create_help.pl $(PERL) create_help.pl $(REFDOCDIR) $@ diff --git a/src/include/c.h b/src/include/c.h index 6608f80efe..dab8dc2e68 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/c.h,v 1.215 2007/01/05 22:19:50 momjian Exp $ + * $PostgreSQL: pgsql/src/include/c.h,v 1.216 2007/01/11 02:39:52 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -59,7 +59,7 @@ #include "postgres_ext.h" #include "pg_trace.h" -#if defined(__BORLANDC__) || (_MSC_VER >= 1400) +#if _MSC_VER >= 1400 #define errcode __msvc_errcode #include #undef errcode diff --git a/src/include/port.h b/src/include/port.h index 5875a46536..305fe7c3c9 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/port.h,v 1.107 2007/01/05 22:19:50 momjian Exp $ + * $PostgreSQL: pgsql/src/include/port.h,v 1.108 2007/01/11 02:39:52 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -343,7 +343,7 @@ extern char *strdup(const char *str); extern size_t strlcpy(char *dst, const char *src, size_t siz); #endif -#ifndef HAVE_RANDOM +#if !defined(HAVE_RANDOM) && !defined(__BORLANDC__) extern long random(void); #endif -- 2.40.0