From 53ee26b0e562d0adec9e9d393c5c0188856b8b3f Mon Sep 17 00:00:00 2001 From: kvigor Date: Sun, 27 Feb 2000 05:41:53 +0000 Subject: [PATCH] Get compiling with Vorland C++ for Windows git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@129 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- support/cpp/Makefile.bcc | 52 ++++++++++++++++++++++++++++++++++++++++ support/cpp/config.h | 12 ++++++++++ support/cpp/cpplib.c | 5 ++++ 3 files changed, 69 insertions(+) create mode 100644 support/cpp/Makefile.bcc diff --git a/support/cpp/Makefile.bcc b/support/cpp/Makefile.bcc new file mode 100644 index 00000000..8b6ab2b9 --- /dev/null +++ b/support/cpp/Makefile.bcc @@ -0,0 +1,52 @@ +# Generated automatically from Makefile.in by configure. +# +# +# + +VERSION = 2.2.0 +VERSIONHI = 2 +VERSIONLO = 2 +VERSIONP = 0 + +PRJDIR = ../.. + +srcdir = . +prefix = /cygnus/cygwin-b20/kvigor/ +exec_prefix = ${prefix} +bindir = ${exec_prefix}/bin +libdir = ${exec_prefix}/lib +datadir = ${prefix}/share +includedir = ${prefix}/include +mandir = ${prefix}/man +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +infodir = ${prefix}/info + +STD_INC = @sdcc_include_dir@ +#CPPFLAGS = -I. -I$(PRJDIR) -D_FORASXXXX_ +#CFLAGS = -ggdb -O2 -pipe +CFLAGS = -6 -O -g0 -I. -I$(PRJDIR) -D_FORASXXXX_ +M_OR_MM = -MM +LDFLAGS = + +OBJECTS = cppalloc.obj cpperror.obj cppexp.obj cpphash.obj cpplib.obj cppmain.obj + +TARGET = $(PRJDIR)\bin\sdcpp.exe + + +# Compiling entire program or any subproject +# ------------------------------------------ +all: $(TARGET) + +$(TARGET): $(OBJECTS) + bcc32 -e$(TARGET) $(OBJECTS) + +!include Makefile.dep + +# My rules +# -------- +.c.obj: + BCC32 -c $(CFLAGS) $(CPPFLAGS) $< + + +# End of cpp/Makefile diff --git a/support/cpp/config.h b/support/cpp/config.h index c1bbb067..91bf22f7 100644 --- a/support/cpp/config.h +++ b/support/cpp/config.h @@ -1,4 +1,16 @@ #include "i386/i386.h" #include "i386/xm-linux.h" +#ifndef __BORLANDC__ #define alloca malloc +#else +#include +#include +#define bcopy(s, d, n) memcpy(d, s, n) +#define bcmp memcmp +#define bzero(p, l) memset(p, 0, l) +#define index strchr +#define rindex strrchr +#endif + + diff --git a/support/cpp/cpplib.c b/support/cpp/cpplib.c index a7f2c8ac..cc0b5cb2 100644 --- a/support/cpp/cpplib.c +++ b/support/cpp/cpplib.c @@ -78,6 +78,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #endif +#ifdef __BORLANDC__ +#include +#else #ifndef VMS #ifndef USG #include /* for __DATE__ and __TIME__ */ @@ -89,6 +92,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #endif /* USG */ #endif /* not VMS */ +#endif /* This defines "errno" properly for VMS, and gives us EACCES. */ #include @@ -2157,6 +2161,7 @@ output_line_command ( CPP_RESERVE (pfile, 4 * strlen (ip->nominal_fname) + 50); { static char sharp_line[] = "#line "; + CPP_PUTS_Q (pfile, sharp_line, sizeof(sharp_line)-1); } -- 2.30.2