Mercurial > hg > octave-kai > gnulib-hg
changeset 12503:92194f05b35f
selinux-h: Make generated .h files standalone.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 25 Dec 2009 13:51:48 +0100 |
parents | 5bdbb871dd27 |
children | 017cf2a9b0ce |
files | ChangeLog lib/se-context.in.h lib/se-selinux.in.h modules/selinux-h |
diffstat | 4 files changed, 59 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-12-25 Bruno Haible <bruno@clisp.org> + + selinux-h: Make generated .h files standalone. + * lib/se-context.in.h: Arrange to include _GL_UNUSED_PARAMETER + definition. Use _GL_UNUSED_PARAMETER instead of _GL_UNUSED. + * lib/se-selinux.in.h: Likewise. + * modules/selinux-h (Depends-on): Add unused-parameter. + (Makefile.am): Insert definition of _GL_UNUSED_PARAMETER into + selinux/selinux.h and selinux/context.h. + Suggested by Eric Blake. + 2009-12-25 Bruno Haible <bruno@clisp.org> Move gl_FCNTL_O_FLAGS to a separate .m4 file.
--- a/lib/se-context.in.h +++ b/lib/se-context.in.h @@ -3,24 +3,26 @@ # include <errno.h> +/* The definition of _GL_UNUSED_PARAMETER is copied here. */ + typedef int context_t; -static inline context_t context_new (char const *s _GL_UNUSED) +static inline context_t context_new (char const *s _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return 0; } -static inline char *context_str (context_t con _GL_UNUSED) +static inline char *context_str (context_t con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return (void *) 0; } -static inline void context_free (context_t c _GL_UNUSED) {} +static inline void context_free (context_t c _GL_UNUSED_PARAMETER) {} -static inline int context_user_set (context_t sc _GL_UNUSED, - char const *s _GL_UNUSED) +static inline int context_user_set (context_t sc _GL_UNUSED_PARAMETER, + char const *s _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int context_role_set (context_t sc _GL_UNUSED, - char const *s _GL_UNUSED) +static inline int context_role_set (context_t sc _GL_UNUSED_PARAMETER, + char const *s _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int context_range_set (context_t sc _GL_UNUSED, - char const *s _GL_UNUSED) +static inline int context_range_set (context_t sc _GL_UNUSED_PARAMETER, + char const *s _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int context_type_set (context_t sc _GL_UNUSED, - char const *s _GL_UNUSED) +static inline int context_type_set (context_t sc _GL_UNUSED_PARAMETER, + char const *s _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } #endif
--- a/lib/se-selinux.in.h +++ b/lib/se-selinux.in.h @@ -14,59 +14,61 @@ # include <sys/types.h> # include <errno.h> +/* The definition of _GL_UNUSED_PARAMETER is copied here. */ + typedef unsigned short security_class_t; # define security_context_t char* # define is_selinux_enabled() 0 -static inline int getcon (security_context_t *con _GL_UNUSED) +static inline int getcon (security_context_t *con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline void freecon (security_context_t con _GL_UNUSED) {} +static inline void freecon (security_context_t con _GL_UNUSED_PARAMETER) {} -static inline int getfscreatecon (security_context_t *con _GL_UNUSED) +static inline int getfscreatecon (security_context_t *con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int setfscreatecon (security_context_t con _GL_UNUSED) +static inline int setfscreatecon (security_context_t con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int matchpathcon (char const *file _GL_UNUSED, - mode_t m _GL_UNUSED, - security_context_t *con _GL_UNUSED) +static inline int matchpathcon (char const *file _GL_UNUSED_PARAMETER, + mode_t m _GL_UNUSED_PARAMETER, + security_context_t *con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int getfilecon (char const *file _GL_UNUSED, - security_context_t *con _GL_UNUSED) +static inline int getfilecon (char const *file _GL_UNUSED_PARAMETER, + security_context_t *con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int lgetfilecon (char const *file _GL_UNUSED, - security_context_t *con _GL_UNUSED) +static inline int lgetfilecon (char const *file _GL_UNUSED_PARAMETER, + security_context_t *con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } static inline int fgetfilecon (int fd, - security_context_t *con _GL_UNUSED) + security_context_t *con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int setfilecon (char const *file _GL_UNUSED, - security_context_t con _GL_UNUSED) +static inline int setfilecon (char const *file _GL_UNUSED_PARAMETER, + security_context_t con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int lsetfilecon (char const *file _GL_UNUSED, - security_context_t con _GL_UNUSED) +static inline int lsetfilecon (char const *file _GL_UNUSED_PARAMETER, + security_context_t con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int fsetfilecon (int fd _GL_UNUSED, - security_context_t con _GL_UNUSED) +static inline int fsetfilecon (int fd _GL_UNUSED_PARAMETER, + security_context_t con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } static inline int security_check_context - (security_context_t con _GL_UNUSED) + (security_context_t con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } static inline int security_check_context_raw - (security_context_t con _GL_UNUSED) + (security_context_t con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } -static inline int setexeccon (security_context_t con _GL_UNUSED) +static inline int setexeccon (security_context_t con _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } static inline int security_compute_create - (security_context_t scon _GL_UNUSED, - security_context_t tcon _GL_UNUSED, - security_class_t tclass _GL_UNUSED, - security_context_t *newcon _GL_UNUSED) + (security_context_t scon _GL_UNUSED_PARAMETER, + security_context_t tcon _GL_UNUSED_PARAMETER, + security_class_t tclass _GL_UNUSED_PARAMETER, + security_context_t *newcon _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } static inline int matchpathcon_init_prefix - (char const *path _GL_UNUSED, - char const *prefix _GL_UNUSED) + (char const *path _GL_UNUSED_PARAMETER, + char const *prefix _GL_UNUSED_PARAMETER) { errno = ENOTSUP; return -1; } # endif
--- a/modules/selinux-h +++ b/modules/selinux-h @@ -10,6 +10,7 @@ Depends-on: errno +unused-parameter configure.ac: gl_HEADERS_SELINUX_SELINUX_H @@ -27,6 +28,7 @@ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_SELINUX_SELINUX_H''@|$(NEXT_SELINUX_SELINUX_H)|g' \ + -e '/definition of _GL_UNUSED_PARAMETER/r $(UNUSED_PARAMETER_H)' \ < $(srcdir)/se-selinux.in.h; \ } > $@-t && \ chmod a-x $@-t && \ @@ -37,7 +39,10 @@ selinux/context.h: se-context.in.h $(AM_V_at)$(MKDIR_P) selinux $(AM_V_GEN)rm -f $@-t $@ && \ - cp $(srcdir)/se-context.in.h $@-t && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e '/definition of _GL_UNUSED_PARAMETER/r $(UNUSED_PARAMETER_H)' \ + < $(srcdir)/se-context.in.h; \ + } > $@-t && \ chmod a-x $@-t && \ mv $@-t $@ MOSTLYCLEANFILES += selinux/context.h selinux/context.h-t