aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2015-12-30 03:36:22 +0000
committerWarner Losh <imp@FreeBSD.org>2015-12-30 03:36:22 +0000
commit1cf827546ac127ad4b69e544fcf8e2cf1c1fa4b7 (patch)
treecbc01db7ab94fc0e7ecb1de3e842177a8c97be45 /lib/libc/stdio
parenteabf894627f9e009a5d1bc4f02b1c87fdf13bb12 (diff)
downloadsrc-1cf827546ac127ad4b69e544fcf8e2cf1c1fa4b7.tar.gz
src-1cf827546ac127ad4b69e544fcf8e2cf1c1fa4b7.zip
Use __alignof__ instead of assuming int64_t to get the right
alignment. Differential Revision: https://reviews.freebsd.org/D4708
Notes
Notes: svn path=/head/; revision=292902
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/findfp.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c
index 6a68958d50f4..5e1f06924ac8 100644
--- a/lib/libc/stdio/findfp.c
+++ b/lib/libc/stdio/findfp.c
@@ -99,16 +99,7 @@ moreglue(int n)
FILE *p;
size_t align;
- /*
- * FILE has a mbstate_t variable. This variable tries to be int64_t
- * aligned through its definition. int64_t may be larger than void *,
- * which is the size traditionally used for ALIGNBYTES. So, use our own
- * rounding instead of the MI ALIGN macros. If for some reason
- * ALIGNBYTES is larger than int64_t, respect that too. There appears to
- * be no portable way to ask for FILE's alignment requirements other
- * than just knowing here.
- */
- align = MAX(ALIGNBYTES, sizeof(int64_t));
+ align = __alignof__(FILE);
g = (struct glue *)malloc(sizeof(*g) + align + n * sizeof(FILE));
if (g == NULL)
return (NULL);