argp: better 'inline'
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 19 Dec 2012 01:59:33 +0000 (17:59 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 19 Dec 2012 02:00:09 +0000 (18:00 -0800)
Use extern-inline module to declare extern inline functions.
This avoids some bogus warning diagnostics.  Problem discovered
when modifying GNU tar to use the manywarnings module.
* lib/argp.h, lib/argp-xinl.c (ARGP_EI) [!_LIBC]:
* lib/argp-fmtstream.h, lib/argp-fs-xinl.c (ARGP_FS_EI) [!_LIBC]:
Define based on extern-inline.
* modules/argp (Depends-on): Add extern-inline.

ChangeLog
lib/argp-fmtstream.h
lib/argp-fs-xinl.c
lib/argp-xinl.c
lib/argp.h
modules/argp

index a2d2b23..b9e213b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-12-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       argp: better 'inline'
+       Use extern-inline module to declare extern inline functions.
+       This avoids some bogus warning diagnostics.  Problem discovered
+       when modifying GNU tar to use the manywarnings module.
+       * lib/argp.h, lib/argp-xinl.c (ARGP_EI) [!_LIBC]:
+       * lib/argp-fmtstream.h, lib/argp-fs-xinl.c (ARGP_FS_EI) [!_LIBC]:
+       Define based on extern-inline.
+       * modules/argp (Depends-on): Add extern-inline.
+
 2012-12-17  Paul Eggert  <eggert@cs.ucla.edu>
 
        filemode, sys_stat: Handle MPX files a la AIX.
index a891c3d..3de0979 100644 (file)
@@ -197,6 +197,10 @@ extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
 #define __argp_fmtstream_point argp_fmtstream_point
 #define __argp_fmtstream_update _argp_fmtstream_update
 #define __argp_fmtstream_ensure _argp_fmtstream_ensure
+_GL_INLINE_HEADER_BEGIN
+#ifndef ARGP_FS_EI
+# define ARGP_FS_EI _GL_INLINE
+#endif
 #endif
 
 #ifndef ARGP_FS_EI
@@ -345,6 +349,7 @@ __argp_fmtstream_point (argp_fmtstream_t __fs)
 #undef __argp_fmtstream_point
 #undef __argp_fmtstream_update
 #undef __argp_fmtstream_ensure
+_GL_INLINE_HEADER_END
 #endif
 
 #endif /* __OPTIMIZE__ */
index b030e58..408e5d0 100644 (file)
 # include <config.h>
 #endif
 
-#define ARGP_FS_EI
+#ifdef _LIBC
+# define ARGP_FS_EI
+#else
+# define ARGP_FS_EI _GL_EXTERN_INLINE
+#endif
 #undef __OPTIMIZE__
 #define __OPTIMIZE__ 1
 #include "argp-fmtstream.h"
index 7d45fcb..731833d 100644 (file)
 #ifndef __USE_EXTERN_INLINES
 # define __USE_EXTERN_INLINES   1
 #endif
-#define ARGP_EI
+#ifdef _LIBC
+# define ARGP_EI
+#else
+# define ARGP_EI _GL_EXTERN_INLINE
+#endif
 #undef __OPTIMIZE__
 #define __OPTIMIZE__ 1
 #include "argp.h"
index c0c68a6..8a7654a 100644 (file)
@@ -579,6 +579,10 @@ extern void *__argp_input (const struct argp *__restrict __argp,
 #  define __argp_state_help argp_state_help
 #  define __option_is_short _option_is_short
 #  define __option_is_end _option_is_end
+_GL_INLINE_HEADER_BEGIN
+#  ifndef ARGP_EI
+#   define ARGP_EI _GL_INLINE
+#  endif
 # endif
 
 # ifndef ARGP_EI
@@ -635,6 +639,7 @@ __NTH (__option_is_end (const struct argp_option *__opt))
 #  undef __argp_state_help
 #  undef __option_is_short
 #  undef __option_is_end
+_GL_INLINE_HEADER_END
 # endif
 #endif /* Use extern inlines.  */
 
index 8d49681..125046a 100644 (file)
@@ -25,6 +25,7 @@ m4/argp.m4
 Depends-on:
 alloca
 dirname-lgpl
+extern-inline
 getopt-gnu
 strchrnul
 sysexits