summaryrefslogtreecommitdiff
path: root/lib/flexmember.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2025-10-18 19:07:35 +0200
committerJörg Frings-Fürst <debian@jff.email>2025-10-18 19:07:35 +0200
commitfa23d938c040bc8af305a31fa874df55b2a02576 (patch)
tree9704e2f7bd8962ea8911cd6f4e2d37227d7eff2e /lib/flexmember.h
parentdf9dbf9b0915e432a4a2c4182f60af36374eaaab (diff)
parent693ae7b71dfdd1a8146266b5794a71c0dbe5dff0 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'lib/flexmember.h')
-rw-r--r--lib/flexmember.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/flexmember.h b/lib/flexmember.h
index 6ef66a32..b4d86c29 100644
--- a/lib/flexmember.h
+++ b/lib/flexmember.h
@@ -1,6 +1,6 @@
/* Sizes of structs with flexible array members.
- Copyright 2016-2024 Free Software Foundation, Inc.
+ Copyright 2016-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -28,11 +28,12 @@
#include <stddef.h>
/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below.
- On older platforms without _Alignof, use a pessimistic bound that is
+ If _Alignof might not exist or might not work correctly on
+ structs with flexible array members, use a pessimistic bound that is
safe in practice even if FLEXIBLE_ARRAY_MEMBER is 1.
- On newer platforms, use _Alignof to get a tighter bound. */
+ Otherwise, use _Alignof to get a tighter bound. */
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 || defined _Alignof
# define FLEXALIGNOF(type) (sizeof (type) & ~ (sizeof (type) - 1))
#else
# define FLEXALIGNOF(type) _Alignof (type)