From owner-svn-src-stable@freebsd.org Mon Nov 28 18:36:38 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86074C5990A; Mon, 28 Nov 2016 18:36:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B4021915; Mon, 28 Nov 2016 18:36:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASIab1d010492; Mon, 28 Nov 2016 18:36:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASIablV010490; Mon, 28 Nov 2016 18:36:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201611281836.uASIablV010490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 28 Nov 2016 18:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309258 - in stable: 10/include 10/sys/sys 11/include 11/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 18:36:38 -0000 Author: jhb Date: Mon Nov 28 18:36:37 2016 New Revision: 309258 URL: https://svnweb.freebsd.org/changeset/base/309258 Log: MFC 307756: Define max_align_t for C11. 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 that matches the GCC and clang definition that is mapped to max_align_t in . PR: 210890 Modified: stable/10/include/stddef.h stable/10/sys/sys/_types.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/include/stddef.h stable/11/sys/sys/_types.h Directory Properties: stable/11/ (props changed) Modified: stable/10/include/stddef.h ============================================================================== --- stable/10/include/stddef.h Mon Nov 28 17:55:32 2016 (r309257) +++ stable/10/include/stddef.h Mon Nov 28 18:36:37 2016 (r309258) @@ -59,6 +59,14 @@ typedef ___wchar_t wchar_t; #endif #endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 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) #endif /* _STDDEF_H_ */ Modified: stable/10/sys/sys/_types.h ============================================================================== --- stable/10/sys/sys/_types.h Mon Nov 28 17:55:32 2016 (r309257) +++ stable/10/sys/sys/_types.h Mon Nov 28 18:36:37 2016 (r309258) @@ -99,6 +99,11 @@ typedef __uint_least32_t __char32_t; #define _CHAR32_T_DECLARED #endif +typedef struct { + 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 */ typedef __uint32_t __fixpt_t; /* fixed point number */