bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/9] acl, mbchar, priv-set: use extern-inline


From: Paul Eggert
Subject: [PATCH 5/9] acl, mbchar, priv-set: use extern-inline
Date: Wed, 29 Aug 2012 23:24:26 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0

* lib/set-mode-acl.c, lib/acl-internal.h (ACL_INTERNAL_INLINE):
* lib/mbchar.c, lib/mbchar.h (MBCHAR_INLINE):
* lib/priv-set.c, lib/priv-set.h (PRIV_SET_INLINE):
New macros.
* lib/acl-internal.h, lib/mbchar.h, lib/priv-set.h:
Replace all uses of 'static inline' with it.
Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
* m4/acl.m4 (gl_FUNC_ACL):
* m4/mbchar.m4 (gl_MBCHAR):
* m4/priv-set.m4 (gl_PRIV_SET):
Remove AC_C_INLINE, since 'inline' is no longer used directly.
* modules/acl, modules/mbchar, modules/priv-set (Depends-on):
Add extern-inline.
---
 ChangeLog          | 15 +++++++++++++++
 lib/acl-internal.h | 11 +++++++++--
 lib/mbchar.c       |  2 ++
 lib/mbchar.h       | 15 +++++++++++----
 lib/priv-set.c     |  3 +++
 lib/priv-set.h     | 19 +++++++++++++++----
 lib/set-mode-acl.c |  2 ++
 m4/acl.m4          |  3 +--
 m4/mbchar.m4       |  3 +--
 m4/priv-set.m4     |  3 +--
 modules/acl        |  1 +
 modules/mbchar     |  1 +
 modules/priv-set   |  1 +
 13 files changed, 63 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3124aa3..779ab5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2012-08-29  Paul Eggert  <address@hidden>
 
+       acl, mbchar, priv-set: use extern-inline
+       * lib/set-mode-acl.c, lib/acl-internal.h (ACL_INTERNAL_INLINE):
+       * lib/mbchar.c, lib/mbchar.h (MBCHAR_INLINE):
+       * lib/priv-set.c, lib/priv-set.h (PRIV_SET_INLINE):
+       New macros.
+       * lib/acl-internal.h, lib/mbchar.h, lib/priv-set.h:
+       Replace all uses of 'static inline' with it.
+       Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+       * m4/acl.m4 (gl_FUNC_ACL):
+       * m4/mbchar.m4 (gl_MBCHAR):
+       * m4/priv-set.m4 (gl_PRIV_SET):
+       Remove AC_C_INLINE, since 'inline' is no longer used directly.
+       * modules/acl, modules/mbchar, modules/priv-set (Depends-on):
+       Add extern-inline.
+
        sockets, sys_stat: remove AC_C_INLINE in MSVC-only cases
        * m4/sockets.m4 (gl_SOCKETS):
        * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H):
diff --git a/lib/acl-internal.h b/lib/acl-internal.h
index 7fe0a87..a6974d9 100644
--- a/lib/acl-internal.h
+++ b/lib/acl-internal.h
@@ -82,6 +82,11 @@ extern int aclsort (int, int, struct acl *);
      ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY)
 #endif
 
+_GL_INLINE_HEADER_BEGIN
+#ifndef ACL_INTERNAL_INLINE
+# define ACL_INTERNAL_INLINE _GL_INLINE
+#endif
+
 #if USE_ACL
 
 # if HAVE_ACL_GET_FILE
@@ -97,7 +102,7 @@ extern int aclsort (int, int, struct acl *);
 /* Most platforms have a 1-argument acl_get_fd, only OSF/1 has a 2-argument
    macro(!).  */
 #   if HAVE_ACL_FREE_TEXT /* OSF/1 */
-static inline acl_t
+ACL_INTERNAL_INLINE acl_t
 rpl_acl_get_fd (int fd)
 {
   return acl_get_fd (fd, ACL_TYPE_ACCESS);
@@ -116,7 +121,7 @@ rpl_acl_get_fd (int fd)
 /* Most platforms have a 2-argument acl_set_fd, only OSF/1 has a 3-argument
    macro(!).  */
 #   if HAVE_ACL_FREE_TEXT /* OSF/1 */
-static inline int
+ACL_INTERNAL_INLINE int
 rpl_acl_set_fd (int fd, acl_t acl)
 {
   return acl_set_fd (fd, ACL_TYPE_ACCESS, acl);
@@ -263,3 +268,5 @@ extern int acl_nontrivial (int count, struct acl *entries);
 # endif
 
 #endif
+
+_GL_INLINE_HEADER_END
diff --git a/lib/mbchar.c b/lib/mbchar.c
index 1070951..9d372a7 100644
--- a/lib/mbchar.c
+++ b/lib/mbchar.c
@@ -16,6 +16,8 @@
 
 #include <config.h>
 
+#define MBCHAR_INLINE _GL_EXTERN_INLINE
+
 #include <limits.h>
 
 #include "mbchar.h"
diff --git a/lib/mbchar.h b/lib/mbchar.h
index ccbcb82..001f743 100644
--- a/lib/mbchar.h
+++ b/lib/mbchar.h
@@ -156,6 +156,11 @@
 #include <wchar.h>
 #include <wctype.h>
 
+_GL_INLINE_HEADER_BEGIN
+#ifndef MBCHAR_INLINE
+# define MBCHAR_INLINE _GL_INLINE
+#endif
+
 #define MBCHAR_BUF_SIZE 24
 
 struct mbchar
@@ -235,7 +240,7 @@ typedef struct mbchar mbchar_t;
 /* Unprintable characters appear as a small box of width 1.  */
 #define MB_UNPRINTABLE_WIDTH 1
 
-static inline int
+MBCHAR_INLINE int
 mb_width_aux (wint_t wc)
 {
   int w = wcwidth (wc);
@@ -256,7 +261,7 @@ mb_width_aux (wint_t wc)
    (mbc)->wc = (mbc)->buf[0] = (sc))
 
 /* Copying a character.  */
-static inline void
+MBCHAR_INLINE void
 mb_copy (mbchar_t *new_mbc, const mbchar_t *old_mbc)
 {
   if (old_mbc->ptr == &old_mbc->buf[0])
@@ -304,7 +309,7 @@ mb_copy (mbchar_t *new_mbc, const mbchar_t *old_mbc)
 
 extern const unsigned int is_basic_table[];
 
-static inline bool
+MBCHAR_INLINE bool
 is_basic (char c)
 {
   return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31))
@@ -313,7 +318,7 @@ is_basic (char c)
 
 #else
 
-static inline bool
+MBCHAR_INLINE bool
 is_basic (char c)
 {
   switch (c)
@@ -347,4 +352,6 @@ is_basic (char c)
 
 #endif
 
+_GL_INLINE_HEADER_END
+
 #endif /* _MBCHAR_H */
diff --git a/lib/priv-set.c b/lib/priv-set.c
index f7f6cb9..25f3229 100644
--- a/lib/priv-set.c
+++ b/lib/priv-set.c
@@ -18,6 +18,9 @@
    Written by David Bartley.  */
 
 #include <config.h>
+
+#define PRIV_SET_INLINE _GL_EXTERN_INLINE
+
 #include "priv-set.h"
 
 #if HAVE_GETPPRIV && HAVE_PRIV_H
diff --git a/lib/priv-set.h b/lib/priv-set.h
index 707a5bf..bd1527a 100644
--- a/lib/priv-set.h
+++ b/lib/priv-set.h
@@ -17,6 +17,11 @@
 
    Written by David Bartley.  */
 
+_GL_INLINE_HEADER_BEGIN
+#ifndef PRIV_SET_INLINE
+# define PRIV_SET_INLINE _GL_INLINE
+#endif
+
 #if HAVE_GETPPRIV && HAVE_PRIV_H
 
 # include <priv.h>
@@ -25,26 +30,32 @@ int priv_set_ismember (const char *priv);
 int priv_set_remove (const char *priv);
 int priv_set_restore (const char *priv);
 
-static inline int priv_set_remove_linkdir (void)
+PRIV_SET_INLINE int
+priv_set_remove_linkdir (void)
 {
   return priv_set_remove (PRIV_SYS_LINKDIR);
 }
 
-static inline int priv_set_restore_linkdir (void)
+PRIV_SET_INLINE int
+priv_set_restore_linkdir (void)
 {
   return priv_set_restore (PRIV_SYS_LINKDIR);
 }
 
 #else
 
-static inline int priv_set_remove_linkdir (void)
+PRIV_SET_INLINE int
+priv_set_remove_linkdir (void)
 {
   return -1;
 }
 
-static inline int priv_set_restore_linkdir (void)
+PRIV_SET_INLINE int
+priv_set_restore_linkdir (void)
 {
   return -1;
 }
 
 #endif
+
+_GL_INLINE_HEADER_END
diff --git a/lib/set-mode-acl.c b/lib/set-mode-acl.c
index e0c8123..c7a8343 100644
--- a/lib/set-mode-acl.c
+++ b/lib/set-mode-acl.c
@@ -19,6 +19,8 @@
 
 #include <config.h>
 
+#define ACL_INTERNAL_INLINE _GL_EXTERN_INLINE
+
 #include "acl.h"
 
 #include "acl-internal.h"
diff --git a/m4/acl.m4 b/m4/acl.m4
index 19aa548..2883621 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
 # acl.m4 - check for access control list (ACL) primitives
-# serial 14
+# serial 15
 
 # Copyright (C) 2002, 2004-2012 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -16,7 +16,6 @@ AC_DEFUN([gl_FUNC_ACL],
 
   LIB_ACL=
   use_acl=0
-  AC_REQUIRE([AC_C_INLINE])
   if test "x$enable_acl" != "xno"; then
     dnl On all platforms, the ACL related API is declared in <sys/acl.h>.
     AC_CHECK_HEADERS([sys/acl.h])
diff --git a/m4/mbchar.m4 b/m4/mbchar.m4
index 77af4b4..5650381 100644
--- a/m4/mbchar.m4
+++ b/m4/mbchar.m4
@@ -1,4 +1,4 @@
-# mbchar.m4 serial 8
+# mbchar.m4 serial 9
 dnl Copyright (C) 2005-2007, 2009-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,5 +10,4 @@ dnl From Bruno Haible.
 AC_DEFUN([gl_MBCHAR],
 [
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-  AC_REQUIRE([AC_C_INLINE])
 ])
diff --git a/m4/priv-set.m4 b/m4/priv-set.m4
index 538757b..0ccaf52 100644
--- a/m4/priv-set.m4
+++ b/m4/priv-set.m4
@@ -1,4 +1,4 @@
-# serial 7
+# serial 8
 
 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
 #
@@ -10,7 +10,6 @@
 
 AC_DEFUN([gl_PRIV_SET],
 [
-  AC_REQUIRE([AC_C_INLINE])
   AC_CHECK_FUNCS([getppriv])
   AC_CHECK_HEADERS_ONCE([priv.h])
 ])
diff --git a/modules/acl b/modules/acl
index 434a634..73d2f3e 100644
--- a/modules/acl
+++ b/modules/acl
@@ -12,6 +12,7 @@ m4/acl.m4
 
 Depends-on:
 error
+extern-inline
 fstat
 gettext-h
 quote
diff --git a/modules/mbchar b/modules/mbchar
index 2ff5907..8f050e3 100644
--- a/modules/mbchar
+++ b/modules/mbchar
@@ -8,6 +8,7 @@ m4/mbchar.m4
 
 Depends-on:
 extensions
+extern-inline
 stdbool
 wchar
 wctype-h
diff --git a/modules/priv-set b/modules/priv-set
index 77e0164..0c0b156 100644
--- a/modules/priv-set
+++ b/modules/priv-set
@@ -8,6 +8,7 @@ m4/priv-set.m4
 
 Depends-on:
 errno
+extern-inline
 stdbool
 
 configure.ac:
-- 
1.7.11.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]