From f14d2e371bf69ed26e2e7deb23d375bf38a3e635 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 20 Jan 2001 23:07:27 +0000 Subject: [PATCH] Get rid of sunos4-only strerror() macro, and arrange to use the implementation in backend/port/strerror.c if configure finds no strerror in libc, same as we do for snprintf and inet_aton. --- src/interfaces/libpq/Makefile | 14 ++++++++++---- src/interfaces/libpq/libpq-int.h | 11 +---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile index 7ab93a3aa4..18447660bf 100644 --- a/src/interfaces/libpq/Makefile +++ b/src/interfaces/libpq/Makefile @@ -20,7 +20,8 @@ SO_MINOR_VERSION= 1 override CPPFLAGS += -DFRONTEND -I$(srcdir) -DSYSCONFDIR='"$(sysconfdir)"' OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \ - pqexpbuffer.o dllist.o pqsignal.o $(SNPRINTF) $(INET_ATON) + pqexpbuffer.o dllist.o pqsignal.o \ + $(INET_ATON) $(SNPRINTF) $(STRERROR) ifdef MULTIBYTE OBJS+= common.o wchar.o @@ -48,12 +49,16 @@ backend_src = $(top_srcdir)/src/backend dllist.c: $(backend_src)/lib/dllist.c rm -f $@ && $(LN_S) $< . +# this only gets done if configure finds system doesn't have inet_aton() +inet_aton.c: $(backend_src)/port/inet_aton.c + rm -f $@ && $(LN_S) $< . + # this only gets done if configure finds system doesn't have snprintf() snprintf.c: $(backend_src)/port/snprintf.c rm -f $@ && $(LN_S) $< . -# this only gets done if configure finds system doesn't have inet_aton() -inet_aton.c: $(backend_src)/port/inet_aton.c +# this only gets done if configure finds system doesn't have strerror() +strerror.c: $(backend_src)/port/strerror.c rm -f $@ && $(LN_S) $< . ifdef MULTIBYTE @@ -77,7 +82,8 @@ uninstall: uninstall-lib rm -f $(addprefix $(DESTDIR)$(includedir)/, libpq-fe.h libpq-int.h pqexpbuffer.h) clean distclean maintainer-clean: clean-lib - rm -f $(OBJS) dllist.c snprintf.c inet_aton.c common.c wchar.c conv.c big5.c + rm -f $(OBJS) dllist.c common.c wchar.c conv.c big5.c + rm -f $(OBJS) inet_aton.c snprintf.c strerror.c depend dep: $(CC) -MM $(CFLAGS) *.c >depend diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index 4945f63b98..d0ae3dccd4 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -334,19 +334,10 @@ extern int pqWriteReady(PGconn *conn); #define DefaultAuthtype "" #define DefaultPassword "" -/* supply an implementation of strerror() macro if system doesn't have it */ -#ifndef strerror -#if defined(sun) && defined(__sparc__) && !defined(__SVR4) -extern char *sys_errlist[]; - -#define strerror(A) (sys_errlist[(A)]) -#endif /* sunos4 */ -#endif /* !strerror */ - /* * this is so that we can check is a connection is non-blocking internally * without the overhead of a function call */ -#define pqIsnonblocking(conn) (conn->nonblocking) +#define pqIsnonblocking(conn) ((conn)->nonblocking) #endif /* LIBPQ_INT_H */ -- 2.39.5