]> Savannah Git Hosting - gnulib.git/commitdiff
getpagesize: Fix use of 'extern inline' (regression 2012-11-20).
authorBruno Haible <bruno@clisp.org>
Mon, 11 Nov 2024 08:33:11 +0000 (09:33 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 11 Nov 2024 08:33:11 +0000 (09:33 +0100)
* lib/unistd.in.h (_GL_GETPAGESIZE_INLINE): New macro.
(getpagesize): Use it.
* lib/getpagesize.c (_GL_GETPAGESIZE_INLINE): Define.
* modules/getpagesize (configure.ac): Compile getpagesize.c also when
getpagesize is missing.

ChangeLog
lib/getpagesize.c
lib/unistd.in.h
modules/getpagesize

index 4ba563545fc576171e3e01a5fb321ba1e70af990..53b3a1cc50c8a5d1951741b32d5fd44cdae53cd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-11-11  Bruno Haible  <bruno@clisp.org>
+
+       getpagesize: Fix use of 'extern inline' (regression 2012-11-20).
+       * lib/unistd.in.h (_GL_GETPAGESIZE_INLINE): New macro.
+       (getpagesize): Use it.
+       * lib/getpagesize.c (_GL_GETPAGESIZE_INLINE): Define.
+       * modules/getpagesize (configure.ac): Compile getpagesize.c also when
+       getpagesize is missing.
+
 2024-11-11  Bruno Haible  <bruno@clisp.org>
 
        realloc-posix: Fix link error (regression 2024-11-04).
index d203155329077876a0f6e26eaf3317381ebffe65..dd880a6ca278a5384c4e0fc332c5935f7ede5fa3 100644 (file)
@@ -20,6 +20,7 @@
 #include <config.h>
 
 /* Specification. */
+#define _GL_GETPAGESIZE_INLINE _GL_EXTERN_INLINE
 #include <unistd.h>
 
 /* This implementation is only for native Windows systems.  */
index 20b1356fd382d55250dd8c0686156dd3d090b606..ceb3cb48f15f59d152bd50712302c133a4f57002 100644 (file)
@@ -181,6 +181,9 @@ _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_UNISTD_INLINE
 # define _GL_UNISTD_INLINE _GL_INLINE
 #endif
+#ifndef _GL_GETPAGESIZE_INLINE
+# define _GL_GETPAGESIZE_INLINE _GL_INLINE
+#endif
 
 /* Hide some function declarations from <winsock2.h>.  */
 
@@ -1478,7 +1481,7 @@ _GL_FUNCDECL_SYS (getpagesize, int, (void), );
 #     define getpagesize() _gl_getpagesize ()
 #    else
 #     if !GNULIB_defined_getpagesize_function
-_GL_UNISTD_INLINE int
+_GL_GETPAGESIZE_INLINE int
 getpagesize ()
 {
   return _gl_getpagesize ();
index 7b38fff93bdb4761d413e75c29a97e86af613dce..a883edf06794cf3fb599eb5e9bbfeba37eac4f4d 100644 (file)
@@ -10,7 +10,8 @@ unistd
 
 configure.ac:
 gl_FUNC_GETPAGESIZE
-gl_CONDITIONAL([GL_COND_OBJ_GETPAGESIZE], [test $REPLACE_GETPAGESIZE = 1])
+gl_CONDITIONAL([GL_COND_OBJ_GETPAGESIZE],
+               [test $HAVE_GETPAGESIZE = 0 || test $REPLACE_GETPAGESIZE = 1])
 gl_UNISTD_MODULE_INDICATOR([getpagesize])
 
 Makefile.am: