diff options
Diffstat (limited to 'lib/alignof.h')
-rw-r--r-- | lib/alignof.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/alignof.h b/lib/alignof.h index 3f4a54257..2ded1c788 100644 --- a/lib/alignof.h +++ b/lib/alignof.h @@ -1,5 +1,5 @@ /* Determine alignment of types. - Copyright (C) 2003-2004, 2006, 2009-2022 Free Software Foundation, Inc. + Copyright (C) 2003-2004, 2006, 2009-2023 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -22,15 +22,14 @@ /* alignof_slot (TYPE) Determine the alignment of a structure slot (field) of a given type, at compile time. Note that the result depends on the ABI. - This is the same as alignof (TYPE) and _Alignof (TYPE), defined in - <stdalign.h> if __alignof_is_defined is 1. + This is the same as alignof (TYPE). Note: The result cannot be used as a value for an 'enum' constant, due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */ #if defined __cplusplus template <class type> struct alignof_helper { char __slot1; type __slot2; }; # define alignof_slot(type) offsetof (alignof_helper<type>, __slot2) #else -# define alignof_slot(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) +# define alignof_slot(type) alignof (type) #endif /* alignof_type (TYPE) |