Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src don't use variable arg macro, which is not supported by gcc2.



details:   https://anonhg.NetBSD.org/src/rev/9fdffaae1aa5
branches:  trunk
changeset: 571292:9fdffaae1aa5
user:      yamt <yamt%NetBSD.org@localhost>
date:      Tue Nov 16 05:14:12 2004 +0000

description:
don't use variable arg macro, which is not supported by gcc2.

diffstat:

 dist/pf/libexec/spamd/spamd.c       |   4 +--
 dist/pf/libexec/spamlogd/spamlogd.c |   4 +--
 usr.sbin/pf/Makefile.inc            |   9 +------
 usr.sbin/pf/compat_openbsd.h        |  43 +++++++++++++++++++++++++++++++++++++
 4 files changed, 47 insertions(+), 13 deletions(-)

diffs (102 lines):

diff -r 24b8897f90c7 -r 9fdffaae1aa5 dist/pf/libexec/spamd/spamd.c
--- a/dist/pf/libexec/spamd/spamd.c     Tue Nov 16 04:58:14 2004 +0000
+++ b/dist/pf/libexec/spamd/spamd.c     Tue Nov 16 05:14:12 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spamd.c,v 1.5 2004/11/14 11:26:48 yamt Exp $   */
+/*     $NetBSD: spamd.c,v 1.6 2004/11/16 05:14:12 yamt Exp $   */
 /*     $OpenBSD: spamd.c,v 1.71 2004/08/17 09:38:07 henning Exp $      */
 
 /*
@@ -102,9 +102,7 @@
 void     handlew(struct con *, int one);
 
 char hostname[MAXHOSTNAMELEN];
-#ifdef HAVE_SYSLOG_R
 struct syslog_data sdata = SYSLOG_DATA_INIT;
-#endif
 char *reply = NULL;
 char *nreply = "450";
 char *spamd = "spamd IP-based SPAM blocker";
diff -r 24b8897f90c7 -r 9fdffaae1aa5 dist/pf/libexec/spamlogd/spamlogd.c
--- a/dist/pf/libexec/spamlogd/spamlogd.c       Tue Nov 16 04:58:14 2004 +0000
+++ b/dist/pf/libexec/spamlogd/spamlogd.c       Tue Nov 16 05:14:12 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spamlogd.c,v 1.4 2004/11/14 11:26:48 yamt Exp $        */
+/*     $NetBSD: spamlogd.c,v 1.5 2004/11/16 05:14:12 yamt Exp $        */
 /*     $OpenBSD: spamlogd.c,v 1.9 2004/08/10 16:06:01 otto Exp $       */
 
 /*
@@ -35,9 +35,7 @@
 #include "grey.h"
 #define PATH_TCPDUMP "/usr/sbin/tcpdump"
 
-#ifdef HAVE_SYSLOG_R
 struct syslog_data sdata = SYSLOG_DATA_INIT;
-#endif
 int inbound; /* do we only whitelist inbound smtp? */
 
 extern char *__progname;
diff -r 24b8897f90c7 -r 9fdffaae1aa5 usr.sbin/pf/Makefile.inc
--- a/usr.sbin/pf/Makefile.inc  Tue Nov 16 04:58:14 2004 +0000
+++ b/usr.sbin/pf/Makefile.inc  Tue Nov 16 05:14:12 2004 +0000
@@ -1,11 +1,6 @@
-#      $NetBSD: Makefile.inc,v 1.3 2004/11/14 11:26:48 yamt Exp $
+#      $NetBSD: Makefile.inc,v 1.4 2004/11/16 05:14:12 yamt Exp $
 
-# misc OpenBSD compatibility stuffs.
-#  NetBSD doesn't have syslog_r.
-CPPFLAGS+=     -D'openlog_r(ident, logopt, fac, data)=/*nothing*/'
-CPPFLAGS+=     -D'syslog_r(pri, data, ...)=syslog((pri), __VA_ARGS__)'
-#  NetBSD doesn't have TAILQ_END.
-CPPFLAGS+=     -D'TAILQ_END(h)=NULL'
+CPPFLAGS+=     -include ${.CURDIR}/../compat_openbsd.h
 
 WARNS?=        1
 
diff -r 24b8897f90c7 -r 9fdffaae1aa5 usr.sbin/pf/compat_openbsd.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/pf/compat_openbsd.h      Tue Nov 16 05:14:12 2004 +0000
@@ -0,0 +1,43 @@
+/*     $NetBSD: compat_openbsd.h,v 1.1 2004/11/16 05:14:12 yamt Exp $  */
+
+/*
+ * misc OpenBSD compatibility hacks.
+ */
+
+#include <sys/cdefs.h>
+
+/*
+ * syslog.h
+ */
+
+#include <stdarg.h>
+#include <syslog.h>
+
+#define        openlog_r(ident, logopt, fac, data)     /* nothing */
+
+struct syslog_data {
+#if !defined(__GNUC__)
+       /* empty structure is gcc extension */
+       char dummy;
+#endif
+};
+#define        SYSLOG_DATA_INIT        {}
+
+static __inline void syslog_r(int pri, struct syslog_data *data,
+    const char *fmt, ...) __unused;
+
+static __inline void
+syslog_r(int pri, struct syslog_data *data, const char *fmt, ...)
+{
+       va_list ap;
+
+       va_start(ap, fmt);
+       vsyslog(pri, fmt, ap);
+       va_end(ap);
+}
+
+/*
+ * sys/queue.h
+ */
+
+#define        TAILQ_END(h)    NULL



Home | Main Index | Thread Index | Old Index