Date: Sat, 22 Oct 2016 00:00:56 +0000 From: Brooks Davis <brooks@freebsd.org> To: John Baldwin <jhb@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307756 - in head: include sys/sys Message-ID: <20161022000056.GC95989@spindle.one-eyed-alien.net> In-Reply-To: <201610212350.u9LNo2PT031675@repo.freebsd.org> References: <201610212350.u9LNo2PT031675@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 21, 2016 at 11:50:02PM +0000, John Baldwin wrote: > Author: jhb > Date: Fri Oct 21 23:50:02 2016 > New Revision: 307756 > URL: https://svnweb.freebsd.org/changeset/base/307756 >=20 > Log: > Define max_align_t for C11. > =20 > libc++'s stddef.h includes an existing definition of max_align_t for > C++11, but it is only defined for C++, not for C. In addition, GCC and > clang both define an alternate version of max_align_t that uses a > union of multiple types rather than a plain long double as in libc++. > This adds a __max_align_t to <sys/_types.h> that matches the GCC and > clang definition that is mapped to max_align_t in <stddef.h>. > =20 > PR: 210890 > Reviewed by: dim > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D8194 >=20 > Modified: > head/include/stddef.h > head/sys/sys/_types.h >=20 > Modified: head/include/stddef.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/include/stddef.h Fri Oct 21 21:55:50 2016 (r307755) > +++ head/include/stddef.h Fri Oct 21 23:50:02 2016 (r307756) > @@ -62,6 +62,14 @@ typedef ___wchar_t wchar_t; > #endif > #endif > =20 > +#if __STDC_VERSION__ >=3D 201112L || __cplusplus >=3D 201103L > +#ifndef __CLANG_MAX_ALIGN_T_DEFINED > +typedef __max_align_t max_align_t; > +#define __CLANG_MAX_ALIGN_T_DEFINED > +#define __GCC_MAX_ALIGN_T > +#endif > +#endif > + > #define offsetof(type, member) __offsetof(type, member) > =20 > #endif /* _STDDEF_H_ */ >=20 > Modified: head/sys/sys/_types.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/_types.h Fri Oct 21 21:55:50 2016 (r307755) > +++ head/sys/sys/_types.h Fri Oct 21 23:50:02 2016 (r307756) > @@ -100,6 +100,11 @@ typedef __uint_least32_t __char32_t; > #define _CHAR32_T_DECLARED > #endif > =20 > +typedef struct { Should this be union per the commit message? Ideally I'd add a void * as well since that will support systems like CHERI where pointers are the largest type. -- Brooks > + long long __max_align1 __aligned(_Alignof(long long)); > + long double __max_align2 __aligned(_Alignof(long double)); > +} __max_align_t; > + > typedef __uint32_t __dev_t; /* device number */ > =20 > typedef __uint32_t __fixpt_t; /* fixed point number */ >=20 --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYCqw3AAoJEKzQXbSebgfAFIYH/2VgcVD8iQ3ZJl1tvwQ1kkGr 6B1SfJbQGYWflM+I9kK640vKr7pLgVDtVuiNVFIbp4046b/i2Sj8c0T9Cx+epKw9 0YHI+7GeT67JHFX5YBQFuzTBkyIiYGFPGy8uh5bkN56iUJmS9Swx1ncgVz2zG3jA RnM2f3i+lr1PoD6aycPiWAuL/ppQy4XL9I8rSzi5DxQZKPQiO1J5sizEYhGi7zip tofEKf1eb5ofqNDVjnBNyyrYa3KYqjXIYFEdWe0qv9eM1d17ENL9wa1VpJegx5Eb 2x9HlLO0v9l/OEYSDLLQrNvyL84tus7obA1drki5qEEjkZvZuQwrU6+uNNi+CLc= =5rhX -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161022000056.GC95989>