Source-Changes-HG archive

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

[src/trunk]: src/sbin/scan_ffs Undefine the 17 macros commonly defined by <uf...



details:   https://anonhg.NetBSD.org/src/rev/01749bbb8826
branches:  trunk
changeset: 583489:01749bbb8826
user:      he <he%NetBSD.org@localhost>
date:      Tue Aug 09 12:59:29 2005 +0000

description:
Undefine the 17 macros commonly defined by <ufs/ffs/fs.h> and
<ufs/lfs/lfs.h> before including the second of them, and also after
including the second, to ensure the rest of the code doesn't depend
on their (ambigious) definition.

This fixes a build problem for vax; gcc 2.95.3's preprocessor
apparently doesn't like redefinition of macros.

Discussed with xtraeme.

diffstat:

 sbin/scan_ffs/scan_ffs.c |  44 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 42 insertions(+), 2 deletions(-)

diffs (67 lines):

diff -r 966859aa7603 -r 01749bbb8826 sbin/scan_ffs/scan_ffs.c
--- a/sbin/scan_ffs/scan_ffs.c  Tue Aug 09 09:15:23 2005 +0000
+++ b/sbin/scan_ffs/scan_ffs.c  Tue Aug 09 12:59:29 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scan_ffs.c,v 1.7 2005/08/09 01:49:23 xtraeme Exp $ */
+/* $NetBSD: scan_ffs.c,v 1.8 2005/08/09 12:59:29 he Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
  
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: scan_ffs.c,v 1.7 2005/08/09 01:49:23 xtraeme Exp $");
+__RCSID("$NetBSD: scan_ffs.c,v 1.8 2005/08/09 12:59:29 he Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -91,8 +91,48 @@
 
 #include <ufs/ufs/dinode.h>
 #include <ufs/lfs/lfs.h>
+
+/* Undefine macros defined by both lfs/lfs.h and ffs/fs.h */
+#undef fsbtodb
+#undef dbtofsb
+#undef blkoff
+#undef fragoff
+#undef lblktosize
+#undef lblkno
+#undef numfrags
+#undef blkroundup
+#undef fragroundup
+#undef fragstoblks
+#undef blkstofrags
+#undef fragnum
+#undef blknum
+#undef blksize
+#undef INOPB
+#undef INOPF
+#undef NINDIR
+
 #include <ufs/ffs/fs.h>
 
+/* Undefine macros defined by both lfs/lfs.h and ffs/fs.h */
+/* ...to make sure we don't later depend on their (ambigious) definition */
+#undef fsbtodb
+#undef dbtofsb
+#undef blkoff
+#undef fragoff
+#undef lblktosize
+#undef lblkno
+#undef numfrags
+#undef blkroundup
+#undef fragroundup
+#undef fragstoblks
+#undef blkstofrags
+#undef fragnum
+#undef blknum
+#undef blksize
+#undef INOPB
+#undef INOPF
+#undef NINDIR
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>



Home | Main Index | Thread Index | Old Index