]> Savannah Git Hosting - gnulib.git/commitdiff
fchmodat, fchownat, fstatat: use extern-inline
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 30 Aug 2012 04:09:50 +0000 (21:09 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 22 Sep 2012 08:58:23 +0000 (01:58 -0700)
* lib/fchmodat.c, lib/openat.h (FCHMODAT_INLINE):
* lib/fchownat.c, lib/openat.h (FCHOWNAT_INLINE):
* lib/fstatat.c, lib/openat.h (FSTATAT_INLINE):
New macros.
* lib/openat.h:
Replace all uses of 'static inline' with them.
Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
* modules/fchmodat, modules/fchownat, modules/fstatat:
* modules/openat-h:
(Depends-on):
Add extern-inline.
(configure.ac): Remove AC_C_INLINE.

ChangeLog
lib/fchmodat.c
lib/fchownat.c
lib/fstatat.c
lib/openat.h
modules/fchmodat
modules/fchownat
modules/fstatat
modules/openat-h

index 4e899d75d1be29cbdc476b41c98505460b424b63..39e733a8e2256626563fe1d0741aab96b46c792c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
 
+       fchmodat, fchownat, fstatat: use extern-inline
+       * lib/fchmodat.c, lib/openat.h (FCHMODAT_INLINE):
+       * lib/fchownat.c, lib/openat.h (FCHOWNAT_INLINE):
+       * lib/fstatat.c, lib/openat.h (FSTATAT_INLINE):
+       New macros.
+       * lib/openat.h:
+       Replace all uses of 'static inline' with them.
+       Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+       * modules/fchmodat, modules/fchownat, modules/fstatat:
+       * modules/openat-h:
+       (Depends-on):
+       Add extern-inline.
+       (configure.ac): Remove AC_C_INLINE.
+
        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):
index ce848fd4ee9daa820d95db80aede12ae67d64d91..b1940d5556098081a192ec6913e37b1beec0dec8 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <config.h>
 
+#include FCHMODAT_INLINE _GL_EXTERN_INLINE
+
 #include <sys/stat.h>
 
 #include <errno.h>
index 4f6a44d040c642e8bf3196c02a2d8c35aff6990a..c6e2d56fed52042609a43db314ec0abed1530bc5 100644 (file)
@@ -23,6 +23,8 @@
 
 #include <config.h>
 
+#include FCHOWNAT_INLINE _GL_EXTERN_INLINE
+
 #include <unistd.h>
 
 #include <errno.h>
index 9b701c4d6175e2bcfe3797bf710490a74fb423a0..ed42fa8345d828e9909e55863a06ce8b96185c9f 100644 (file)
 #define __need_system_sys_stat_h
 #include <config.h>
 
+#include FSTATAT_INLINE _GL_EXTERN_INLINE
+
 /* Get the original definition of fstatat.  It might be defined as a macro.  */
 #include <sys/types.h>
 #include <sys/stat.h>
 #undef __need_system_sys_stat_h
 
 #if HAVE_FSTATAT
-static inline int
+static int
 orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
 {
   return fstatat (fd, filename, buf, flags);
@@ -97,7 +99,7 @@ rpl_fstatat (int fd, char const *file, struct stat *st, int flag)
    because the preprocessor sees a use of a macro that requires two
    arguments but is only given one.  Hence, we need an inline
    forwarder to get past the preprocessor.  */
-static inline int
+static int
 stat_func (char const *name, struct stat *st)
 {
   return stat (name, st);
index d646250bb354a19331fc2287741d7961ec20ad66..0f542c6ef43527dcd83fe3b77383d91349d2d9dd 100644 (file)
@@ -26,6 +26,8 @@
 #include <unistd.h>
 #include <stdbool.h>
 
+_GL_INLINE_HEADER_BEGIN
+
 #if !HAVE_OPENAT
 
 int openat_permissive (int fd, char const *file, int flags, mode_t mode,
@@ -49,13 +51,17 @@ _Noreturn void openat_save_fail (int);
 
 #if GNULIB_FCHOWNAT
 
-static inline int
+# ifndef FCHOWNAT_INLINE
+#  define FCHOWNAT_INLINE _GL_INLINE
+# endif
+
+FCHOWNAT_INLINE int
 chownat (int fd, char const *file, uid_t owner, gid_t group)
 {
   return fchownat (fd, file, owner, group, 0);
 }
 
-static inline int
+FCHOWNAT_INLINE int
 lchownat (int fd, char const *file, uid_t owner, gid_t group)
 {
   return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
@@ -65,13 +71,17 @@ lchownat (int fd, char const *file, uid_t owner, gid_t group)
 
 #if GNULIB_FCHMODAT
 
-static inline int
+# ifndef FCHMODAT_INLINE
+#  define FCHMODAT_INLINE _GL_INLINE
+# endif
+
+FCHMODAT_INLINE int
 chmodat (int fd, char const *file, mode_t mode)
 {
   return fchmodat (fd, file, mode, 0);
 }
 
-static inline int
+FCHMODAT_INLINE int
 lchmodat (int fd, char const *file, mode_t mode)
 {
   return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
@@ -81,13 +91,17 @@ lchmodat (int fd, char const *file, mode_t mode)
 
 #if GNULIB_FSTATAT
 
-static inline int
+# ifndef FSTATAT_INLINE
+#  define FSTATAT_INLINE _GL_INLINE
+# endif
+
+FSTATAT_INLINE int
 statat (int fd, char const *name, struct stat *st)
 {
   return fstatat (fd, name, st, 0);
 }
 
-static inline int
+FSTATAT_INLINE int
 lstatat (int fd, char const *name, struct stat *st)
 {
   return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
@@ -101,4 +115,6 @@ lstatat (int fd, char const *name, struct stat *st)
    wrappers are not provided for accessat or euidaccessat, so as to
    avoid dragging in -lgen on some platforms.  */
 
+_GL_INLINE_HEADER_END
+
 #endif /* _GL_HEADER_OPENAT */
index f81dd81624acda1cf400cbbb43905006ca89d343..94fad771a3d65ff864f723c3a7a0e9eef76b9741 100644 (file)
@@ -13,6 +13,7 @@ extensions
 at-internal     [test $HAVE_FCHMODAT = 0]
 dosname         [test $HAVE_FCHMODAT = 0]
 errno           [test $HAVE_FCHMODAT = 0]
+extern-inline   [test $HAVE_FCHMODAT = 0]
 fchdir          [test $HAVE_FCHMODAT = 0]
 fcntl-h         [test $HAVE_FCHMODAT = 0]
 openat-die      [test $HAVE_FCHMODAT = 0]
@@ -24,7 +25,6 @@ gl_FUNC_FCHMODAT
 if test $HAVE_FCHMODAT = 0; then
   AC_LIBOBJ([fchmodat])
 fi
-AC_REQUIRE([AC_C_INLINE]) dnl because 'inline' is used in lib/openat.h
 gl_MODULE_INDICATOR([fchmodat]) dnl for lib/openat.h
 gl_SYS_STAT_MODULE_INDICATOR([fchmodat])
 
index 886b6b36e8a2631231bcd9cd2debe362089f319a..7fba3edc20ffde72eccf861c575f9768f7b6039f 100644 (file)
@@ -13,6 +13,7 @@ extensions
 at-internal     [test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1]
 dosname         [test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1]
 errno           [test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1]
+extern-inline   [test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1]
 fchdir          [test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1]
 fcntl-h         [test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1]
 lchown          [test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1]
@@ -26,7 +27,6 @@ gl_FUNC_FCHOWNAT
 if test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1; then
   AC_LIBOBJ([fchownat])
 fi
-AC_REQUIRE([AC_C_INLINE]) dnl because 'inline' is used in lib/openat.h
 gl_MODULE_INDICATOR([fchownat]) dnl for lib/openat.h
 gl_UNISTD_MODULE_INDICATOR([fchownat])
 
index fa78faf6d908092087ddc56742cd8284e13746cc..69e9a7b64129cbcef2e5c1c41f67f18b00ccc054 100644 (file)
@@ -14,6 +14,7 @@ extensions
 at-internal     [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
 dosname         [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
 errno           [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
+extern-inline   [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
 fchdir          [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
 fcntl-h         [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
 lstat           [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]
@@ -26,7 +27,6 @@ gl_FUNC_FSTATAT
 if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
   AC_LIBOBJ([fstatat])
 fi
-AC_REQUIRE([AC_C_INLINE]) dnl because 'inline' is used in lib/openat.h
 gl_MODULE_INDICATOR([fstatat]) dnl for lib/openat.h
 gl_SYS_STAT_MODULE_INDICATOR([fstatat])
 
index 2af3b8885f3a4fa06680f5f230faa0013c47b764..6165dff9f6677d27cd2cc475956e6ea895b16100 100644 (file)
@@ -5,6 +5,7 @@ Files:
 lib/openat.h
 
 Depends-on:
+extern-inline
 fcntl-h
 stdbool
 sys_stat