mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-02 03:46:39 +02:00
gmacros: Don’t use __alignof__ in G_ALIGNOF implementation
It has different semantics from _Alignof and our G_STRUCT_OFFSET fallback. See the comments in the diff for details. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://gitlab.gnome.org/GNOME/glib/issues/1055
This commit is contained in:
@@ -1870,11 +1870,16 @@
|
||||
* G_ALIGNOF
|
||||
* @a: a type-name
|
||||
*
|
||||
* Return the minimum alignment required by the platform ABI for values of the given
|
||||
* Return the minimal alignment required by the platform ABI for values of the given
|
||||
* type. The address of a variable or struct member of the given type must always be
|
||||
* a multiple of this alignment. For example, most platforms require int variables
|
||||
* to be aligned at a 4-byte boundary, so `G_ALIGNOF (int)` is 4 on most platforms.
|
||||
*
|
||||
* Note this is not necessarily the same as the value returned by GCC’s
|
||||
* `__alignof__` operator, which returns the preferred alignment for a type.
|
||||
* The preferred alignment may be a stricter alignment than the minimal
|
||||
* alignment.
|
||||
*
|
||||
* Since: 2.60
|
||||
*/
|
||||
|
||||
|
Reference in New Issue
Block a user