diff options
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/ecpg/lib/Makefile.in | 5 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/Makefile | 4 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.c | 12 | ||||
-rw-r--r-- | src/interfaces/libpq++/Makefile.in | 9 | ||||
-rw-r--r-- | src/interfaces/libpq/Makefile.in | 9 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 4 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-lobj.c | 10 | ||||
-rw-r--r-- | src/interfaces/odbc/GNUmakefile.in | 6 | ||||
-rw-r--r-- | src/interfaces/odbc/gpps.c | 8 | ||||
-rw-r--r-- | src/interfaces/odbc/misc.c | 8 |
10 files changed, 66 insertions, 9 deletions
diff --git a/src/interfaces/ecpg/lib/Makefile.in b/src/interfaces/ecpg/lib/Makefile.in index 88d39846deb..182fd657432 100644 --- a/src/interfaces/ecpg/lib/Makefile.in +++ b/src/interfaces/ecpg/lib/Makefile.in @@ -6,7 +6,7 @@ # Copyright (c) 1994, Regents of the University of California # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.38 1998/10/19 00:00:40 tgl Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.39 1999/01/17 06:19:24 momjian Exp $ # #------------------------------------------------------------------------- @@ -43,6 +43,9 @@ typename.o : typename.c ../include/ecpgtype.h .PHONY: clean clean: rm -f lib$(NAME).a $(shlib) $(OBJS) +ifeq ($(PORTNAME), win) + rm -f $(NAME).def +endif depend dep: $(CC) -MM $(CFLAGS) *.c >depend diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index 0a5a591cc5d..cd4b989f7ba 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -15,10 +15,10 @@ OBJ=y.tab.o pgc.o type.o ecpg.o ecpg_keywords.o ../../../backend/parser/scansup. all:: ecpg clean: - rm -f *.o core a.out ecpg y.tab.h y.tab.c pgc.c *~ + rm -f *.o core a.out ecpg$(X) y.tab.h y.tab.c pgc.c *~ install: all - $(INSTALL) $(INSTL_EXE_OPTS) ecpg $(DESTDIR)$(BINDIR) + $(INSTALL) $(INSTL_EXE_OPTS) ecpg$(X) $(DESTDIR)$(BINDIR) uninstall: rm -f $(DESTDIR)$(BINDIR)/ecpg diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 16cddc77b76..11ed36ef65c 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -61,7 +61,11 @@ main(int argc, char *const argv[]) switch (c) { case 'o': +#ifndef __CYGWIN32__ yyout = fopen(optarg, "w"); +#else + yyout = fopen(optarg, "wb"); +#endif if (yyout == NULL) perror(optarg); else @@ -126,7 +130,11 @@ main(int argc, char *const argv[]) ptr2ext[1] = 'c'; ptr2ext[2] = '\0'; +#ifndef __CYGWIN32__ yyout = fopen(output_filename, "w"); +#else + yyout = fopen(output_filename, "wb"); +#endif if (yyout == NULL) { perror(output_filename); @@ -136,7 +144,11 @@ main(int argc, char *const argv[]) } } +#ifndef __CYGWIN32__ yyin = fopen(input_filename, "r"); +#else + yyin = fopen(input_filename, "rb"); +#endif if (yyin == NULL) perror(argv[fnr]); else diff --git a/src/interfaces/libpq++/Makefile.in b/src/interfaces/libpq++/Makefile.in index 5a1fc34f85b..8c3ba2f0048 100644 --- a/src/interfaces/libpq++/Makefile.in +++ b/src/interfaces/libpq++/Makefile.in @@ -6,7 +6,7 @@ # Copyright (c) 1994, Regents of the University of California # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.10 1998/10/19 00:00:46 tgl Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.11 1999/01/17 06:19:39 momjian Exp $ # #------------------------------------------------------------------------- @@ -44,7 +44,11 @@ endif OBJS = pgenv.o pgconnection.o pgtransdb.o pgcursordb.o pglobject.o +ifeq ($(PORTNAME), win) +SHLIB_LINK+= -L../libpq -lpq -lstdc++ +else SHLIB_LINK= -L../libpq -lpq +endif # Shared library stuff, also default 'all' target include $(SRCDIR)/Makefile.shlib @@ -87,6 +91,9 @@ beforeinstall-headers: clean: rm -f libpq++.a $(shlib) $(OBJS) $(MAKE) -C examples clean +ifeq ($(PORTNAME), win) + rm -f pq++.def +endif dep depend: $(CXX) -MM $(CXXFLAGS) *.cc >depend diff --git a/src/interfaces/libpq/Makefile.in b/src/interfaces/libpq/Makefile.in index 6d60876dd64..471fda1773d 100644 --- a/src/interfaces/libpq/Makefile.in +++ b/src/interfaces/libpq/Makefile.in @@ -6,7 +6,7 @@ # Copyright (c) 1994, Regents of the University of California # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.41 1998/11/12 05:27:01 tgl Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.42 1999/01/17 06:19:34 momjian Exp $ # #------------------------------------------------------------------------- @@ -36,7 +36,11 @@ endif # If crypt is a separate library, rather than part of libc, # make sure it gets included in shared libpq. +ifeq ($(PORTNAME), win) +SHLIB_LINK+= $(findstring -lcrypt,$(LIBS)) +else SHLIB_LINK= $(findstring -lcrypt,$(LIBS)) +endif # Shared library stuff, also default 'all' target include $(SRCDIR)/Makefile.shlib @@ -139,6 +143,9 @@ beforeinstall-headers: clean: rm -f libpq.a $(shlib) $(OBJS) rm -f dllist.c common.c wchar.c conv.c +ifeq ($(PORTNAME), win) + rm -f pq.def +endif depend dep: $(CC) -MM $(CFLAGS) *.c >depend diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index cb515be8f3a..4c5f70035ae 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.87 1999/01/17 03:37:19 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.88 1999/01/17 06:19:35 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -567,7 +567,7 @@ connectDB(PGconn *conn) conn->raddr.in.sin_port = htons((unsigned short) (portno)); conn->raddr_len = sizeof(struct sockaddr_in); } -#ifndef WIN32 +#if !defined(WIN32) && !defined(__CYGWIN32__) else conn->raddr_len = UNIXSOCK_PATH(conn->raddr.un, portno); #endif diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 19c7770f3f1..7fd52737bf0 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.17 1998/10/01 01:40:22 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.18 1999/01/17 06:19:36 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -392,7 +392,11 @@ lo_import(PGconn *conn, char *filename) /* * open the file to be read in */ +#ifndef __CYGWIN32__ fd = open(filename, O_RDONLY, 0666); +#else + fd = open(filename, O_RDONLY | O_BINARY, 0666); +#endif if (fd < 0) { /* error */ sprintf(conn->errorMessage, @@ -467,7 +471,11 @@ lo_export(PGconn *conn, Oid lobjId, char *filename) /* * open the file to be written to */ +#ifndef __CYGWIN32__ fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0666); +#else + fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0666); +#endif if (fd < 0) { /* error */ sprintf(conn->errorMessage, diff --git a/src/interfaces/odbc/GNUmakefile.in b/src/interfaces/odbc/GNUmakefile.in index 64ffee8825f..0835bd53b5a 100644 --- a/src/interfaces/odbc/GNUmakefile.in +++ b/src/interfaces/odbc/GNUmakefile.in @@ -7,7 +7,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.9 1998/10/28 06:49:10 thomas Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.10 1999/01/17 06:19:43 momjian Exp $ # #------------------------------------------------------------------------- @SET_MAKE@ @@ -73,7 +73,11 @@ clean: distclean: clean -rm -f config.h GNUmakefile Makefile.global -rm -f config.cache config.log config.status +ifeq ($(PORTNAME), win) + @if [ $SRCDIR != $ODBCSRCDIR ]; then rm -f template makefiles port; fi +else @if [ $SRCDIR ne $ODBCSRCDIR ]; then rm -f template makefiles port +endif .PHONY: standalone diff --git a/src/interfaces/odbc/gpps.c b/src/interfaces/odbc/gpps.c index 5cb4502c186..38a2e49928b 100644 --- a/src/interfaces/odbc/gpps.c +++ b/src/interfaces/odbc/gpps.c @@ -97,10 +97,18 @@ GetPrivateProfileString(char *theSection, // section name /* This code makes it so that a file in the users home dir * overrides a the "default" file as passed in */ +#ifndef __CYGWIN32__ aFile = (FILE*)(buf ? fopen(buf, "r") : NULL); +#else + aFile = (FILE*)(buf ? fopen(buf, "rb") : NULL); +#endif if(!aFile) { sprintf(buf,"%s",theIniFileName); +#ifndef __CYGWIN32__ aFile = (FILE*)(buf ? fopen(buf, "r") : NULL); +#else + aFile = (FILE*)(buf ? fopen(buf, "rb") : NULL); +#endif } diff --git a/src/interfaces/odbc/misc.c b/src/interfaces/odbc/misc.c index 60baaa63f2d..cc31c3bdf83 100644 --- a/src/interfaces/odbc/misc.c +++ b/src/interfaces/odbc/misc.c @@ -71,7 +71,11 @@ char filebuf[80]; if (! LOGFP) { generate_filename(MYLOGDIR,MYLOGFILE,filebuf); +#ifndef __CYGWIN32__ LOGFP = fopen(filebuf, "w"); +#else + LOGFP = fopen(filebuf, "wb"); +#endif globals.mylogFP = LOGFP; setbuf(LOGFP, NULL); } @@ -102,7 +106,11 @@ FILE* LOGFP = globals.qlogFP; if (! LOGFP) { generate_filename(QLOGDIR,QLOGFILE,filebuf); +#ifndef __CYGWIN32__ LOGFP = fopen(filebuf, "w"); +#else + LOGFP = fopen(filebuf, "wb"); +#endif globals.qlogFP = LOGFP; setbuf(LOGFP, NULL); } |