Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 May 2016 03:29:43 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300443 - head/sys/sys
Message-ID:  <201605230329.u4N3ThxB043997@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Mon May 23 03:29:43 2016
New Revision: 300443
URL: https://svnweb.freebsd.org/changeset/base/300443

Log:
  [bhnd] Fix DEFINE_CLASS_(2|3) multiple inheritance support.
  
  This diff updates DEFINE_CLASS_2/_3 to support the specification of class
  name separately from the class variable name, bringing them into sync
  with their API documentation, as well as the behavior of DEFINE_CLASS_0/_1.
  
  Nothing in the tree currently uses the _2/_3 variants, and I can't
  find any references to the API outside of commits to the kobj.h
  header itself; given the limitation that currently exists, I'd
  be surprised if they've ever been used.
  
  Submitted by:	Landon Fuller <landonf@landonf.org>
  Reviewed by:	imp
  Differential Revision:	https://reviews.freebsd.org/D6491

Modified:
  head/sys/sys/kobj.h

Modified: head/sys/sys/kobj.h
==============================================================================
--- head/sys/sys/kobj.h	Mon May 23 01:01:23 2016	(r300442)
+++ head/sys/sys/kobj.h	Mon May 23 03:29:43 2016	(r300443)
@@ -146,13 +146,13 @@ struct kobj_class classvar = {				\
  * DEFINE_CLASS_2(foo, foo_class, foo_methods, sizeof(foo_softc),
  *			  bar, baz);
  */
-#define DEFINE_CLASS_2(name, methods, size,		\
+#define DEFINE_CLASS_2(name, classvar, methods, size,	\
 	               base1, base2)			\
 							\
 static kobj_class_t name ## _baseclasses[] =		\
 	{ &base1,					\
 	  &base2, NULL };				\
-struct kobj_class name ## _class = {			\
+struct kobj_class classvar = {				\
 	#name, methods, size, name ## _baseclasses	\
 }
 
@@ -162,14 +162,14 @@ struct kobj_class name ## _class = {			\
  * DEFINE_CLASS_3(foo, foo_class, foo_methods, sizeof(foo_softc),
  *			  bar, baz, foobar);
  */
-#define DEFINE_CLASS_3(name, methods, size,		\
+#define DEFINE_CLASS_3(name, classvar, methods, size,	\
 		       base1, base2, base3)		\
 							\
 static kobj_class_t name ## _baseclasses[] =		\
 	{ &base1,					\
 	  &base2,					\
 	  &base3, NULL };				\
-struct kobj_class name ## _class = {			\
+struct kobj_class classvar = {				\
 	#name, methods, size, name ## _baseclasses	\
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605230329.u4N3ThxB043997>