Source-Changes-HG archive

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

[src/trunk]: src/sys Avoid redefining SET/CLR/ISSET (which in the kernel are ...



details:   https://anonhg.NetBSD.org/src/rev/d749d1653805
branches:  trunk
changeset: 363049:d749d1653805
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Jul 09 08:51:19 2018 +0000

description:
Avoid redefining SET/CLR/ISSET (which in the kernel are normally
defined in <sys/types.h>).   These redefinitions (when they are,
that is, when types.h is included) were sneaking through because
they were defined identically ... until CLR in <sys/types.h> was
changed...    Avoid that issue arising again.

diffstat:

 sys/arch/evbarm/stand/boot2440/dev_sdmmc.c |   7 +++++++
 sys/arch/mips/sibyte/dev/sbjcnvar.h        |  12 +++++++++---
 sys/dev/sbus/magmareg.h                    |   8 +++++++-
 sys/dev/sbus/spifreg.h                     |   8 +++++++-
 4 files changed, 30 insertions(+), 5 deletions(-)

diffs (94 lines):

diff -r 6971341ffb97 -r d749d1653805 sys/arch/evbarm/stand/boot2440/dev_sdmmc.c
--- a/sys/arch/evbarm/stand/boot2440/dev_sdmmc.c        Mon Jul 09 08:24:33 2018 +0000
+++ b/sys/arch/evbarm/stand/boot2440/dev_sdmmc.c        Mon Jul 09 08:51:19 2018 +0000
@@ -90,9 +90,16 @@
 #include "dev_sdmmc.h"
 #include "s3csdi.h"
 
+#ifndef SET
 #define SET(t, f)       ((t) |= (f))
+#endif
+#ifndef ISSET
 #define ISSET(t, f)     ((t) & (f))
+#endif
+#ifndef CLR
 #define CLR(t, f)       ((t) &= ~(f))
+#endif
+
 
 //#define SDMMC_DEBUG
 #ifdef SDMMC_DEBUG
diff -r 6971341ffb97 -r d749d1653805 sys/arch/mips/sibyte/dev/sbjcnvar.h
--- a/sys/arch/mips/sibyte/dev/sbjcnvar.h       Mon Jul 09 08:24:33 2018 +0000
+++ b/sys/arch/mips/sibyte/dev/sbjcnvar.h       Mon Jul 09 08:51:19 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbjcnvar.h,v 1.6 2015/04/13 21:18:42 riastradh Exp $ */
+/* $NetBSD: sbjcnvar.h,v 1.7 2018/07/09 08:51:19 kre Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -171,6 +171,12 @@
 };
 
 /* Macros to clear/set/test flags. */
-#define        SET(t, f)       (t) |= (f)
-#define        CLR(t, f)       (t) &= ~(f)
+#ifndef SET
+#define        SET(t, f)       ((t) |= (f))
+#endif
+#ifndef CLR
+#define        CLR(t, f)       ((t) &= ~(f))
+#endif
+#ifndef ISSET
 #define        ISSET(t, f)     ((t) & (f))
+#endif
diff -r 6971341ffb97 -r d749d1653805 sys/dev/sbus/magmareg.h
--- a/sys/dev/sbus/magmareg.h   Mon Jul 09 08:24:33 2018 +0000
+++ b/sys/dev/sbus/magmareg.h   Mon Jul 09 08:51:19 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: magmareg.h,v 1.18 2014/11/15 19:18:19 christos Exp $   */
+/*     $NetBSD: magmareg.h,v 1.19 2018/07/09 08:51:19 kre Exp $        */
 
 /*-
  *  Copyright (c) 1998 Iain Hibbert
@@ -189,9 +189,15 @@
 /*
  * useful macros
  */
+#ifndef SET
 #define SET(t, f)      ((t) |= (f))
+#endif
+#ifndef CLR
 #define CLR(t, f)      ((t) &= ~(f))
+#endif
+#ifndef ISSET
 #define ISSET(t, f)    ((t) & (f))
+#endif
 
 /* internal function prototypes */
 
diff -r 6971341ffb97 -r d749d1653805 sys/dev/sbus/spifreg.h
--- a/sys/dev/sbus/spifreg.h    Mon Jul 09 08:24:33 2018 +0000
+++ b/sys/dev/sbus/spifreg.h    Mon Jul 09 08:51:19 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spifreg.h,v 1.5 2014/11/15 19:18:19 christos Exp $     */
+/*     $NetBSD: spifreg.h,v 1.6 2018/07/09 08:51:19 kre Exp $  */
 /*     $OpenBSD: spifreg.h,v 1.5 2003/06/02 18:32:41 jason Exp $       */
 
 /*
@@ -383,9 +383,15 @@
 /*
  * useful macros
  */
+#ifndef SET
 #define        SET(t, f)       ((t) |= (f))
+#endif
+#ifndef CLR
 #define        CLR(t, f)       ((t) &= ~(f))
+#endif
+#ifndef ISSET
 #define        ISSET(t, f)     ((t) & (f))
+#endif
 
 /*
  * internal function prototypes



Home | Main Index | Thread Index | Old Index