diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-07-30 12:56:24 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-07-31 12:00:34 -0700 |
commit | 786bb6fb17d698eb175942606db8fb129e231474 (patch) | |
tree | 531d2f0f261eb9540f454a650ee78a8915139a51 /lib/se-selinux.in.h | |
parent | c44470fb95020b371e31202bf2884ca021b3dd73 (diff) | |
download | gnulib-786bb6fb17d698eb175942606db8fb129e231474.tar.gz |
gnulib-common: update for C2x 2020-12-11 draft
Use blessed-by-draft-standard way to test for [[__deprecated__]]
etc.; this is supported by GCC 11 and the fallback code should
work fine with GCC 10 and earlier, clang, etc.
* NEWS, doc/attribute.texi:
Mention that DEPRECATED etc. must now come first.
* lib/fflush.c, lib/unistr.in.h:
Do not include unused-parameter.h. All uses of _GL_UNUSED_PARAMETER
(after parameters) replaced by _GL_ATTRIBUTE_MAYBE_UNUSED (before
parameters). Although perhaps we need a shorter name for
_GL_ATTRIBUTE_MAYBE_UNUSED, that should probably be in
gnulib-common.m4, due to the ubiquity of this issue.
And perhaps the snippet/unused-parameter module should be marked
obsolete since it's no longer compatible with its old use.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macro
_GL_HAS_C_ATTRIBUTE, and use it instead of __STDC_VERSION__ in
deciding whether to use C2x attributes like [[__deprecated__]].
(_GL_ATTRIBUTE_MAYBE_UNUSED): Fall back on _GL_ATTRIBUTE_UNUSED.
(_GL_ATTRIBUTE_UNUSED): New macro, for labels where C2x
[[maybe_unused]] do not work.
(_GL_UNUSED, _GL_UNUSED_LABEL): Use it.
* modules/fflush, modules/unistr/base (Depends-on):
Remove snippet/unused-parameter.
* modules/fflush (selinux/selinux.h, selinux/context.h)
(selinux/label.h): Do not use $(UNUSED_PARAMETER).
Remove useless chmod a-x.
Diffstat (limited to 'lib/se-selinux.in.h')
-rw-r--r-- | lib/se-selinux.in.h | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/lib/se-selinux.in.h b/lib/se-selinux.in.h index 60cc493e69..85dae11810 100644 --- a/lib/se-selinux.in.h +++ b/lib/se-selinux.in.h @@ -38,8 +38,6 @@ _GL_INLINE_HEADER_BEGIN # define SE_SELINUX_INLINE _GL_INLINE # endif -/* The definition of _GL_UNUSED_PARAMETER is copied here. */ - # if !GNULIB_defined_security_types typedef unsigned short security_class_t; @@ -47,67 +45,67 @@ struct selinux_opt; # define is_selinux_enabled() 0 SE_SELINUX_INLINE int -getcon (char **con _GL_UNUSED_PARAMETER) +getcon (_GL_ATTRIBUTE_MAYBE_UNUSED char **con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE void -freecon (char *con _GL_UNUSED_PARAMETER) {} +freecon (_GL_ATTRIBUTE_MAYBE_UNUSED char *con) {} SE_SELINUX_INLINE int -getfscreatecon (char **con _GL_UNUSED_PARAMETER) +getfscreatecon (_GL_ATTRIBUTE_MAYBE_UNUSED char **con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -setfscreatecon (char const *con _GL_UNUSED_PARAMETER) +setfscreatecon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -matchpathcon (char const *file _GL_UNUSED_PARAMETER, - mode_t m _GL_UNUSED_PARAMETER, - char **con _GL_UNUSED_PARAMETER) +matchpathcon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *file, + _GL_ATTRIBUTE_MAYBE_UNUSED mode_t m, + _GL_ATTRIBUTE_MAYBE_UNUSED char **con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -getfilecon (char const *file _GL_UNUSED_PARAMETER, - char **con _GL_UNUSED_PARAMETER) +getfilecon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *file, + _GL_ATTRIBUTE_MAYBE_UNUSED char **con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -lgetfilecon (char const *file _GL_UNUSED_PARAMETER, - char **con _GL_UNUSED_PARAMETER) +lgetfilecon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *file, + _GL_ATTRIBUTE_MAYBE_UNUSED char **con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -fgetfilecon (int fd, char **con _GL_UNUSED_PARAMETER) +fgetfilecon (int fd,_GL_ATTRIBUTE_MAYBE_UNUSED char **con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -setfilecon (char const *file _GL_UNUSED_PARAMETER, - char const *con _GL_UNUSED_PARAMETER) +setfilecon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *file, + _GL_ATTRIBUTE_MAYBE_UNUSED char const *con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -lsetfilecon (char const *file _GL_UNUSED_PARAMETER, - char const *con _GL_UNUSED_PARAMETER) +lsetfilecon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *file, + _GL_ATTRIBUTE_MAYBE_UNUSED char const *con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -fsetfilecon (int fd _GL_UNUSED_PARAMETER, - char const *con _GL_UNUSED_PARAMETER) +fsetfilecon (_GL_ATTRIBUTE_MAYBE_UNUSED int fd, + _GL_ATTRIBUTE_MAYBE_UNUSED char const *con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -security_check_context (char const *con _GL_UNUSED_PARAMETER) +security_check_context (_GL_ATTRIBUTE_MAYBE_UNUSED char const *con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -security_check_context_raw (char const *con _GL_UNUSED_PARAMETER) +security_check_context_raw (_GL_ATTRIBUTE_MAYBE_UNUSED char const *con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -setexeccon (char const *con _GL_UNUSED_PARAMETER) +setexeccon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *con) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE int -security_compute_create (char const *scon _GL_UNUSED_PARAMETER, - char const *tcon _GL_UNUSED_PARAMETER, - security_class_t tclass _GL_UNUSED_PARAMETER, - char **newcon _GL_UNUSED_PARAMETER) +security_compute_create (_GL_ATTRIBUTE_MAYBE_UNUSED char const *scon, + _GL_ATTRIBUTE_MAYBE_UNUSED char const *tcon, + _GL_ATTRIBUTE_MAYBE_UNUSED security_class_t tclass, + _GL_ATTRIBUTE_MAYBE_UNUSED char **newcon) { errno = ENOTSUP; return -1; } SE_SELINUX_INLINE security_class_t string_to_security_class (char const *name) { errno = ENOTSUP; return 0; } SE_SELINUX_INLINE int -matchpathcon_init_prefix (char const *path _GL_UNUSED_PARAMETER, - char const *prefix _GL_UNUSED_PARAMETER) +matchpathcon_init_prefix (_GL_ATTRIBUTE_MAYBE_UNUSED char const *path, + _GL_ATTRIBUTE_MAYBE_UNUSED char const *prefix) { errno = ENOTSUP; return -1; } # define GNULIB_defined_security_types 1 |