Feature #2466 ยป 0070-gnulib-common.m4-Update-to-serial-126.patch
| dependencies/m4/gnulib-common.m4 | ||
|---|---|---|
|
# gnulib-common.m4
|
||
|
# serial 125
|
||
|
# serial 126
|
||
|
dnl Copyright (C) 2007-2026 Free Software Foundation, Inc.
|
||
|
dnl This file is free software; the Free Software Foundation
|
||
|
dnl gives unlimited permission to copy and/or distribute it,
|
||
| ... | ... | |
|
/* The following lines list the first GCC version that supports the attribute.
|
||
|
Although the lines are not used in GCC 5 and later (as GCC 5 introduced
|
||
|
__has_attribute support), list GCC versions 5+ anyway for completeness. */
|
||
|
# define _GL_ATTR_access _GL_GNUC_PREREQ (10, 1)
|
||
|
# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
|
||
|
# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
|
||
|
# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
|
||
| ... | ... | |
|
- In C, before the 'extern' keyword.
|
||
|
- In C++, between the 'extern "C"' and the variable's type.
|
||
|
*/
|
||
|
/* _GL_ATTRIBUTE_ACCESS_READ_ONLY ((N, S)) declares that the Nth argument of
|
||
|
the function is used to read the referenced object but not to write to it.
|
||
|
_GL_ATTRIBUTE_ACCESS_WRITE_ONLY ((N, S)) declares that the Nth argument of
|
||
|
the function is used to write the referenced object but not to read from it.
|
||
|
_GL_ATTRIBUTE_ACCESS_READ_WRITE ((N, S)) declares that the Nth argument of
|
||
|
the function is used to both read from and write to the referenced object.
|
||
|
_GL_ATTRIBUTE_ACCESS_NONE ((N, S)) declares that the Nth argument of the
|
||
|
function is not used to access the referenced object at all.
|
||
|
Each of the _GL_ATTRIBUTE_ACCESS_* macros accepts an optional size index S,
|
||
|
which specifies the position of the argument indicating the maximum size of
|
||
|
the access, in elements. The size of each element is determined by the type
|
||
|
of the Nth argument, or is 1 if that argument is a void pointer. The memory
|
||
|
pointed to by the sized object is not required to be initialized. These
|
||
|
macros specify how the object being pointed to can be accessed, not that the
|
||
|
access will happen. They also do not imply whether or not the pointer is or
|
||
|
can be NULL. This information can be specified by combining the
|
||
|
_GL_ATTRIBUTE_ACCESS_* macros with _GL_ATTRIBUTE_NONNULL or
|
||
|
_GL_ATTRIBUTE_NONNULL_IF_NONZERO.
|
||
|
*/
|
||
|
/* Applies to: functions. */
|
||
|
/* Clang does not support these attributes. */
|
||
|
#ifndef _GL_ATTRIBUTE_ACCESS_READ_ONLY
|
||
|
# if _GL_HAS_ATTRIBUTE (access) && ! defined __clang__
|
||
|
# define _GL_ATTRIBUTE_ACCESS_READ_ONLY(args) \
|
||
|
__attribute__ ((__access__ (__read_only__, args)))
|
||
|
# define _GL_ATTRIBUTE_ACCESS_WRITE_ONLY(args) \
|
||
|
__attribute__ ((__access__ (__write_only__, args)))
|
||
|
# define _GL_ATTRIBUTE_ACCESS_READ_WRITE(args) \
|
||
|
__attribute__ ((__access__ (__read_write__, args)))
|
||
|
# if _GL_GNUC_PREREQ (11, 1)
|
||
|
# define _GL_ATTRIBUTE_ACCESS_NONE(args) \
|
||
|
__attribute__ ((__access__ (__none__, args)))
|
||
|
# else
|
||
|
# define _GL_ATTRIBUTE_ACCESS_NONE(args)
|
||
|
# endif
|
||
|
# else
|
||
|
# define _GL_ATTRIBUTE_ACCESS_READ_ONLY(args)
|
||
|
# define _GL_ATTRIBUTE_ACCESS_WRITE_ONLY(args)
|
||
|
# define _GL_ATTRIBUTE_ACCESS_READ_WRITE(args)
|
||
|
# define _GL_ATTRIBUTE_ACCESS_NONE(args)
|
||
|
# endif
|
||
|
#endif
|
||
|
]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead.
|
||
|
[
|
||
|
/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function
|
||