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 <land...@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      \
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to