From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5001 Path: news.gmane.org!not-for-mail From: Pawel Dziepak Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] add definition of max_align_t to stddef.h Date: Wed, 30 Apr 2014 22:23:01 +0200 Message-ID: <1398889381-22981-1-git-send-email-pdziepak@quarnos.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1398890568 27650 80.91.229.3 (30 Apr 2014 20:42:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Apr 2014 20:42:48 +0000 (UTC) Cc: Pawel Dziepak To: musl@lists.openwall.com Original-X-From: musl-return-5005-gllmg-musl=m.gmane.org@lists.openwall.com Wed Apr 30 22:42:42 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WfbKz-00025z-RN for gllmg-musl@plane.gmane.org; Wed, 30 Apr 2014 22:42:41 +0200 Original-Received: (qmail 30281 invoked by uid 550); 30 Apr 2014 20:42:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21724 invoked from network); 30 Apr 2014 20:24:55 -0000 X-Mailer: git-send-email 1.9.0 Xref: news.gmane.org gmane.linux.lib.musl.general:5001 Archived-At: max_align_t is an object type with the strictest alignment supported by the implementation in all contexts. An union is used to "choose" the greater of the two greatest scalar types: long long and long double. Signed-off-by: Pawel Dziepak --- include/alltypes.h.in | 2 ++ include/stddef.h | 1 + 2 files changed, 3 insertions(+) diff --git a/include/alltypes.h.in b/include/alltypes.h.in index c4ca5d5..ec3873f 100644 --- a/include/alltypes.h.in +++ b/include/alltypes.h.in @@ -18,6 +18,8 @@ TYPEDEF unsigned _Int64 uint64_t; TYPEDEF unsigned _Int64 u_int64_t; TYPEDEF unsigned _Int64 uintmax_t; +TYPEDEF union { long double ld; long long ll; } max_align_t; + TYPEDEF unsigned mode_t; TYPEDEF unsigned _Reg nlink_t; TYPEDEF _Int64 off_t; diff --git a/include/stddef.h b/include/stddef.h index 0a32919..cab34d9 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -7,6 +7,7 @@ #define NULL ((void*)0) #endif +#define __NEED_max_align_t #define __NEED_ptrdiff_t #define __NEED_size_t #define __NEED_wchar_t -- 1.9.0