From 7286afc85c82c3638c2c4bc0028f896008ee8ddc Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Tue, 26 Mar 1996 15:09:54 +0000 Subject: From NetBSD: vnode_if.[ch] made machine independent. very usefull (for inclusion). from the other side this is really machine independent ... tested w/ i386, but should not cause errors w/ other arch's. pls, test it (don't forget to reconfig kernel ;) --- sys/kern/makesyscalls.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'sys/kern/makesyscalls.sh') diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh index 8c94144ee2e..596c878abba 100644 --- a/sys/kern/makesyscalls.sh +++ b/sys/kern/makesyscalls.sh @@ -1,5 +1,5 @@ #! /bin/sh - -# $NetBSD: makesyscalls.sh,v 1.17 1995/10/07 06:28:31 mycroft Exp $ +# $NetBSD: makesyscalls.sh,v 1.18 1996/03/15 01:25:12 cgd Exp $ # # Copyright (c) 1994 Christopher G. Demetriou # All rights reserved. @@ -108,6 +108,9 @@ s/\$//g ' < $2 | $awk " $toupper BEGIN { + # to allow nested #if/#else/#endif sets + savedepth = 0 + sysnames = \"$sysnames\" sysprotos = \"$sysprotos\" sysnumhdr = \"$sysnumhdr\" @@ -177,17 +180,30 @@ $1 ~ /^#[ ]*if/ { print > sysent print > sysprotos print > sysnames - savesyscall = syscall + savesyscall[++savedepth] = syscall next } $1 ~ /^#[ ]*else/ { print > sysent print > sysprotos print > sysnames - syscall = savesyscall + if (savedepth <= 0) { + printf "%s: line %d: unbalenced #else\n", \ + infile, NR + exit 1 + } + syscall = savesyscall[savedepth] next } $1 ~ /^#/ { + if ($1 ~ /^#[ ]*endif/) { + if (savedepth <= 0) { + printf "%s: line %d: unbalenced #endif\n", \ + infile, NR + exit 1 + } + savedepth--; + } print > sysent print > sysprotos print > sysnames -- cgit v1.2.3