-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 6/29/2006 4:15 PM: > > Well, it was the suggestion from Bruno as seen in functions.texi, and has the > benefit that &mkdir is still a valid function pointer to the OS's exported > function (with a static replacement function, you no longer can guarantee > that > the function pointer is the same across .o files). But I went with your idea > of a static method as a cleaner solution. Besides, how often does code take > the address of mkdir? > > Checked in with the above changes. Thanks for the review.
Well, after using this in m4, I realized that without inline, gcc complains when the static function is unused. Installed this followon. lib/ChangeLog: 2006-06-29 Eric Blake <[EMAIL PROTECTED]> * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about unused static function. m4/ChangeLog: 2006-06-29 Eric Blake <[EMAIL PROTECTED]> * sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Use AC_C_INLINE. - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEpKYX84KuGfSFAYARAkNZAJ4kKHpU6jz3Uwz/euYbyLVDcmFJiACgl11N +XRXqDVN52+NjULcncWmDN4= =lJ+k -----END PGP SIGNATURE-----
Index: lib/stat_.h =================================================================== RCS file: /sources/gnulib/gnulib/lib/stat_.h,v retrieving revision 1.1 diff -u -p -r1.1 stat_.h --- lib/stat_.h 29 Jun 2006 22:17:42 -0000 1.1 +++ lib/stat_.h 30 Jun 2006 04:15:50 -0000 @@ -35,7 +35,13 @@ alias mkdir), only in the nonstandard io.h. */ #if ! HAVE_DECL_MKDIR && HAVE_IO_H # include <io.h> -static int rpl_mkdir (char const *name, mode_t mode) { return _mkdir (name); } + +static inline int +rpl_mkdir (char const *name, mode_t mode) +{ + return _mkdir (name); +} + # define mkdir rpl_mkdir #endif Index: m4/sys_stat_h.m4 =================================================================== RCS file: /sources/gnulib/gnulib/m4/sys_stat_h.m4,v retrieving revision 1.1 diff -u -p -r1.1 sys_stat_h.m4 --- m4/sys_stat_h.m4 29 Jun 2006 22:18:26 -0000 1.1 +++ m4/sys_stat_h.m4 30 Jun 2006 04:15:50 -0000 @@ -22,6 +22,7 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H], gl_FULL_HEADER_PATH([sys/stat.h]) FULL_PATH_SYS_STAT_H='<'$gl_cv_full_path_sys_stat_h'>' AC_CHECK_HEADERS([io.h]) + AC_REQUIRE([AC_C_INLINE]) AC_SUBST([FULL_PATH_SYS_STAT_H]) SYS_STAT_H='sys/stat.h' fi