Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jun 2014 07:07:29 -0700
From:      Matthew Fleming <mdf@FreeBSD.org>
To:        Hans Petter Selasky <hselasky@freebsd.org>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>
Subject:   Re: svn commit: r267633 - head/sys/sys
Message-ID:  <CAMBSHm-XQYPc6tH=N3r8WZcY3inwGho8OOfXjuX3hojLQ2e08g@mail.gmail.com>
In-Reply-To: <201406190528.s5J5Sg8m099792@svn.freebsd.org>
References:  <201406190528.s5J5Sg8m099792@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 18, 2014 at 10:28 PM, Hans Petter Selasky
<hselasky@freebsd.org> wrote:
> Author: hselasky
> Date: Thu Jun 19 05:28:42 2014
> New Revision: 267633
> URL: http://svnweb.freebsd.org/changeset/base/267633
>
> Log:
>   Initialize sysctl OID structure by record.
>
>   MFC after:    2 weeks
>
> Modified:
>   head/sys/sys/sysctl.h
>
> Modified: head/sys/sys/sysctl.h
> ==============================================================================
> --- head/sys/sys/sysctl.h       Thu Jun 19 05:10:03 2014        (r267632)
> +++ head/sys/sys/sysctl.h       Thu Jun 19 05:28:42 2014        (r267633)
> @@ -278,19 +278,16 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
>  /* This constructs a "raw" MIB oid. */
>  #define        SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)\
>         static struct sysctl_oid sysctl__##parent##_##name = {          \
> -               &sysctl_##parent##_children,                            \
> -               { NULL },                                               \
> -               nbr,                                                    \
> -               kind,                                                   \
> -               a1,                                                     \
> -               a2,                                                     \
> -               #name,                                                  \
> -               handler,                                                \
> -               fmt,                                                    \
> -               0,                                                      \
> -               0,                                                      \
> -               __DESCR(descr)                                          \
> -               };                                                      \
> +               .oid_parent = &sysctl_##parent##_children,              \
> +               .oid_number = (nbr),                                    \
> +               .oid_kind = (kind),                                     \
> +               .oid_arg1 = (a1),                                       \
> +               .oid_arg2 = (a2),                                       \
> +               .oid_name = #name,                                      \
> +               .oid_handler = (handler),                               \
> +               .oid_fmt = (fmt),                                       \
> +               .oid_descr = __DESCR(descr)                             \
> +       };                                                              \
>         DATA_SET(sysctl_set, sysctl__##parent##_##name)
>
>  #define        SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
>

C++ kernel modules break with this change, as C++ doesn't have the
same syntax for named initializers.

Thanks,
matthew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMBSHm-XQYPc6tH=N3r8WZcY3inwGho8OOfXjuX3hojLQ2e08g>