This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Define libc_max_align_t
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 01 Apr 2015 18:18:40 +0200
- Subject: [PATCH] Define libc_max_align_t
- Authentication-results: sourceware.org; auth=none
This came out of the scratch_buffer discussion. As far as I can tell,
this is exactly what GCC uses; I could not find a target-specific
definition there.
--
Florian Weimer / Red Hat Product Security
>From a521ad17ef640ff077eccd997defb4779d7040c3 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 1 Apr 2015 18:14:50 +0200
Subject: [PATCH] Define libc_max_align_t for internal use
---
ChangeLog | 4 ++++
include/libc-internal.h | 7 +++++++
2 files changed, 11 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 3e8df42..cc4daeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-01 Florian Weimer <fweimer@redhat.com>
+
+ * include/libc-internal.h (libc_max_align_t): Define.
+
2015-03-31 H.J. Lu <hongjiu.lu@intel.com>
[BZ #18185]
diff --git a/include/libc-internal.h b/include/libc-internal.h
index bca59a4..9ddf409 100644
--- a/include/libc-internal.h
+++ b/include/libc-internal.h
@@ -107,4 +107,11 @@ extern void __init_misc (int, char **, char **);
#define DIAG_IGNORE_NEEDS_COMMENT(version, option) \
_Pragma (_DIAG_STR (GCC diagnostic ignored option))
+/* This mirrors the C11 max_align_t type provided by GCC, but it is
+ also available in C99 mode. */
+typedef struct {
+ long long ll __attribute__ ((__aligned__ (__alignof__ (long long))));
+ long double ld __attribute__ ((__aligned__ (__alignof__ (long double))));
+} libc_max_align_t;
+
#endif /* _LIBC_INTERNAL */
--
2.1.0