summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--lib/unistd.c3
-rw-r--r--lib/unistd.in.h10
-rw-r--r--m4/unistd_h.m43
-rw-r--r--modules/unistd3
5 files changed, 24 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1869b71a76..b5e43ab2f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
+ unistd: better 'inline'
+ * lib/unistd.c: New file.
+ * lib/unistd.in.h (_GL_UNISTD_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/unistd_h.m4 (gl_UNISTD_H): Do not require AC_C_INLINE.
+ * modules/unistd (Files, lib_SOURCES): Add lib/unistd.c.
+ (Depends-on): Add extern-inline.
+
sys_socket: better 'inline'
* lib/sys_socket.c: New file.
* lib/sys_socket.in.h (_GL_SYS_SOCKET_INLINE):
diff --git a/lib/unistd.c b/lib/unistd.c
new file mode 100644
index 0000000000..6c6a8e268c
--- /dev/null
+++ b/lib/unistd.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
+#include "unistd.h"
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 450d0be9cf..317c9b7db9 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -127,6 +127,11 @@
# 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 */
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index 7e7651b9d2..f68fbff8ce 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -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
diff --git a/modules/unistd b/modules/unistd
index 79115063c3..c887d4f16f 100644
--- a/modules/unistd
+++ b/modules/unistd
@@ -3,10 +3,12 @@ A GNU-like <unistd.h>.
Files:
m4/unistd_h.m4
+lib/unistd.c
lib/unistd.in.h
m4/off_t.m4
Depends-on:
+extern-inline
include_next
snippet/arg-nonnull
snippet/c++defs
@@ -20,6 +22,7 @@ gl_UNISTD_H
Makefile.am:
BUILT_SOURCES += unistd.h
+lib_SOURCES += unistd.c
# We need the following in order to create an empty placeholder for
# <unistd.h> when the system doesn't have one.