diff options
| author | Bruce Momjian | 2003-09-07 03:43:57 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2003-09-07 03:43:57 +0000 |
| commit | 4b407f6c3cd7584c308fcd75fd8d2a094a4e8dd1 (patch) | |
| tree | cf14f1a883879e481b944acf5159c54ed3dab9a4 /src/bin/scripts | |
| parent | 7703e55c32e82e2485272596ec5ee6ac1695e42d (diff) | |
Changes for MinGW/WIN32:
o allow configure to see include/port/win32 include files
o add matching Win32 accept() prototype
o allow pg_id to compile with native Win32 API
o fix invalide mbvalidate() function calls (existing bug)
o allow /scripts to compile with native Win32 API
o add win32.c to Win32 compiles (already in *.mak files)
Diffstat (limited to 'src/bin/scripts')
| -rw-r--r-- | src/bin/scripts/Makefile | 4 | ||||
| -rw-r--r-- | src/bin/scripts/common.c | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/bin/scripts/Makefile b/src/bin/scripts/Makefile index 48908645e2d..ff51db5e3b6 100644 --- a/src/bin/scripts/Makefile +++ b/src/bin/scripts/Makefile @@ -5,7 +5,7 @@ # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.22 2003/08/08 04:52:21 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.23 2003/09/07 03:43:55 momjian Exp $ # #------------------------------------------------------------------------- @@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vacuumdb -override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS) +override CPPFLAGS := -DPGSCRIPTS -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS) all: submake-libpq submake-backend $(PROGRAMS) diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c index dc27a944776..bb191734d45 100644 --- a/src/bin/scripts/common.c +++ b/src/bin/scripts/common.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/bin/scripts/common.c,v 1.4 2003/08/04 00:43:29 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/scripts/common.c,v 1.5 2003/09/07 03:43:55 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -23,6 +23,7 @@ const char * get_user_name(const char *progname) { +#ifndef WIN32 struct passwd *pw; pw = getpwuid(getuid()); @@ -32,6 +33,12 @@ get_user_name(const char *progname) exit(1); } return pw->pw_name; +#else + static char username[128]; /* remains after function exit */ + + GetUserName(username, sizeof(username)-1); + return username; +#endif } |
