Date: Tue, 29 Jun 2010 13:46:14 +0000 From: mdf@FreeBSD.org To: Kostik Belousov <kostikbel@gmail.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209578 - head/sys/sys Message-ID: <AANLkTilxaPfU6s0ZJrWr9QgQ4tHHecNAyFxCP5WG1JUs@mail.gmail.com> In-Reply-To: <20100629084826.GH13238@deviant.kiev.zoral.com.ua> References: <201006281759.o5SHxkoR076207@svn.freebsd.org> <AANLkTilWzaFxFN1gNPVmj_Fwm6j_nmM06eXtEDVHZgjS@mail.gmail.com> <20100629084826.GH13238@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
2010/6/29 Kostik Belousov <kostikbel@gmail.com>: > On Mon, Jun 28, 2010 at 02:07:02PM -0700, Matthew Fleming wrote: >> On Mon, Jun 28, 2010 at 10:59 AM, Konstantin Belousov <kib@freebsd.org> = wrote: >> > Author: kib >> > Date: Mon Jun 28 17:59:45 2010 >> > New Revision: 209578 >> > URL: http://svn.freebsd.org/changeset/base/209578 >> > >> > Log: >> > =A0Use C99 initializers for the struct sysent generated by MAKE_SYSENT= (). >> > >> > =A0MFC after: =A0 =A01 week >> > >> > Modified: >> > =A0head/sys/sys/sysent.h >> > >> > Modified: head/sys/sys/sysent.h >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >> > --- head/sys/sys/sysent.h =A0 =A0 =A0 Mon Jun 28 17:45:00 2010 =A0 =A0= =A0 =A0(r209577) >> > +++ head/sys/sys/sysent.h =A0 =A0 =A0 Mon Jun 28 17:59:45 2010 =A0 =A0= =A0 =A0(r209578) >> > @@ -144,10 +144,10 @@ struct syscall_module_data { >> > >> > =A0#define =A0 =A0 =A0 =A0MAKE_SYSENT(syscallname) =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ >> > =A0static struct sysent syscallname##_sysent =3D { =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0\ >> > - =A0 =A0 =A0 (sizeof(struct syscallname ## _args ) =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 \ >> > + =A0 =A0 =A0 .sy_narg =3D (sizeof(struct syscallname ## _args ) =A0 = =A0 =A0 =A0\ >> > =A0 =A0 =A0 =A0 =A0 =A0/ sizeof(register_t)), =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ >> > - =A0 =A0 =A0 (sy_call_t *)& syscallname, =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 \ >> > - =A0 =A0 =A0 SYS_AUE_##syscallname =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \ >> > + =A0 =A0 =A0 .sy_call =3D (sy_call_t *)& syscallname, =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0\ >> > + =A0 =A0 =A0 .sy_auevent =3D SYS_AUE_##syscallname, =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0\ >> > =A0} >> > >> > =A0#define SYSCALL_MODULE(name, offset, new_sysent, evh, arg) =A0 =A0 = \ >> > >> >> This change prevents (I assume) the use of MAKE_SYSENT() in a C++ >> kernel module, as C++ does not support the .name =3D value style of >> named initializers. >> >> gcc does allow name: value initializers and it's easy to patch it to >> accept .name =3D value, but it's not strictly conforming C++ code >> anymore. > I do not mind reverting this, I think it would be better then > having #ifdef __cplusplus and two definitions. I really wanted to > have a way to provide sparce initializator for the struct sysent. > I managed to not require it for r209579. I agree it's really handy to have sparse initializers; I just haven't thought of a way to do that and continue to allow 3rd party c++ modules. Perhaps we'll get a new c++ standard soon that supports this syntax. :-) Thanks, matthew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTilxaPfU6s0ZJrWr9QgQ4tHHecNAyFxCP5WG1JUs>