so we make is_absolute_path a macro so libpq doesn't use path.o.
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/port.h,v 1.32 2004/05/17 14:35:34 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.33 2004/05/19 04:21:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
bool set_noblock(int sock);
/* Portable path handling for Unix/Win32 */
-extern bool is_absolute_path(const char *filename);
extern char *first_path_separator(const char *filename);
extern char *last_path_separator(const char *filename);
extern void canonicalize_path(char *path);
extern void get_pkginclude_path(const char *my_exec_path, char *ret_path);
extern void get_pkglib_path(const char *my_exec_path, char *ret_path);
+/*
+ * is_absolute_path
+ *
+ * This capability is needed by libpq and initdb.c
+ * On Win32, you can't reference the same object file that is
+ * in two different libraries (pgport and libpq), so a macro is best.
+ */
+#ifndef WIN32
+#define is_absolute_path(filename) \
+( \
+ ((filename)[0] == '/') \
+)
+#else
+#define is_absolute_path(filename) \
+( \
+ ((filename)[0] == '/') || \
+ (filename)[0] == '\\' || \
+ (isalpha((filename)[0]) && (filename)[1] == ':' && \
+ ((filename)[2] == '\\' || (filename)[2] == '/')) \
+)
+#endif
+
+
+
+
/* Portable way to find binaries */
extern int find_my_exec(const char *argv0, char *full_path);
#
# Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.106 2004/05/17 14:35:34 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.107 2004/05/19 04:21:49 momjian Exp $
#
#-------------------------------------------------------------------------
OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o fe-secure.o \
dllist.o md5.o ip.o wchar.o encnames.o \
- $(filter crypt.o getaddrinfo.o inet_aton.o noblock.o pgstrcasecmp.o snprintf.o strerror.o open.o path.o thread.o, $(LIBOBJS))
+ $(filter crypt.o getaddrinfo.o inet_aton.o noblock.o pgstrcasecmp.o snprintf.o strerror.o open.o thread.o, $(LIBOBJS))
ifeq ($(PORTNAME), win32)
OBJS+=win32.o
endif
# For port modules, this only happens if configure decides the module
# is needed (see filter hack in OBJS, above).
-crypt.c getaddrinfo.c inet_aton.c noblock.c pgstrcasecmp.c snprintf.c strerror.c open.c path.c thread.c: % : $(top_srcdir)/src/port/%
+crypt.c getaddrinfo.c inet_aton.c noblock.c pgstrcasecmp.c snprintf.c strerror.c open.c thread.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
md5.c ip.c: % : $(backend_src)/libpq/%
rm -f $(DESTDIR)$(includedir)/libpq-fe.h $(DESTDIR)$(includedir_internal)/libpq-int.h $(DESTDIR)$(includedir_internal)/pqexpbuffer.h
clean distclean maintainer-clean: clean-lib
- rm -f $(OBJS) crypt.c getaddrinfo.c inet_aton.c noblock.c pgstrcasecmp.c snprintf.c strerror.c open.c path.c thread.c dllist.c md5.c ip.c encnames.c wchar.c
+ rm -f $(OBJS) crypt.c getaddrinfo.c inet_aton.c noblock.c pgstrcasecmp.c snprintf.c strerror.c open.c thread.c dllist.c md5.c ip.c encnames.c wchar.c
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/path.c,v 1.9 2004/05/18 03:36:45 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/path.c,v 1.10 2004/05/19 04:21:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
-/*
- * is_absolute_path
- */
-bool
-is_absolute_path(const char *filename)
-{
- return filename[0] == '/'
-#ifdef WIN32 /* WIN32 paths can either have forward or
- * backward slashes */
- || filename[0] == '\\'
- || (isalpha(filename[0]) && filename[1] == ':'
- && (filename[2] == '\\' || filename[2] == '/'))
-#endif
- ;
-}
-
-
-
/*
* first_path_separator
*/