pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/textproc/nbsed/files portability fixes:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/85f7d6c30a9e
branches:  trunk
changeset: 462843:85f7d6c30a9e
user:      grant <grant%pkgsrc.org@localhost>
date:      Thu Oct 16 12:04:41 2003 +0000

description:
portability fixes:

- test for __inline/inline, de-mangle the corresponding hack in
  process.c to reduce the diff to NetBSD-current source
- move some autoconf-y bits to configure.ac

fixes build on Solaris with SunPro.

diffstat:

 textproc/nbsed/files/configure.ac |  15 +++++++++++++--
 textproc/nbsed/files/defs.h       |  12 ++----------
 textproc/nbsed/files/process.c    |  12 ++++++------
 3 files changed, 21 insertions(+), 18 deletions(-)

diffs (117 lines):

diff -r fc63bd2f61f3 -r 85f7d6c30a9e textproc/nbsed/files/configure.ac
--- a/textproc/nbsed/files/configure.ac Thu Oct 16 12:00:12 2003 +0000
+++ b/textproc/nbsed/files/configure.ac Thu Oct 16 12:04:41 2003 +0000
@@ -1,7 +1,7 @@
-dnl $Id: configure.ac,v 1.2 2003/08/23 22:20:26 jschauma Exp $
+dnl $Id: configure.ac,v 1.3 2003/10/16 12:04:41 grant Exp $
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.57)
-AC_INIT([nb-sed],[20030823],[agc%netbsd.org@localhost])
+AC_INIT([nb-sed],[20031016],[agc%netbsd.org@localhost])
 AC_CONFIG_SRCDIR([main.c])
 AC_CONFIG_HEADER(config.h)
 AC_ARG_PROGRAM
@@ -37,6 +37,7 @@
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
+AC_C_INLINE
 AC_TYPE_SIZE_T
 
 # Checks for library functions.
@@ -122,6 +123,16 @@
 #error You need either memcpy or bcopy
 # endif
 #endif
+
+#ifndef DEFFILEMODE
+# define DEFFILEMODE     (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
+#endif
+
+#include <stdio.h>
+
+#ifndef HAVE_FGETLN
+char *fgetln(FILE *, size_t *);
+#endif
 ])
 
 AC_CONFIG_FILES([Makefile])
diff -r fc63bd2f61f3 -r 85f7d6c30a9e textproc/nbsed/files/defs.h
--- a/textproc/nbsed/files/defs.h       Thu Oct 16 12:00:12 2003 +0000
+++ b/textproc/nbsed/files/defs.h       Thu Oct 16 12:04:41 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.2 2003/08/23 22:13:56 jschauma Exp $        */
+/*     $NetBSD: defs.h,v 1.3 2003/10/16 12:04:41 grant Exp $   */
 
 /*-
  * Copyright (c) 1992 Diomidis Spinellis.
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *     from: @(#)defs.h        8.1 (Berkeley) 6/6/93
- *     $NetBSD: defs.h,v 1.2 2003/08/23 22:13:56 jschauma Exp $
+ *     $NetBSD: defs.h,v 1.3 2003/10/16 12:04:41 grant Exp $
  */
 
 /*
@@ -146,11 +146,3 @@
 #define        WARNING         2       /* Just print the warning */
 #define        COMPILE         3       /* Print error, count and finish script */
 #define        COMPILE2        3       /* Print error, count and finish script */
-
-#ifndef DEFFILEMODE
-#define DEFFILEMODE     (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
-#endif
-
-#ifndef HAVE_FGETLN
-char *fgetln(FILE *, size_t *);
-#endif
diff -r fc63bd2f61f3 -r 85f7d6c30a9e textproc/nbsed/files/process.c
--- a/textproc/nbsed/files/process.c    Thu Oct 16 12:00:12 2003 +0000
+++ b/textproc/nbsed/files/process.c    Thu Oct 16 12:04:41 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process.c,v 1.3 2003/08/25 16:06:49 jschauma Exp $     */
+/*     $NetBSD: process.c,v 1.4 2003/10/16 12:04:41 grant Exp $        */
 
 /*-
  * Copyright (c) 1992 Diomidis Spinellis.
@@ -47,7 +47,7 @@
 #if 0
 static char sccsid[] = "@(#)process.c  8.6 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: process.c,v 1.3 2003/08/25 16:06:49 jschauma Exp $");
+__RCSID("$NetBSD: process.c,v 1.4 2003/10/16 12:04:41 grant Exp $");
 #endif
 #endif /* not lint */
 
@@ -103,10 +103,10 @@
 #define        hs              HS.space
 #define        hsl             HS.len
 
-static __inline int     applies(struct s_command *);
+static inline int       applies(struct s_command *);
 static void             flush_appends(void);
 static void             lputs(char *);
-static __inline int     regexec_e(regex_t *, const char *, int, int, size_t);
+static inline int       regexec_e(regex_t *, const char *, int, int, size_t);
 static void             regsub(SPACE *, char *, char *);
 static int              substitute(struct s_command *);
 
@@ -310,7 +310,7 @@
  * Return TRUE if the command applies to the current line.  Sets the inrange
  * flag to process ranges.  Interprets the non-select (``!'') flag.
  */
-static __inline int
+static inline int
 applies(struct s_command *cp)
 {
        int r;
@@ -539,7 +539,7 @@
                err(FATAL, "stdout: %s", strerror(errno ? errno : EIO));
 }
 
-static __inline int
+static inline int
 regexec_e(regex_t *preg, const char *string, int eflags, int nomatch, size_t slen)
 {
        int eval;



Home | Main Index | Thread Index | Old Index