summaryrefslogtreecommitdiff
path: root/lib/se-context.in.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-11-20 22:25:06 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-11-29 23:38:51 -0800
commit2a7c405b01fb6c89664fe15554d96854efb3f837 (patch)
treeee58fcb75e6cae2b064f1779b97e4db6138e14f2 /lib/se-context.in.h
parent1615c2e6bca01fbc7355043d2218c7c1dce453f5 (diff)
downloadgnulib-2a7c405b01fb6c89664fe15554d96854efb3f837.tar.gz
selinux-h: better 'inline'
* lib/se-context.c, lib/se-selinux.c: New files. * lib/getfilecon.c (map_to_failure): Omit 'inline' for static function. * lib/se-context.in.h (SE_CONTEXT_INLINE): New macro. Replace all uses of 'static inline' with it. Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END. * lib/se-selinux.in.h (SE_SELINUX_INLINE): New macro. Replace all uses of 'static inline' with it. Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END. * modules/selinux-h (Files, lib_SOURCES): Add lib/se-context.c, lib/se-selinux.c. (Depends-on): Add extern-inline. (configure.ac): Do not require AC_C_INLINE.
Diffstat (limited to 'lib/se-context.in.h')
-rw-r--r--lib/se-context.in.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/lib/se-context.in.h b/lib/se-context.in.h
index cb7419a568..a692f5a060 100644
--- a/lib/se-context.in.h
+++ b/lib/se-context.in.h
@@ -3,26 +3,33 @@
# include <errno.h>
+_GL_INLINE_HEADER_BEGIN
+#ifndef SE_CONTEXT_INLINE
+# define SE_CONTEXT_INLINE _GL_INLINE
+#endif
+
/* The definition of _GL_UNUSED_PARAMETER is copied here. */
typedef int context_t;
-static inline context_t context_new (char const *s _GL_UNUSED_PARAMETER)
+SE_CONTEXT_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_PARAMETER)
+SE_CONTEXT_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_PARAMETER) {}
+SE_CONTEXT_INLINE void context_free (context_t c _GL_UNUSED_PARAMETER) {}
-static inline int context_user_set (context_t sc _GL_UNUSED_PARAMETER,
- char const *s _GL_UNUSED_PARAMETER)
+SE_CONTEXT_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_PARAMETER,
- char const *s _GL_UNUSED_PARAMETER)
+SE_CONTEXT_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_PARAMETER,
- char const *s _GL_UNUSED_PARAMETER)
+SE_CONTEXT_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_PARAMETER,
- char const *s _GL_UNUSED_PARAMETER)
+SE_CONTEXT_INLINE int context_type_set (context_t sc _GL_UNUSED_PARAMETER,
+ char const *s _GL_UNUSED_PARAMETER)
{ errno = ENOTSUP; return -1; }
+_GL_INLINE_HEADER_END
+
#endif