]> code.delx.au - gnu-emacs/commitdiff
Merge from gnulib for 'inline'.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 30 Nov 2012 18:25:59 +0000 (10:25 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 30 Nov 2012 18:25:59 +0000 (10:25 -0800)
2012-11-29 snippet/warn-on-use: no 'static inline'
2012-11-29 ftruncate, fts, lstat, openat, raise: no 'static inline'
2012-11-29 arctwo, md4, md5, sha1, sha256, sha512: no 'static inline'
2012-11-29 fflush, stat: no 'static inline'
2012-11-29 stdio: better 'inline'
2012-11-29 sys_stat: no 'static inline'
2012-11-29 unistd: better 'inline'
2012-11-29 c-strtod, memcoll, readutmp: no 'static inline'
2012-11-29 extern-inline: no 'static inline'
2012-11-29 sys_socket: better 'inline'
* lib/stdio.c, lib/unistd.c: New files, from gnulib.
* build-aux/snippet/warn-on-use.h, lib/gnulib.mk, lib/lstat.c:
* lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c, lib/stat.c:
* lib/stdio.in.h, lib/sys_stat.in.h, lib/unistd.in.h, m4/c-strtod.m4:
* m4/extern-inline.m4, m4/gnulib-comp.m4, m4/lstat.m4, m4/md5.m4:
* m4/sha1.m4, m4/sha256.m4, m4/sha512.m4, m4/stat.m4, m4/stdio_h.m4:
* m4/sys_socket_h.m4, m4/sys_stat_h.m4, m4/unistd_h.m4:
Update from gnulib.

Fixes: debbugs:13040
27 files changed:
ChangeLog
build-aux/snippet/warn-on-use.h
lib/gnulib.mk
lib/lstat.c
lib/md5.c
lib/sha1.c
lib/sha256.c
lib/sha512.c
lib/stat.c
lib/stdio.c [new file with mode: 0644]
lib/stdio.in.h
lib/sys_stat.in.h
lib/unistd.c [new file with mode: 0644]
lib/unistd.in.h
m4/c-strtod.m4
m4/extern-inline.m4
m4/gnulib-comp.m4
m4/lstat.m4
m4/md5.m4
m4/sha1.m4
m4/sha256.m4
m4/sha512.m4
m4/stat.m4
m4/stdio_h.m4
m4/sys_socket_h.m4
m4/sys_stat_h.m4
m4/unistd_h.m4

index ab81d73e45cf7acc9f0e3cc31a1bde2b14d05fe1..b27377baa4a4eec31212983dde85314c6d1edb1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2012-11-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Merge from gnulib for 'inline' (Bug#13040), incorporating:
+       2012-11-29 snippet/warn-on-use: no 'static inline'
+       2012-11-29 ftruncate, fts, lstat, openat, raise: no 'static inline'
+       2012-11-29 arctwo, md4, md5, sha1, sha256, sha512: no 'static inline'
+       2012-11-29 fflush, stat: no 'static inline'
+       2012-11-29 stdio: better 'inline'
+       2012-11-29 sys_stat: no 'static inline'
+       2012-11-29 unistd: better 'inline'
+       2012-11-29 c-strtod, memcoll, readutmp: no 'static inline'
+       2012-11-29 extern-inline: no 'static inline'
+       2012-11-29 sys_socket: better 'inline'
+       * lib/stdio.c, lib/unistd.c: New files, from gnulib.
+       * build-aux/snippet/warn-on-use.h, lib/gnulib.mk, lib/lstat.c:
+       * lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c, lib/stat.c:
+       * lib/stdio.in.h, lib/sys_stat.in.h, lib/unistd.in.h, m4/c-strtod.m4:
+       * m4/extern-inline.m4, m4/gnulib-comp.m4, m4/lstat.m4, m4/md5.m4:
+       * m4/sha1.m4, m4/sha256.m4, m4/sha512.m4, m4/stat.m4, m4/stdio_h.m4:
+       * m4/sys_socket_h.m4, m4/sys_stat_h.m4, m4/unistd_h.m4:
+       Update from gnulib.
+
 2012-11-27  Eli Zaretskii  <eliz@gnu.org>
 
        * make-dist (nt): Adjust to changes in names of the *.manifest files.
index d4cb94f35256e487e3327d25143c995e9c38aec2..51e69bbd9b6c5917dcb488805dafce2e82ba5753 100644 (file)
@@ -55,7 +55,7 @@
    rather than issue the nice warning, but the end result of informing
    the developer about their portability problem is still achieved):
    #if HAVE_RAW_DECL_ENVIRON
-   static inline char ***rpl_environ (void) { return &environ; }
+   static char ***rpl_environ (void) { return &environ; }
    _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
    # undef environ
    # define environ (*rpl_environ ())
index 834f63169e23e94f428f2592e4307616d4b4996d..9d7cb2815647c81a312dda5f91bbdb968a281f12 100644 (file)
@@ -756,6 +756,7 @@ EXTRA_DIST += stdint.in.h
 ## begin gnulib module stdio
 
 BUILT_SOURCES += stdio.h
+libgnu_a_SOURCES += stdio.c
 
 # We need the following in order to create <stdio.h> when the system
 # doesn't have one that works with the given compiler.
@@ -1251,6 +1252,7 @@ EXTRA_DIST += u64.h
 ## begin gnulib module unistd
 
 BUILT_SOURCES += unistd.h
+libgnu_a_SOURCES += unistd.c
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
index db119a10d3f48db6f760dab5953696eb6b49902b..97fe6bb2d5320e8be3e3a37bac53ca0dfa10c729 100644 (file)
@@ -35,7 +35,7 @@ typedef int dummy;
 # include <sys/stat.h>
 # undef __need_system_sys_stat_h
 
-static inline int
+static int
 orig_lstat (const char *filename, struct stat *buf)
 {
   return lstat (filename, buf);
index 30b7e50e3ae454439950744744c41afefab73364..6e6d61270dd4db5588c81561aa09a212568985c3 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -83,7 +83,7 @@ md5_init_ctx (struct md5_ctx *ctx)
 /* Copy the 4 byte value from v into the memory location pointed to by *cp,
    If your architecture allows unaligned access this is equivalent to
    * (uint32_t *) cp = v  */
-static inline void
+static void
 set_uint32 (char *cp, uint32_t v)
 {
   memcpy (cp, &v, sizeof v);
index 0d82af14bc951b212fe02f83cfe52ee81792bfa4..b9505dd94678bc7aa5e8f18c1a61331baeeaf32b 100644 (file)
@@ -70,7 +70,7 @@ sha1_init_ctx (struct sha1_ctx *ctx)
 /* Copy the 4 byte value from v into the memory location pointed to by *cp,
    If your architecture allows unaligned access this is equivalent to
    * (uint32_t *) cp = v  */
-static inline void
+static void
 set_uint32 (char *cp, uint32_t v)
 {
   memcpy (cp, &v, sizeof v);
index a8d29da18ddfe6536f1444ce8d9ffb2ccfb94cb5..55273c6a3bc3de4152e5339a224597fe5f152e84 100644 (file)
@@ -90,7 +90,7 @@ sha224_init_ctx (struct sha256_ctx *ctx)
 /* Copy the value from v into the memory location pointed to by *cp,
    If your architecture allows unaligned access this is equivalent to
    * (uint32_t *) cp = v  */
-static inline void
+static void
 set_uint32 (char *cp, uint32_t v)
 {
   memcpy (cp, &v, sizeof v);
index cf62f2034e519e58d7d0fd462c370237b4c9ff86..dfb67a305d8551472d9cf7a09a83171e751b616d 100644 (file)
@@ -97,7 +97,7 @@ sha384_init_ctx (struct sha512_ctx *ctx)
 /* Copy the value from V into the memory location pointed to by *CP,
    If your architecture allows unaligned access, this is equivalent to
    * (__typeof__ (v) *) cp = v  */
-static inline void
+static void
 set_uint64 (char *cp, u64 v)
 {
   memcpy (cp, &v, sizeof v);
index 75995408906a72167b658a6885171a2bba8492c1..c0bcb88320fd39afae2d512580c90e5913e75734 100644 (file)
@@ -42,7 +42,7 @@
 # endif
 #endif
 
-static inline int
+static int
 orig_stat (const char *filename, struct stat *buf)
 {
   return stat (filename, buf);
diff --git a/lib/stdio.c b/lib/stdio.c
new file mode 100644 (file)
index 0000000..e6ed829
--- /dev/null
@@ -0,0 +1,3 @@
+#include <config.h>
+#define _GL_STDIO_INLINE _GL_EXTERN_INLINE
+#include "stdio.h"
index b1b543dee727416cc57cdc7aab77d0226968b20f..f3b52d28f6b8d8b12d2475daf53a4c1e6cae2be2 100644 (file)
 #ifndef _@GUARD_PREFIX@_STDIO_H
 #define _@GUARD_PREFIX@_STDIO_H
 
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_STDIO_INLINE
+# define _GL_STDIO_INLINE _GL_INLINE
+#endif
+
 /* Get va_list.  Needed on many systems, including glibc 2.8.  */
 #include <stdarg.h>
 
@@ -581,7 +586,7 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
    This affects only function declaration attributes, so it's not
    needed for C++.  */
 #  if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL
-static inline size_t _GL_ARG_NONNULL ((1, 4))
+_GL_STDIO_INLINE size_t _GL_ARG_NONNULL ((1, 4))
 rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
 {
   size_t r = fwrite (ptr, s, n, stream);
@@ -1333,6 +1338,7 @@ _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
                       "POSIX compliance");
 #endif
 
+_GL_INLINE_HEADER_END
 
 #endif /* _@GUARD_PREFIX@_STDIO_H */
 #endif /* _@GUARD_PREFIX@_STDIO_H */
index 2efc1e92e06070bb77b9299166183b9c602a0767..ac05ddb5cecf673fbab34534d8a6e516aa709c33 100644 (file)
@@ -497,7 +497,7 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
 #  if !GNULIB_defined_rpl_mkdir
-static inline int
+static int
 rpl_mkdir (char const *name, mode_t mode)
 {
   return _mkdir (name);
diff --git a/lib/unistd.c b/lib/unistd.c
new file mode 100644 (file)
index 0000000..6c6a8e2
--- /dev/null
@@ -0,0 +1,3 @@
+#include <config.h>
+#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
+#include "unistd.h"
index e904e512ee81d3ac05e4a9332f6ba201a62e2fee..6171f77ac718f3b4f04a998454aecf11043c71cb 100644 (file)
 # include <getopt.h>
 #endif
 
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_UNISTD_INLINE
+# define _GL_UNISTD_INLINE _GL_INLINE
+#endif
+
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
@@ -404,7 +409,7 @@ extern char **environ;
 # endif
 #elif defined GNULIB_POSIXCHECK
 # if HAVE_RAW_DECL_ENVIRON
-static inline char ***
+_GL_UNISTD_INLINE char ***
 rpl_environ (void)
 {
   return &environ;
@@ -862,7 +867,7 @@ _GL_CXXALIAS_RPL (getpagesize, int, (void));
 #     define getpagesize() _gl_getpagesize ()
 #    else
 #     if !GNULIB_defined_getpagesize_function
-static inline int
+_GL_UNISTD_INLINE int
 getpagesize ()
 {
   return _gl_getpagesize ();
@@ -1530,6 +1535,7 @@ _GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
 _GL_CXXALIASWARN (write);
 #endif
 
+_GL_INLINE_HEADER_END
 
 #endif /* _@GUARD_PREFIX@_UNISTD_H */
 #endif /* _@GUARD_PREFIX@_UNISTD_H */
index c002e5fceadcd2de5394a491538506fb76c85ff6..535721c8dbc6cf5fa1698ab51026a07518794a8f 100644 (file)
@@ -1,4 +1,4 @@
-# c-strtod.m4 serial 14
+# c-strtod.m4 serial 15
 
 # Copyright (C) 2004-2006, 2009-2012 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -38,9 +38,6 @@ AC_DEFUN([gl_C_STRTOD],
 [
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_FUNCS([strtod_l])
-
-  AC_REQUIRE([AC_C_INLINE])
-  :
 ])
 
 dnl Prerequisites of lib/c-strtold.c.
@@ -49,7 +46,4 @@ AC_DEFUN([gl_C_STRTOLD],
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_REQUIRE([gl_C99_STRTOLD])
   AC_CHECK_FUNCS([strtold_l])
-
-  AC_REQUIRE([AC_C_INLINE])
-  :
 ])
index 600c8d3fa17a8d89a14d583aaec97c929807672f..24922605e645b4cb9b80f6db2972a9c09d5d98e2 100644 (file)
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_EXTERN_INLINE],
 [
-  AC_REQUIRE([AC_C_INLINE])
   AH_VERBATIM([extern_inline],
 [/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
    _GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
@@ -32,8 +31,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
 # endif
 # define _GL_EXTERN_INLINE extern
 #else
-# define _GL_INLINE static inline
-# define _GL_EXTERN_INLINE static inline
+# define _GL_INLINE static
+# define _GL_EXTERN_INLINE static
 #endif
 
 #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
index 30f81b4781f2eaae3318a676fde81c290d5b65a8..1d09eb8ef92f4460ff0eef0df39f76bad782472b 100644 (file)
@@ -690,6 +690,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/stdbool.in.h
   lib/stddef.in.h
   lib/stdint.in.h
+  lib/stdio.c
   lib/stdio.in.h
   lib/stdlib.in.h
   lib/strftime.c
@@ -712,6 +713,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/timespec.h
   lib/u64.c
   lib/u64.h
+  lib/unistd.c
   lib/unistd.in.h
   lib/utimens.c
   lib/utimens.h
index b7335bda1b22919415a2da966002487e194443cb..01b4eb953d59b830d9228a067820bea02cde19bd 100644 (file)
@@ -1,4 +1,4 @@
-# serial 25
+# serial 26
 
 # Copyright (C) 1997-2001, 2003-2012 Free Software Foundation, Inc.
 #
@@ -27,11 +27,7 @@ AC_DEFUN([gl_FUNC_LSTAT],
 ])
 
 # Prerequisites of lib/lstat.c.
-AC_DEFUN([gl_PREREQ_LSTAT],
-[
-  AC_REQUIRE([AC_C_INLINE])
-  :
-])
+AC_DEFUN([gl_PREREQ_LSTAT], [:])
 
 AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
 [
index e22f7bdb17ae5beab160e08e8b5747a0cffae513..85ed8946068e7ce6fa45c99c727c8bad0de5818f 100644 (file)
--- a/m4/md5.m4
+++ b/m4/md5.m4
@@ -1,4 +1,4 @@
-# md5.m4 serial 12
+# md5.m4 serial 13
 dnl Copyright (C) 2002-2006, 2008-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,
@@ -8,6 +8,5 @@ AC_DEFUN([gl_MD5],
 [
   dnl Prerequisites of lib/md5.c.
   AC_REQUIRE([gl_BIGENDIAN])
-  AC_REQUIRE([AC_C_INLINE])
   :
 ])
index 76198258b92c2045b44b06e82b8385f5d688f427..29fa4850341bebe8dfe0160492ac03e0c9c34fa5 100644 (file)
@@ -1,4 +1,4 @@
-# sha1.m4 serial 10
+# sha1.m4 serial 11
 dnl Copyright (C) 2002-2006, 2008-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,
@@ -8,6 +8,5 @@ AC_DEFUN([gl_SHA1],
 [
   dnl Prerequisites of lib/sha1.c.
   AC_REQUIRE([gl_BIGENDIAN])
-  AC_REQUIRE([AC_C_INLINE])
   :
 ])
index 78cc95ed8b6b3f7c7a3af1706e723d64f0fdc0e2..f75a7fb9e07917dd09005980755d9e17fa669015 100644 (file)
@@ -1,4 +1,4 @@
-# sha256.m4 serial 5
+# sha256.m4 serial 6
 dnl Copyright (C) 2005, 2008-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,
@@ -8,5 +8,4 @@ AC_DEFUN([gl_SHA256],
 [
   dnl Prerequisites of lib/sha256.c.
   AC_REQUIRE([gl_BIGENDIAN])
-  AC_REQUIRE([AC_C_INLINE])
 ])
index 937ea8d5e9dd1865bd5d9e7547bbb67d908ff0d7..e6e27393d7d5445e3287d88e028d9e7a7f1d9c48 100644 (file)
@@ -1,4 +1,4 @@
-# sha512.m4 serial 6
+# sha512.m4 serial 7
 dnl Copyright (C) 2005-2006, 2008-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,
@@ -8,5 +8,4 @@ AC_DEFUN([gl_SHA512],
 [
   dnl Prerequisites of lib/sha512.c.
   AC_REQUIRE([gl_BIGENDIAN])
-  AC_REQUIRE([AC_C_INLINE])
 ])
index a8b79f5bcbaad568ac3e245fc0f10a8426fcbe9c..0fd117e05eb71887730677b23c1cf9ca30e5d7ba 100644 (file)
@@ -1,4 +1,4 @@
-# serial 10
+# serial 11
 
 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
 #
@@ -68,8 +68,4 @@ AC_DEFUN([gl_FUNC_STAT],
 ])
 
 # Prerequisites of lib/stat.c.
-AC_DEFUN([gl_PREREQ_STAT],
-[
-  AC_REQUIRE([AC_C_INLINE])
-  :
-])
+AC_DEFUN([gl_PREREQ_STAT], [:])
index 5298dd6d9d5e491e4fc40fff4f0bea509d69ff03..3bd65803667bddac0bb424ce824de230e8eca04d 100644 (file)
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 42
+# stdio_h.m4 serial 43
 dnl Copyright (C) 2007-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,
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_STDIO_H],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  AC_REQUIRE([AC_C_INLINE])
   gl_NEXT_HEADERS([stdio.h])
 
   dnl No need to create extra modules for these functions. Everyone who uses
index 8d4e7e1ebb42b5f29cc934e3e0d959bad7c88749..acfae4132834e09c0a713a42b916715d5af35aae 100644 (file)
@@ -1,4 +1,4 @@
-# sys_socket_h.m4 serial 22
+# sys_socket_h.m4 serial 23
 dnl Copyright (C) 2005-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,7 +10,6 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
 [
   AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([AC_C_INLINE])
 
   dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
   dnl old-style declarations (with return type 'int' instead of 'ssize_t')
index f45dee1dc4dc35c88c5fdc900244d4f8343ddee2..8af3353ea5108608e167f2b74e3feb362d15b8a5 100644 (file)
@@ -1,4 +1,4 @@
-# sys_stat_h.m4 serial 27   -*- Autoconf -*-
+# sys_stat_h.m4 serial 28   -*- Autoconf -*-
 dnl Copyright (C) 2006-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,
@@ -11,9 +11,6 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
 [
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
 
-  dnl For the mkdir substitute.
-  AC_REQUIRE([AC_C_INLINE])
-
   dnl Check for broken stat macros.
   AC_REQUIRE([AC_HEADER_STAT])
 
index 7e7651b9d2e430b6303fe9e7be584361389c50a7..f68fbff8cefdeac2aa19f5b8b6bbf0c386bd65e6 100644 (file)
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 65
+# unistd_h.m4 serial 66
 dnl Copyright (C) 2006-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,
@@ -11,7 +11,6 @@ AC_DEFUN([gl_UNISTD_H],
   dnl Use AC_REQUIRE here, so that the default behavior below is expanded
   dnl once only, before all statements that occur in other macros.
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  AC_REQUIRE([AC_C_INLINE])
 
   gl_CHECK_NEXT_HEADERS([unistd.h])
   if test $ac_cv_header_unistd_h = yes; then